Subject: Execute Command on Alarm?

From: Percy Kwong <[email-masked]>
Date: Sat, 26 Apr 2008 17:23:46 -0400

I'm interested in executing a shell script (of my choosing) when a 
server goes down (via ping testing).  Is there a way for me to do this?

If the script I wanted to execute was: /home/me/serverdown.sh

how would I accomplish this?

Thanks.

-PK

---

From: Jeremy Kister <[email-masked]>
Date: Sat, 26 Apr 2008 17:50:58 -0400

> server goes down (via ping testing).  Is there a way for me to do this?

i think the easiest is to set up a notify method:

Method "MyMethod" {
   command: /home/me/serverdown.sh
   qtime: 0
}

and then in your notify: add MyScript

notify: mail:[email-masked] MyMethod:foo

or, if you just want to execute the script for certain objects:
  Group "somegroup" {
    Group "special stuff" {
     notifyalso: MyMethod:foo
    }
  }

* where foo is some optional parameter you might want your script to get

-- 

Jeremy Kister
http://jeremy.kister.net./

---

From: Percy Kwong <[email-masked]>
Date: Sat, 26 Apr 2008 18:00:18 -0400

Thanks for the reply!  I really appreciate it.

For what it's worth, This is what I'm trying to accomplish..

For some odd reason, my supermicro server (case + mobo) shuts down with 
the temp. light showing it's over heated.  The only way to reset the box 
is to power cycle the circuit.  (Pull the power plug out and replug 
in).  I wanted it to simply run the script that would then powercycle 
the server via an x10 appliance adapter automatically whenever the box 
goes offline.  I'm also trying to figure out why the machine itself is 
going thermal considering it's sitting in a room that is always 60 
degrees farenheit and those supermicro cases have more fans than a 
busload of dragonladys. 

Thanks.

-PK