here's my misccommands.cfg
As I said, HOSTNAME and CONTACTNAME appear to work, it just doesn't seem to like the SERVICEDESC and SERVICESTATE variable.


define command{
        command_name notify-by-email
command_line /usr/local/nagios/libexec/notifications/notify_by_email
}


define command{
        command_name notify-by-darrens-sms-services
command_line /usr/local/nagios/libexec/notifications/echo -e "$SERVICEDESC$ on $HOSTNAME$ just went '$SERVICESTATE$'
"  | qpage -f nagios -p $CONTACTNAME$
}


define command{
        command_name notify-by-darrens-sms-hosts
command_line /usr/local/nagios/libexec/notifications/qpage -s localhost -p $CONTACTNAME$ -f $HOSTNAME$ is $HOSTSTATE$
}
On 5/26/2010 10:47 AM, Ton Voon wrote:

On 26 May 2010, at 15:42, Darren Hill wrote:

Hi,

I have qpage working, and it accepts the $HOSTNAME$ variable, but no matter what I do to quote the variable, etc. it does not seem to pass the information. It just comes across as $

For example, this is right off the nagios mailing list as a command that works:

define command{
       command_name notify-by-darrens-sms-services
command_line /usr/local/nagios/libexec/notifications/echo -e "$SERVICEDESC$ on $HOSTNAME$ just went '$SERVICESTATE$'" | qpage -f nagios -p $CONTACTNAME$
}

My actual page says $ on darrenlt just went $

$HOSTNAME$ and $CONTACTNAME$ appear to be observed, but it doesn't want to recognize SERVICEDESC$ or $SERVICESTATE$

Any ideas?

What is the definition in the misccommands.cfg file?

The other approach is to have your own script and in there reference the variables via the environment (eg, HOSTNAME is available from $NAGIOS_HOSTNAME). I personally think this is much easier to debug than trying to do the substitutions in the command definitions.

Ton

_______________________________________________
Opsview-users mailing list
Opsview-users@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-users

_______________________________________________
Opsview-users mailing list
Opsview-users@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to