getting mon to execute shell command

2010-04-25 Thread admin
Hi All,

Maybe this is not the proper way to get help, but i can't seem to find a
forum or a faq, so i can solve my problem.
So please forgive me!

I have mon installed and functioning properly, but i like mon to send an
sms through gammu.

The command i run in the terminal is : echo servers down test | gammu
--sendsms TEXT 0612345678

I changed the test.alert script so it reads this:

 #!/usr/bin/sh

echo servers down test | gammu --sendsms TEXT 0653638072

But it doesn't work


My mon.cf :

# /etc/mon/mon.cf, configuration file for mon
#
# Run `/etc/init.d/mon reload' after editing this file in order for your
# changes to take effect.

# There is no default configuration for mon.  The docs most useful for
# setting up your /etc/mon/mon.cf file are the mon(1) man page,
# /usr/share/doc/mon/README.hints*, /usr/share/doc/mon/README.monitors*
# and /usr/share/doc/mon/examples/mon.cf*.

# When you do configure your server, it's a good idea to include these
# settings (to restrict access to the server to the local machine):
#
#serverbind = localhost
#trapbind   = localhost
alertdir   = /usr/lib/mon/alert.d
mondir = /usr/lib/mon/mon.d
logdir = /var/log/mon
histlength = 100


dtlogging   = yes
dtlogfile   = dtlog

hostgroup pingableservers
domain.org
watch pingableservers
service tcp
interval 1m
monitor tcp.monitor -p 16001
period
numalerts 2
alert test.alert
upalert test.alert

All the alert scripts have the proper rights, and i can't find any info in
the logfile at /var/log/mon


any help is appreciated!

Tomas

___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon


Re: getting mon to execute shell command

2010-04-25 Thread Mahlon E. Smith
On Sun, Apr 25, 2010, ad...@jack-clan.nl wrote:
 
 I changed the test.alert script so it reads this:
 
  #!/usr/bin/sh
 
 echo servers down test | gammu --sendsms TEXT 0653638072
 
 But it doesn't work


Have you tried running that script yourself?  (Not the contents, but the
script itself.)

I don't know of any OS that stores sh in /usr/bin.  My bet is on
/bin/sh.  :)

--
Mahlon E. Smith  
http://www.martini.nu/contact.html


pgputy9ciddNp.pgp
Description: PGP signature
___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon


Fwd: Re: getting mon to execute shell command

2010-04-25 Thread admin


 Original Message 
Subject: Re: getting mon to execute shell command
Date: Sun, 25 Apr 2010 20:06:22 +0200
From: ad...@jack-clan.nl
To: Mahlon E. Smith mah...@martini.nu

Pffft nope still not working,

i tested the script by executing ./sms.alert, and that works ok

sms.alert:


#!/bin/sh

echo servers down test | /usr/bin/gammu --sendsms TEXT 0612345678

mon.cf:

alertdir   = /usr/lib/mon/alert.d
mondir = /usr/lib/mon/mon.d
logdir = /var/log/mon
histlength = 100


dtlogging   = yes
dtlogfile   = dtlog

hostgroup domain
domain.org

watch domain
service tcp
interval 1m
monitor tcp.monitor -p 16001
period
numalerts 2
alert sms.alert
upalert sms.alert






On Sun, 25 Apr 2010 10:38:00 -0700, Mahlon E. Smith mah...@martini.nu
wrote:
 On Sun, Apr 25, 2010, ad...@jack-clan.nl wrote:
 
 I changed the test.alert script so it reads this:
 
  #!/usr/bin/sh
 
 echo servers down test | gammu --sendsms TEXT 0653638072
 
 But it doesn't work
 
 
 Have you tried running that script yourself?  (Not the contents, but the
 script itself.)
 
 I don't know of any OS that stores sh in /usr/bin.  My bet is on
 /bin/sh.  :)
 
 --
 Mahlon E. Smith  
 http://www.martini.nu/contact.html

___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon


Re: Fwd: Re: getting mon to execute shell command

2010-04-25 Thread Jim Trocki

On Sun, 25 Apr 2010, ad...@jack-clan.nl wrote:


hostgroup domain
   domain.org

watch domain
   service tcp
   interval 1m
   monitor tcp.monitor -p 16001
   period
   numalerts 2
   alert sms.alert
   upalert sms.alert


you need to specify a period, such as wd {Sun-Sat}


period wd {Sun-Sat}
numalerts 2
alert sms.alert
upalert sms.alert

___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon


Fwd: Re: Fwd: Re: getting mon to execute shell command

2010-04-25 Thread admin
I changed it but still it ain't working.
When i use monshow  --showall it lists the fail and the alerts (2)
so that part i think is correct, is there any other log except
/var/log/mon where i can look for a clue?



 hostgroup domain
domain.org

 watch domain
service tcp
interval 1m
monitor tcp.monitor -p 16001
period hr {0-23}
numalerts 2
alert sms.alert
upalert sms.alert





___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon


Re: getting mon to execute shell command

2010-04-25 Thread Brandon S. Allbery KF8NH

On Apr 25, 2010, at 13:38 , Mahlon E. Smith wrote:

On Sun, Apr 25, 2010, ad...@jack-clan.nl wrote:


I changed the test.alert script so it reads this:

#!/usr/bin/sh

echo servers down test | gammu --sendsms TEXT 0653638072

But it doesn't work


I don't know of any OS that stores sh in /usr/bin.  My bet is on
/bin/sh.  :)


ANy SVR4-derived system (Solaris, HP/UX, Irix, etc.) has /bin a  
symlink to /usr/bin.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon