check_files.pl failing after XI update from 2012 to 2014

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: check_files.pl failing after XI update from 2012 to 2014

Post by detronict »

@lmiltchev

The first occurrence of $ARG1$ is within a quoted string and is purely a label for readability.
I have tested with the first occurence removed but this has no effect whatsoever.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_files.pl failing after XI update from 2012 to 2014

Post by lmiltchev »

I tested this with the following:

In Commands:

Code: Select all

$USER1$/check_files.pl -L "XI Backup $ARG1$" -H $HOSTADDRESS$ -D /tmp/$ARG1$ -F $ARG2$ -w $ARG3$ -c $ARG4$
In Service

Code: Select all

check_files.pl!test!\*.tar.gz!4:40!1:45!
Note: I had to escape the asterisk with a backslash.

This seemed to work fine.
example01.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
detronict
Posts: 24
Joined: Mon Mar 31, 2014 5:13 am

Re: check_files.pl failing after XI update from 2012 to 2014

Post by detronict »

Using the backslash as an escape character for the asterisk in the command does the trick!!

It is very frustrating however to have to spend so much time and energy in finding out such a (relatively) simple solution.
Can you please explain to me where the problem came from? Was it the OS updates, or was it the Nagios update.

Furthermore is there some documentation you can point me to that explains the difference between "Testing check from command line" from within Nagios and really testing from commandline. (see attached files)

I think that a feature like a testing method that works exactly the same as the actual execution in NagiosXI would be very much appreciated by everyone.
(I know i would!)

Thanks for helping me solve this problem!!
Testfromcli1.jpg
Testfromcli2.jpg
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_files.pl failing after XI update from 2012 to 2014

Post by abrist »

detronict wrote:Can you please explain to me where the problem came from? Was it the OS updates, or was it the Nagios update.
Depends what XI version you upgraded from. Due to security vulns, we had to add a bit more escaping, etc to portions of XI. Also, if the plugin requires some deps that were updated, those deps may have changed the way they handle strings/escapes.
detronict wrote:Furthermore is there some documentation you can point me to that explains the difference between "Testing check from command line" from within Nagios and really testing from commandline.
Unfortunately not. The quick overview: Usually, plugins are run by the "nagios" user. When running a check from the UI trough the "test check command" feature, it is run as the use3r "apache". This is done for a few different reasons - the important reason was due to security. Allowing "nagios" to run an arbitrary command from the web ui is very dangerous due the number of rights the nagios user has. For this reason the test feature is limited to the apache user.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked