NagiosXI Bug in check_nt SERVICESTATE

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SomeClown
Posts: 6
Joined: Tue Mar 02, 2010 2:24 pm

NagiosXI Bug in check_nt SERVICESTATE

Post by SomeClown »

Greetings,

I've found an interesting and annoying bug in the wizard configuration of check_nt servicestate. If you attempt to put quotes around the service name, and you don't use a password, then "SERVICESTATE" and all other arguments get bumped up one variable. In other words, SERVICESTATE gets shoved up to $ARG1$ which is configured as the password box. If you attempt to put a blank space in the password box, the arguments don't move, but of course you get an invalid password result. In our case we need quotes around the service name because of the parsing being done in the system... so a command-line version of the command, which works, would look like this:

./check_nt -H someserver.somedomain.com -p 12489 -v SERVICESTATE -l "IFSJBOSSSERVERTEST64(C_IFS_EXTSERVER)" -d SHOWALL

This results in the expected behaviour whereby you get a "Started" message back. I've tested this many different ways, and it should be reproduceable as needed. So my questions are:

(1) Can someone verify this and come out with a patch? We're wanting to buy this software, but no with some of these bugs we're finding. This, of course, being a showstopper if I can't monitor critical services on my machines.

(2) Is there a way to manually edit the config files, outside of the GUI and have them "take?" I have a lot of experience with Nagios Core, and would like an option to just modify some of these commands directly. Preferably without having to resort to completely static configs (at which point NagiosXI serves no useful increased purpose over Core.)

Thanks!
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

The quotes are needed to avoid doing SHELL EXPANSION? Well you are in luck, drop the quotes as Nagios does not pass it's commands threw a shell... or at least it didn't last I thought about it.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

Another thing, there might well be quotes around the $ARGV$. I'm not sure if they do any good though, but I know I've always used them.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

The problem you report has nothing to do with quotes, but rather the leaving of $ARGV1$ blank. I put a space there and the "web page" worked. This however will not provide the same results as a blank for NagiosXI.

I'll have this bug looked into.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

The parameter shifting fix is included for the next release.
You will have to quote shell meta characters.
SomeClown
Posts: 6
Joined: Tue Mar 02, 2010 2:24 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by SomeClown »

I did get around the problem by just setting a valid password on the agent and in the web page setup, and life is good. Still had to quote the service, but that's not a big deal really.

Good to hear a fix is coming, so two things from that:

(1) When is the next version due out, or the fix, specifically?

(2) I'm assuming this is the same issue, but I can't get a MS SQL named instance to work from within your system either, but I can from the command line. In this case I have to escape out the $ character as so:

./check_nt -H someserver.somedomain.com -s "password" -p 12489 -v SERVICESTATE -l MSSQL\$INSTANCE_NAME -d SHOWALL

In the NagiosXI web interface, however, no matter what I do I can't get it to use the escaped string entirely, so I get a "MSSQL$ not found" error on the service state. Any way to fix that?

Thanks for the quick answers on the other thing.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

This is not the same issue. If you want to pass a dollar sign ($) on the command line, you have to escape it with another dollar sign.

So the correct syntax would be:
./check_nt -H someserver.somedomain.com -s "password" -p 12489 -v SERVICESTATE -l MSSQL\$$INSTANCE_NAME -d SHOWALL

To make things less confusing I'd use "'" instead, like so:
./check_nt -H someserver.somedomain.com -s "password" -p 12489 -v SERVICESTATE -l 'MSSQL$$INSTANCE_NAME' -d SHOWALL
SomeClown
Posts: 6
Joined: Tue Mar 02, 2010 2:24 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by SomeClown »

Thanks, that did the trick. Just to be clear, however, passing the $ on the commandline with the traditional \$ worked fine. It just didn't work from within the Nagios configuration tool. Directly at a bash prompt worked fine.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: NagiosXI Bug in check_nt SERVICESTATE

Post by mmestnik »

As for when, well what I hear is this weekend. What I can say for sure is soon. It's known that these bugs cause a lot of trouble, however I'm not sure of any that are show stoppers as you have described. It's only a matter of learning the hidden features of XI and then forgetting them once the next release comes out.

...That's also correct Nagios and the Command Line have different syntax.
Locked