SMS notification string stripping

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
griffithusg
Posts: 64
Joined: Sun Nov 07, 2010 7:16 pm

SMS notification string stripping

Post by griffithusg »

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,
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: SMS notification string stripping

Post by mguthrie »

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)
griffithusg
Posts: 64
Joined: Sun Nov 07, 2010 7:16 pm

Re: SMS notification string stripping

Post by griffithusg »

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
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: SMS notification string stripping

Post by agriffin »

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?
Locked