passing macro variables to shell script

Onsite DeTeWe Onsite.DeTeWe at firstgroup.com
Fri May 21 13:28:34 CEST 2004


Hi all,

In an attempt to SMS to a number of recipients using a serial connected 
mobile phone and gnokii I have run into a slight snag.

The only way you can get gnokii to send to multiple destinations is to set 
up a script like this

for x in 040404040 1414141 
do 
echo 'Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: 
$HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$' | 
/usr/local/bin/gnokii --sendsms $x 
sleep 60 (if you need this?) 
done 

And run this script from the misccommands.cfg file when the trigger is 
activated.  Of course it would be nice to have the macro $xxx$ values sent 
as well but this does not happen in the above example. 

Does anyone have any idea if it is possibe to parse variables from nagios 
to an external shell script.

Kind reards

Jason

**********************************************************************
This message is confidential. It may not be disclosed to, or used by, 
anyone other than the addressee. If you receive this message in 
error, please advise us immediately.

Internet email is not necessarily secure. First does not accept
responsibility for changes to any email which occur after the email
has been sent. Attachments to this email could contain software
viruses which could damage your system. First have checked the
attachments for viruses before sending, but you should virus-check
them before opening.

http://www.firstgroup.com
**********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040521/84385203/attachment.html>


More information about the Users mailing list