Page 1 of 1
Monitor command prompt output
Posted: Thu May 25, 2017 10:11 am
by sgiworks
Hello Team,
Has anyone worked on monitoring output at command prompt through Nagios XI?
example:
D:\iPC\tools\pdmp-console\bin> console -u %SRV_iPC_ENV_USER% -p %SRV_iPC_ENV_PASSWORD% daemon -n event.daemon -status
Regards,
Swapnil
Re: Monitor command prompt output
Posted: Thu May 25, 2017 10:15 am
by dwhitfield
Are you using cmd or PowerShell...or something else?
Re: Monitor command prompt output
Posted: Thu May 25, 2017 10:30 am
by sgiworks
Basically we want to monitor the response of SOAP [text highlighted in red below]
SOAP Request (need HTTP Basic Auth with the service account credentials)
HTTP POST at
http://SERVERNAME:8080/pdmp/services/re ... pBasicAuth
Body:
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="
http://eclipse.org/stardust/ws/v2012a/api">
<soapenv:Header/>
<soapenv:Body>
<api:getDaemonStatus>
<api:daemonParameters>
<api:daemonParameter>
<api:type>event.daemon</api:type>
<api:acknowledge>true</api:acknowledge>
</api:daemonParameter>
</api:daemonParameters>
</api:getDaemonStatus>
</soapenv:Body>
</soapenv:Envelope>
Response - <running /> should be true as check condition:
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"/>
<soap:Body>
<getDaemonStatusResponse xmlns="
http://eclipse.org/stardust/ws/v2012a/api" xmlns:ns2="
http://eclipse.org/stardust/ws/v2012a/api/query">
<deamons>
<daemon>
<type>event.daemon</type>
<startTime>2017-05-18T17:52:21.886-04:00</startTime>
<lastExecutionTime>2017-05-22T11:56:29.250-04:00</lastExecutionTime>
<running>true</running>
<acknowledgementState>OK</acknowledgementState>
<daemonExecutionState>OK</daemonExecutionState>
</daemon>
</deamons>
</getDaemonStatusResponse>
</soap:Body>
</soap:Envelope>
Re: Monitor command prompt output
Posted: Thu May 25, 2017 10:31 am
by sgiworks
Re: Monitor command prompt output
Posted: Thu May 25, 2017 10:56 am
by dwhitfield
Is there a reason you aren't using check_http as suggested in the link you provide? Are you trying to see if a Windows device can do something? You listed in your initial command a D:\ which suggests Windows.
Have you looked at our four web wizards?
http://YOURSERVER/nagiosxi/config/?xiwi ... wizard.php
Re: Monitor command prompt output
Posted: Thu May 25, 2017 11:00 am
by sgiworks
I have created a following command:
$USER1$/check_http -r 'true' -T application/xml -P '<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="
http://eclipse.org/stardust/ws/v2012a/a ... v:Envelope>' -t 60 -m 512 -p 8080 -H $HOSTADDRESS$ -a SRV_LG_iPC_Test:$ARG1$
and the OUTPUT I am seeing is as follows:
HTTP CRITICAL: HTTP/1.1 200 OK - pattern not found - 1743 bytes in 0.008 second response time
Not sure were the problem is with pattern
Any help will be appreciated.
Re: Monitor command prompt output
Posted: Thu May 25, 2017 2:47 pm
by tgriep
Can you run the check from the command line but add the verbose option to the command "-v" and post the output here?
When you use that option, you will see the call that check_http checks as well as what is returned and that could help in troubleshooting the issue.
Re: Monitor command prompt output
Posted: Fri May 26, 2017 8:01 am
by sgiworks
I got it working, you can close this thread.