Page 1 of 2

Service Status - Nagios XI Dashboard Error

Posted: Fri Aug 28, 2015 4:01 pm
by kvaldez
Hi,

Im monitoring the activity of a webService using the check_http command.

I created a new command on configure -> Core Config Manager -> Commands using this sentence:

Code: Select all

$USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$ -k $ARG2$ -T application/xml -u $ARG3$ -P $ARG4$
After creating the command I created a new service and select the new command from the drop down list.
I added the Host, ARG's and finally the service objects as I normally would (templates, check and alert setting
s, etc).

After that when going to home theres a warning on Service Detail option, the status detail:

Code: Select all

(No output on stdout) stderr: /bin/sh: -c: line 0: syntax error near unexpected token `newline'

Code: Select all

(No output on stdout) stderr: /bin/sh: -c: line 0: syntax error near unexpected token `newline'
/bin/sh: -c: line 0: `/usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P <ping>PruebaConectividad</ping>'

Re: Service Status - Nagios XI Dashboard Error

Posted: Sun Aug 30, 2015 7:06 pm
by Box293
kvaldez wrote:-P <ping>PruebaConectividad</ping>
Either enclose the -P argument in single quotes or escape the <>

Code: Select all

-P '<ping>PruebaConectividad</ping>'

Code: Select all

-P \<ping\>PruebaConectividad\</ping\>

Re: Service Status - Nagios XI Dashboard Error

Posted: Tue Sep 01, 2015 9:43 am
by kvaldez
Hi,

Thanks for your reply.

On Services window when I replace the ARG for -P argument on test command I get this output:

For '<ping>PruebaConectividad</ping>' :

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P '\PruebaConectividad\'
OUTPUT: CRITICAL - Socket timeout after 10 seconds
For \<ping\>PruebaConectividad\</ping\> :

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P \\\PruebaConectividad\\\
OUTPUT: CRITICAL - Socket timeout after 10 seconds
Finally for both on Home -> Service Detail, I keep getting the same error

Code: Select all

(No output on stdout) stderr: /bin/sh: -c: line 0: syntax error near unexpected token `newline'

Code: Select all

bin/sh: -c: line 0: `/usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P <ping>PruebaConectividad</ping>'
-kvaldez

Re: Service Status - Nagios XI Dashboard Error

Posted: Tue Sep 01, 2015 1:31 pm
by tgriep
I think the left single quote was in the wrong place, try running this and see if this resolves it for you.

Code: Select all

/usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P '<ping>PruebaConectividad</ping>'

Re: Service Status - Nagios XI Dashboard Error

Posted: Tue Sep 01, 2015 4:41 pm
by kvaldez
Keep getting the same error :?

-kvaldez

Re: Service Status - Nagios XI Dashboard Error

Posted: Tue Sep 01, 2015 4:50 pm
by ssax
Are you running this command directly from the command line? (not through XI)

Code: Select all

/usr/local/nagios/libexec/check_http -H 192.168.0.99 -p 8283 -k SOAPAction:enviarDocumento -T application/xml -u /services/ESB_LOG -P '<ping>PruebaConectividad</ping>'
Can you access that page/port? Does it require authentication?

Re: Service Status - Nagios XI Dashboard Error

Posted: Wed Sep 02, 2015 10:34 am
by kvaldez
Hi,

From commad line there's no issue.

But when running from XI there comes the error

-kvaldez

Re: Service Status - Nagios XI Dashboard Error

Posted: Wed Sep 02, 2015 10:40 am
by jdalrymple
The core interface has a handy tool for expanding the command that Nagios is trying to run. Can you grab a screenshot of that for us:

http://yournagiosserver/nagios

Configuration (lower left corner)
Services --> Continue
Locate the appropriate service and click on the highlighted text in the "Check Command" column, there is a search field in the upper right that may be helpful

Send a screenshot of the resulting page.

Re: Service Status - Nagios XI Dashboard Error

Posted: Wed Sep 02, 2015 11:05 am
by kvaldez
I upload the capture screens you want to the post.

Hope this can help.

-kvaldez

Re: Service Status - Nagios XI Dashboard Error

Posted: Wed Sep 02, 2015 3:32 pm
by tmcdonald
That screenshot is from the XI interface, we need you to follow the instructions posted for the Core interface. The XI Test Check Command button is not always an accurate representation and may differ from what is actually run. Please follow @jdalrymple's instructions from his last post.