Jun 10, 2010 4:50 AM
Events to SMS message with gnokii
-
Like (0)
Hi,
i'm trying to get gnokii ( http://www.gnokii.org/ ) to send event alarms via sms message.
/ZenEventManager /Event Commands /Gnokii-SMS-2
Command
/usr/local/bin/zenoss-gnokii.sh
Clear Command
/usr/local/bin/zenoss-gnokii-clear.sh
zenoss-gnokii.sh script:
-------------------------------------------------------------------------------
#!/bin/sh
mess=`echo "ZENOSS: Device ${device/getId} reported: ${evt/summary}" | cut -b "-155"`
/usr/bin/printf "$mess" | /usr/bin/gnokii --sendsms +358400xxxxx
-------------------------------------------------------------------------------
I get both sms messages on Failure and Clear, but only empty strings, no device or service name:
ZENOSS: Device reported:
Any idea how to get that information piped to gnokii ?
I'm pretty sure the TALES expressions don't get passed into your zenoss-gnokii.sh script. For your event commands, you probably need to alter your script to something like
/usr/local/bin/zenoss-gnokii.sh ${device/getId} ${evt/summary}
and then parse those arguments in the zenoss-gnokii.sh script.
Not sure if your committed to gnokii, but there is an article here about using a modem and POTS line to send SMS: HOWTO send SMS via modem with Zenoss
Zenoss sends event details via stdout stream. So your script should read
it from zenoss and pass it to gnokii.
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||