[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: wrong status of server side extention script in xymon-4.2.2..pl help...



---------- Forwarded message ----------
From: pankaj dorlikar <pankaj.dorlikar (at) gmail.com>
Date: Fri, May 8, 2009 at 11:08 PM
Subject: wrong status of server side extention script in xymon-4.2.2
To: hobbit (at) hswn.dk


hi,
 i am using xymon -4.2.2.
I have written one extension script (server side script) for monitoring k3b
service on each machine including server and clients also.On one of my
clients and on server itself,the service is not running.on other two clients
service is running.
I am getting same green status on all clients as well as server stating k3b
is running.when i checked on each client,server and 2 clients do not run
this service.;but i am getting green for that also....wt is wrong?
steps i fallowd are,

In ~/server/etc/hobbitlaunch.cfg added


k3b]
    ENVFILE /home/hobbit/server/etc/hobbitserver.cfg
    NEEDS hobbitd
    CMD $BBHOME/ext/k3b

    LOGFILE $BBSERVERLOGS/k3b.log
    INTERVAL 5m

in bb-hosts,added k3b for every host..


In ~/server/ext/k3b, added:

#!/bin/sh
BBHTAG=k3b           # What we put in bb-hosts to trigger this test

COLUMN=k3b    # Name of the column, often same as tag in bb-hosts
$BBHOME/bin/bbhostgrep $BBHTAG | while read L
do
  set $L    # To get one line of output from bbhostgrep
  HOSTIP="$1"
  MACHINEDOTS="$2"

  MACHINE=`echo $2 | $SED -e's/\./,/g'`
  MSG="$BBHTAG status for host $MACHINEDOTS"
op=`ps -aef | grep k3b | grep -v grep|grep -v vim`
 /*

some logic placed which will lead to results

*/
if test $op != "";then
then
    COLOR=green
  else
    COLOR=red
  fi
  $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
  ${MSG}
  "
done
exit 0
------------------

logs alos do not show anything except bb-hosts enties..
help me..abt how can i get correct status for all clients and serverm
using server side xternal script


Pankaj V. Dorlikar



-- 
Pankaj V. Dorlikar