Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Healthcheck' cmdlet needed #18

Open
leshkinski opened this issue Jan 25, 2016 · 1 comment
Open

'Healthcheck' cmdlet needed #18

leshkinski opened this issue Jan 25, 2016 · 1 comment

Comments

@leshkinski
Copy link
Contributor

We need a cmdlet that would go over all key areas of the pull server config and report any anomalies to speed up troubleshooting in the future.

@webmin88
Copy link

So I sourced this little tidbit from: http://blogs.msdn.com/b/powershell/archive/2014/05/29/how-to-retrieve-node-information-from-pull-server.aspx

function QueryNodeInformation
{
  Param (     
       [string] $Uri = "http://localhost:7070/PSDSCComplianceServer.svc/Status",                         
       [string] $ContentType = "application/json"          
     )
  Write-Host "Querying node information from pull server URI  = $Uri" -ForegroundColor Green
  Write-Host "Querying node status in content type  = $ContentType " -ForegroundColor Green


 $response = Invoke-WebRequest -Uri $Uri -Method Get -ContentType $ContentType -UseDefaultCredentials -Headers @{Accept = $ContentType}

 if($response.StatusCode -ne 200)
 {
     Write-Host "node information was not retrieved." -ForegroundColor Red
 }

 $jsonResponse = ConvertFrom-Json $response.Content

 return $jsonResponse

}

To get this to work, I had to create an http binding listening for requests on localhost:9081 on the PSDSCComplianceServer site. We can use this to pull the status code, heartbeat, last runtime, etc. Tie this in with a SNS or other notification system and we can follow client provisioning to ensure it does not fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants