Another resources problem
Matt Pounsett
matt.pounsett at cira.ca
Thu Nov 20 20:26:39 CET 2003
I've posted about this one before, but as yet haven't found a solution. I
thought I'd bring it up again in case anyone has figured out a way around it.
There seems to be a breakdown in handling of user-defined resources as service
command arguments.
I have a pair of resources defined for a database user and password in my
resources.cfg file:
# mysql root user
$USER5$=root
$USER6$=passwordhere
I then use those resources in a service definition:
# MySQL Service
define service {
use templateServiceGeneric
host_name sql.host.domain
service_description MySQL
check_command check_mysql!$USER5$!$USER6$
contact_groups sysadmins
}
And my check command is defined like so:
define command {
command_name check_mysql
command_line $USER1$/check_mysql -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
}
Now, by the time $USER5$ and $USER6$ get to the command execution, they have
simply become "$", instead of "root" and "passwordhere".
If I change the command definition to refer to $USER5$ and $USER6$ instead of
$ARG1$ and $ARG2$, it works. From this, it would appear that user-defined
resources cannot be used as arguments in a service definition. According to
http://nagios.sourceforge.net/docs/1_0/macros.html, user-defined macros are
supposed to be able to be used in service check definitions, but this does not
appear to be the case. Can anyone else reproduce this bug?
--
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: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
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