Xymon Mailing List Archive search

Alert via my own test script failed

3 messages in this thread

list Casedj · Sat, 26 May 2007 20:56:05 +0800 ·
Following scripts were added  in hobbit-alerts.cfg:
   HOST=linux_1   SERVICE=disk
    SCRIPT          echo "my_linux disk went to warning state" |smbclient -M cici
    SCRIPT          echo "disk reached warning state" |write hobbit 

The color of disk changed while state reached warning level, but scripts had no effect.

Or is syntax of the script wrong? how to write my own alert script?

Thanks very much.

Case
list Henrik Størner · Sat, 26 May 2007 16:07:16 +0200 ·
quoted from Casedj
On Sat, May 26, 2007 at 08:56:05PM +0800, casedj wrote:
Following scripts were added  in hobbit-alerts.cfg:
   HOST=linux_1   SERVICE=disk
    SCRIPT          echo "my_linux disk went to warning state" |smbclient -M cici
    SCRIPT          echo "disk reached warning state" |write hobbit 
Sorry, the parameter for the SCRIPT command must be a single executable.

Put the commands you have here into a shell script, and use the filename
of the script in your SCRIPT rule.


Regards,
Henrik
list Stef Coene · Sat, 26 May 2007 16:39:58 +0200 ·
quoted from Casedj
On Saturday 26 May 2007, casedj wrote:
Following scripts were added  in hobbit-alerts.cfg:
   HOST=linux_1   SERVICE=disk
    SCRIPT          echo "my_linux disk went to warning state" |smbclient
-M cici SCRIPT          echo "disk reached warning state" |write hobbit

The color of disk changed while state reached warning level, but scripts
had no effect.

Or is syntax of the script wrong? how to write my own alert script?
It's better to put the commands in a script alert.sh and call that script:
SCRIPT alert.sh

With the content of alert.sh:

#!/bin/sh
quoted from Henrik Størner
echo "my_linux disk went to warning state" |smbclient M cici
echo "disk reached warning state" |write hobbit

Stef