Hi,
I am having some trouble getting some issues with implementing a custom notification script.
When I run the script on the command line I have no issues.
When it is run from within NagiosXi it seems to be stripping off the " around the content of the Macro. This causes problems as when it is parsed to the script the script doesn't ignore things like % symbols etc.
I have found in the Nagios.cfg that there is an entry for illegal macro characters. What are the implications of changing or removing these?
Thanks,
SMS notification string stripping
Re: SMS notification string stripping
Can you take a look at the document below and see how it compares with your custom notification setup:
http://assets.nagios.com/downloads/nagi ... iables.pdf
Can you also post your notification command and also the custom notification that you're using? (minus any private data)
http://assets.nagios.com/downloads/nagi ... iables.pdf
Can you also post your notification command and also the custom notification that you're using? (minus any private data)
-
griffithusg
- Posts: 64
- Joined: Sun Nov 07, 2010 7:16 pm
Re: SMS notification string stripping
Hi,
I am currently using the CoreConfigManager to configure the sending of sms's
Here is the Notify Command for hosts
define command {
command_name notify-host-by-smsgw
command_line $USER1$/sendsms.sh $CONTACTPAGER$ "$SHORTDATETIME$ $NOTIFICATIONTYPE$ $HOSTSTATE$ $HOSTNAME$ ($HOSTALIAS$) $HOSTSTATE$: $HOSTOUTPUT$"
}
define command {
command_name notify-service-by-smsgw
command_line $USER1$/sendsms.sh $CONTACTPAGER$ "$SHORTDATETIME$ $NOTIFICATIONTYPE$ $SERVICESTATE$ $SERVICEDESC$ $HOSTNAME$ ($HOSTALIAS$): $SERVICEOUTPUT$"
}
Here is the script that gets executed.
# cat sendsms.sh
#!/bin/ksh
echo $2 $[email protected] >> /tmp/smslog.log
/usr/bin/printf "$2" | /bin/mail $[email protected]
exit 0
I am currently using the CoreConfigManager to configure the sending of sms's
Here is the Notify Command for hosts
define command {
command_name notify-host-by-smsgw
command_line $USER1$/sendsms.sh $CONTACTPAGER$ "$SHORTDATETIME$ $NOTIFICATIONTYPE$ $HOSTSTATE$ $HOSTNAME$ ($HOSTALIAS$) $HOSTSTATE$: $HOSTOUTPUT$"
}
define command {
command_name notify-service-by-smsgw
command_line $USER1$/sendsms.sh $CONTACTPAGER$ "$SHORTDATETIME$ $NOTIFICATIONTYPE$ $SERVICESTATE$ $SERVICEDESC$ $HOSTNAME$ ($HOSTALIAS$): $SERVICEOUTPUT$"
}
Here is the script that gets executed.
# cat sendsms.sh
#!/bin/ksh
echo $2 $[email protected] >> /tmp/smslog.log
/usr/bin/printf "$2" | /bin/mail $[email protected]
exit 0
Re: SMS notification string stripping
Can you post an example of the output you get when Nagios XI runs this script? Maybe an SMS or a line from your log?