Smsd


#1

HI There.

I’ve configured nagios correctly and the email alerting is working fine. I’ve installed smstools and sms messages send correctly. I have a plugin for nagios to send sms alerts which isn’t fully working and i could do with some help. Take a look at the script below… The temp file is being created correctly and if i was to drop that in the outgoing dir, the sms sends correctly… When using the plugin script for sms, once the temo file is created it should copy it to the outgoing dir… It does this but strips out the message details from the temp file for some reason just leaving ‘TO:’ in it’s place.

#!/bin/sh
TEMPFILE=/tmp/sms.$$
TIMEnDATE=date|sed s/:/' '/g|awk '{print $2$3"@"$4$5}'
mess=$2
tst=$3
number=$1
echo “To: $1” > $TEMPFILE
echo “” >> $TEMPFILE
echo “$mess $tst” >> $TEMPFILE
cp $TEMPFILE /var/spool/sms/outgoing/sms-to-$1-$TIMEnDATE.$$
#rm $TEMPFILE
logger SMS sent to $1 [message: $mess $tst]