user-defined resources not properly expanded as command arguments
Matt Pounsett
matt.pounsett at cira.ca
Tue Sep 16 01:29:49 CEST 2003
Another interesting problem I can't seem to trace.
Late yesterday, my check_mysql command suddenly started failing. A check of
my logs indicated that Nagios was suddenly trying to login as $@localhost.
Further testing has narrowed down the problem to expansion of user-defined
resources when used as command arguments.
Here are the particulars:
in resources.cfg
--------
$USER1$=/usr/local/libexec/nagios/
$USER2$=/usr/local/site/nagios/
$USER3$=mysqluser
$USER4$=sqlpassword
--------
in checkcommands.cfg
--------
define command {
command_name check_mysql
command_line $USER1$/check_mysql -u $ARG1$ -p $ARG2$
}
--------
in hosts.cfg
--------
define service {
use templateService
host_name myhost.dom.com
service_description MySQL
check_command check_mysql!$USER3$!$USER4$
}
--------
When check_mysql executes, Nagios is running the following command:
/usr/local/nagios/libexec/check_mysql -u $ -p $
This begins to work correctly if I put the user/pass directly into the MySQL
service definition, or if I replace the ARGx entries with USERx entries in the
check_mysql command definition.
I've tried rebuilding the hosts file from scratch to rule out the nebulous
"strange characters" bug (even though vim would warn me if anything non
printable were in the file) with no luck.
If this hadn't worked at one point I would just assume that USERx variables
couldn't be used in service definitions... but it did work up until last
night.
Any thoughts?
--
Matt Pounsett CIRA - Canadian Internet Registration Authority
Technical Support Programmer 350 Sparks Street, Suite 1110
matt.pounsett at cira.ca Ottawa, Ontario, Canada
613.237.5335 ext. 231 http://www.cira.ca
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list