Hi,
I’m newbie to Powershell.
As part of routine health check, i need to monitor several web application servers manually using URL for each server. just wondering if I could get status of all web server components in single file (html/txt/csv) would make my job easy.
to start, I used ‘Invoke-webrequest’ followed by RawContent where I see expected output (ex. Cognos-ContentManager-State: running in below expample) but with more un-necessary information.
so how do I get specific contents from each URL…
I’m expecting output something like,
URL Component Status
url1 Running
url2 Running
url3 Standby
PS C:\WINDOWS\system32> $webpage=Invoke-webrequest “http://myserver:9300/p2pd/servlet”
$webpage.RawContent
Output
HTTP/1.1 200 OK
X-Cognos-ContentManager-State: running
Content-Length: 712
Content-Type: text/html
Date: Fri, 10 Feb 2017 14:28:10 GMT
Server: Apache-Coyote/1.1