> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Steve Shipway > Sent: Sunday, December 04, 2005 3:22 PM > To: 'Aleksey Tsalolikhin'; nagios-users@lists.sourceforge.net > Subject: RE: [Nagios-users] trouble with check_mysql and USER macros > > > 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. >
That is correct, macros can only be used in command definitions and can not be used in other object types or passed from other object types (excepting the $ARGn$ macros). I don't know what parameters you were wanting to pass to event handlers but with 2.x it now appears possible to pass almost all macros, including $ARGn$ and $USERn$ macros to event handlers. http://nagios.sourceforge.net/docs/2_0/macros.html "One of the features available in Nagios is the ability to use macros in command defintions. Immediately prior to the execution of a command, Nagios will replace all macros in the command with their corresponding values. This allows you to define a few generic commands to handle all your needs." That page goes on to detail specifically when each macro is available for use. ------------------------------------------------------- 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_idv37&alloc_id865&op=click _______________________________________________ Nagios-users mailing list Nagios-users@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