trouble with check_mysql and USER macros

Steve Shipway s.shipway at auckland.ac.nz
Sun Dec 4 22:21:57 CET 2005


>        command_line    $USER1$/check_mysql -H $ARG1$ -d $ARG2$ -u $ARG3$
-p $ARG4$
...
>        check_command
check_mysql!192.168.160.2!mydbname!mydbusername!$USER4$
>
>and setting $USER4$ in resource.cfg, I get error
>
>Access denied for user 'mydbusername'@'192.168.160.1' (using 
>password: YES)

I believe that you may not be able to use $USERx$ variables in host/service
definitions, although I may be wrong.  It is a bit irritating that (in
Nagios 1.2) certain variables are available in some places and not others -
for example, not being able to pass parameters to eventhandlers.  This is
buried in the manual somewhere, I think.

In this case, you may be better off defining a separate check command,
check_myssql_def (for example), that only takes 3 parameters and is defined
like

   command_line    $USER1$/check_mysql -H $ARG1$ -d "$ARG2$" -u "$ARG3$" -p
"$USER4$"

Note that it is good practice to have the quotes around strings, just in
case of embedded metacharacters (especially in the case of passwords).

HTH

Steve



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
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