On Thursday 08 July 2004 15:23, alben benavente alteza wrote:
> Actually the service I mention is just an example. I have some scripts
> which detects and log whatever malfunction in its routine function. I just
> need to incorporate a mailer script to that so I could also recieve the
> problem detail via email.

or, merging with the chikkamail thread in the newbie list, you could
have it email you through chikka and you receive the notification
on your cell phone :).

how exactly do you want it to work?  e.g., something simple might be:

#/bin/bash
nl=`ps auxw | grep <daemon_name> | grep -v grep | wc -l `
hostname=`hostname`

if [ $nl -eq 0 ]
then
   # it's not running, send email
echo   echo "<daemon_name> has stopped running on $hostname.  please 
restart it!!!" | mail <your_email_address> -s "WARNING: service <daemon_dname 
on $hostname is down"

fi

or something like that (i didn't test that, it just popped off the top of 
my head, so it's only a hint, not a full solution :). depending on your
system, you could find a  better way to check if it's really down.  e.g., 
if it's a database, try to open a database connection, if it's some sort 
of server, e.g., apache, then try to connect to the service and get it to 
give you something standard.

tiger

-- 
Gerald Timothy Quimpo  [EMAIL PROTECTED] [EMAIL PROTECTED]
http://bopolissimus.sni.ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"

      How To Ask Questions The Smart Way
              -- http://www.catb.org/~esr/faqs/smart-questions.html
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to