Page 2 of 2

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

Posted: Fri Oct 31, 2014 1:44 am
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.

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

Posted: Fri Oct 31, 2014 11:51 am
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

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

Posted: Mon Nov 03, 2014 5:23 am
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

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

Posted: Mon Nov 03, 2014 11:44 am
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.