[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Question regarding automation of <cr> & <control-D>

From: Michael Hutchinson
Subject: RE: Question regarding automation of <cr> & <control-D>
Date: Tue, 16 Dec 2008 09:21:17 +1300


I'm running Nagios 1.3 on Debian Sarge on two servers with a cellphone
each using Gnokii/smsd.

I have in my "misccommands.cfg" Nagios config file, the following (which
works to send SMS for us).

This assumes "directory mode" usage of smsd, where Nagios writes a file
into the /var/spool/sms directory, and smsd goes about delivering it
when it checks that folder periodically. So, you will have to modify it
based on how you're using smsd.

---BEGIN misccommands.cfg Snippet---
# sms notify using gnokii-smsd
define command{
        command_name    host-notify-by-sms
        command_line    /usr/bin/printf
/var/spool/sms/`date +%d%m%Y%H%M%S%N`

define command{
        command_name    notify-by-sms
        command_line    /usr/bin/printf
$SERVICESTATE$" > /var/spool/sms/`date +%d%m%Y%H%M%S%N`

Hope that Helps.

PS: Watch out for those back-tick characters (`)

Michael Hutchinson
Manux Solutions Ltd
Email: address@hidden

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Of Hamed Majnoonian
> Sent: 15 December 2008 8:25 a.m.
> To: address@hidden
> Subject: Question regarding automation of <cr> & <control-D>
> I am using gnokii with nagios to send sms through notifications.
> I've checked nagios command that how I can use gnokii with nagios but
> something is wrong.
> On the end of the command it is necessary to put a <cr> and then
> D>
> Without those keys nothing goes. Here is an instance:
> echo test | gnokii -sendsms xxxxxx
> But it won't work unless I press the keys on the end of it manually!
> Is there any way to make this automated?
> Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]