[Xymon] how to write custom script for Xymon

Galen Johnson Galen.Johnson at sas.com
Fri Apr 8 14:54:05 CEST 2016


?Why not just use the built in proc test?  All of this is well documented in the analysis.cfg file as well as the help that is included with Xymon.


=G=


________________________________
From: Xymon <xymon-bounces at xymon.com> on behalf of Lukas Kohl <lukas.kohl at ergodirekt.de>
Sent: Friday, April 8, 2016 8:37 AM
To: Sir Balash
Cc: xymon at xymon.com
Subject: Re: [Xymon] how to write custom script for Xymon

Hi Balash,
this may help you. Just launch it via Cron every 5 Minutes.

#!/bin/bash
# procs: Seperate with ","
PROCS="cron,http"
IFS=,
#Machine in Xymon, which should show the status
MACHINE="testhost"
# Column in Xymon
TEST="procs"
#Xymon Server
BBDISP=xymon-server
# Xymon Port
BBPORT=1984
BB=/usr/bin/netcat
GLOBALCOLOR=green
GLOBALSTATE="ALL monitored processes are running"
COLOR=green
LINE=""
for i in $PROCS
do
        COUNT="$(ps -eo cmd|grep $i|grep -v grep|wc -l)"
        if [ "$COUNT" -gt "0" ]
        then
                LINE=$LINE"
&green $i is running $COUNT times"
                COLOR=green
        else
                LINE=$LINE"
&red $i is *NOT* running"
                COLOR=red
        fi
done
if [ -n "$(echo $LINE|grep '&red')" ]
then
        GLOBALCOLOR=red
        GLOBALSTATE="Some processes are *NOT* running"
fi

# send via netcat
echo "echo "status $MACHINE.$TEST $GLOBALCOLOR $(date) $GLOBALSTATE $LINE"|$BB $BBDISP $BBPORT"


Kind regards,

    Lukas Kohl
    ERGO Direkt Versicherungen
    Systembetrieb 2
    Karl-Martell-Straße 60
    90344 Nürnberg
    Deutschland
    Tel.: +49-911-148-2857




Von:        Sir Balash <sirbakash at gmail.com>
An:        xymon at xymon.com
Datum:        08.04.2016 14:16
Betreff:        [Xymon] how to write custom script for Xymon
Gesendet von:        "Xymon" <xymon-bounces at xymon.com>
________________________________



Hello,

I will appreaciate it if someone can tell me how to write custom scripts to monitor Linux process through Xymon (i.e) zombie processes, database processes.

-Balash_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon



www.ergodirekt.de

Blog: http://blog.ergodirekt.de
Facebook: www.facebook.com/ERGODirekt
Google+: www.google.com/+ergodirekt
Twitter: www.twitter.com/ERGODirekt
YouTube: www.youtube.com/ERGODirekt
_______________________

ERGO Direkt Lebensversicherung AG · Amtsgericht Fürth HRB 2787 · UST-ID-Nr. DE159593454
ERGO Direkt Versicherung AG · Amtsgericht Fürth HRB 2934 · UST-ID-Nr. DE159593438
ERGO Direkt Krankenversicherung AG · Amtsgericht Fürth HRB 4694 · UST-ID-Nr. DE159593446
Vorsitzender der Aufsichtsräte der ERGO Direkt Lebensversicherung AG und der ERGO Direkt Krankenversicherung AG: Dr. Clemens Muth
Vorsitzender des Aufsichtsrats der ERGO Direkt Versicherung AG: Christian Diedrich
Vorstände: Peter Stockhorst (Vorsitzender), Ralf Hartmann, Dr. Jörg Stoffels · Sitz: Fürth
Karl-Martell-Straße 60 · 90344 Nürnberg · Internet: ergodirekt.de
UniCredit Bank AG - HypoVereinsbank Kto.-Nr.: 66 071 430 · BLZ 700 202 70
IBAN: DE63 7002 0270 0066 0714 30 · BIC: HYVEDEMM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160408/ebbf1673/attachment.html>


More information about the Xymon mailing list