Service Status - Nagios XI Dashboard Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
kvaldez
Posts: 27
Joined: Tue Aug 18, 2015 4:57 pm
Location: Lima/Peru

Service Status - Nagios XI Dashboard Error

Post 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>'
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Service Status - Nagios XI Dashboard Error

Post 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\>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
kvaldez
Posts: 27
Joined: Tue Aug 18, 2015 4:57 pm
Location: Lima/Peru

Re: Service Status - Nagios XI Dashboard Error

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Service Status - Nagios XI Dashboard Error

Post 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>'
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kvaldez
Posts: 27
Joined: Tue Aug 18, 2015 4:57 pm
Location: Lima/Peru

Re: Service Status - Nagios XI Dashboard Error

Post by kvaldez »

Keep getting the same error :?

-kvaldez
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Status - Nagios XI Dashboard Error

Post 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?
User avatar
kvaldez
Posts: 27
Joined: Tue Aug 18, 2015 4:57 pm
Location: Lima/Peru

Re: Service Status - Nagios XI Dashboard Error

Post by kvaldez »

Hi,

From commad line there's no issue.

But when running from XI there comes the error

-kvaldez
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Service Status - Nagios XI Dashboard Error

Post 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.
User avatar
kvaldez
Posts: 27
Joined: Tue Aug 18, 2015 4:57 pm
Location: Lima/Peru

Re: Service Status - Nagios XI Dashboard Error

Post by kvaldez »

I upload the capture screens you want to the post.

Hope this can help.

-kvaldez
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Service Status - Nagios XI Dashboard Error

Post 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.
Former Nagios employee
Locked