Xymon Mailing List Archive search

Macro help

3 messages in this thread

list Charles Jones · Thu, 07 Sep 2006 10:53:30 -0700 ·
Can we use macros in other config files besides hobbit-alerts.cfg? I'm trying to use the following in hobbit-clients.cfg, and it's just not working:

$TOMCAT_1_1="prod-app-12|prod-app-15|prod-app-19"
$TOMCAT_1_2="prod-app-32"
$TOMCAT_1_3="prod-app-23|prod-app-27"
$TOMCAT_2_1="prod-app-4|prod-app-7|prod-app-14|prod-app-29"

HOST=%($TOMCAT_1_1)
        PROC "tomcat_1_1" TRACK=tc_1_1

HOST=%($TOMCAT_1_2)
        PROC "tomcat_1_2"  TRACK=tc_1_2

HOST=%($TOMCAT_1_3)
        PROC "tomcat_1_3"  TRACK=tc_1_3

HOST=%($TOMCAT_2_1)
        PROC "tomcat_2_1"  TRACK=tc_2_1

Note: I have many. many more hosts to define, which is why I would prefer to use macros if possible.
list T.J. Yang · Thu, 07 Sep 2006 13:59:14 -0500 ·
Looks like mpstat need to injected somewhere in this script hobbitclient-sunos.sh
in order to get usage of each cpu on soalris.
<snip>
# vmstat and iostat (iostat -d provides a cpu utilisation with I/O wait number)
nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.
$MACHINEDOTS" </dev/null >/dev/null 2>&1 &
nohup sh -c "iostat -c 300 2 1>$BBTMP/hobbit_iostatcpu.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_iostatcpu.$MACHINEDOTS.$$ $BBTMP/hobbi
t_iostatcpu.$MACHINEDOTS" </dev/null >/dev/null 2>&1 &
nohup sh -c "iostat -dxsrP 300 2 1>$BBTMP/hobbit_iostatdisk.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_iostatdisk.$MACHINEDOTS.$$ $BBTMP
/hobbit_iostatdisk.$MACHINEDOTS" </dev/null >/dev/null 2>&1 &
sleep 5
if test -f $BBTMP/hobbit_vmstat.$MACHINEDOTS; then echo "[vmstat]"; cat $BBTMP/hobbit_vmstat.$MACHINEDOTS; rm -f $BBTMP/hobbit_vmsta
t.$MACHINEDOTS; fi
if test -f $BBTMP/hobbit_iostatcpu.$MACHINEDOTS; then echo "[iostatcpu]"; cat $BBTMP/hobbit_iostatcpu.$MACHINEDOTS; rm -f $BBTMP/hob
bit_iostatcpu.$MACHINEDOTS; fi
if test -f $BBTMP/hobbit_iostatdisk.$MACHINEDOTS; then echo "[iostatdisk]"; cat $BBTMP/hobbit_iostatdisk.$MACHINEDOTS; rm -f $BBTMP/
hobbit_iostatdisk.$MACHINEDOTS; fi
<snip>

But does hobbit server side need to be adjusted as well ?

Looks like a DIY type of task that I can do myself. but I think we should have this formally suppoted
by hobbit client. Besides I am lazy ,  so another request to Henrik.


T.J. Yang
list Charles Jones · Mon, 11 Sep 2006 01:03:06 -0700 ·
Note I searched the archive for an answer for this and all I found was someone else asking the exact same question ( http://www.hswn.dk/hobbiton/2005/08/msg00344.html ).  If anyone has successfully used macros in hobbit-clients.cfg, please let me know.

-Charles
quoted from Charles Jones

Charles Jones wrote:
Can we use macros in other config files besides hobbit-alerts.cfg? I'm trying to use the following in hobbit-clients.cfg, and it's just not working:

$TOMCAT_1_1="prod-app-12|prod-app-15|prod-app-19"
$TOMCAT_1_2="prod-app-32"
$TOMCAT_1_3="prod-app-23|prod-app-27"
$TOMCAT_2_1="prod-app-4|prod-app-7|prod-app-14|prod-app-29"

HOST=%($TOMCAT_1_1)
        PROC "tomcat_1_1" TRACK=tc_1_1

HOST=%($TOMCAT_1_2)
        PROC "tomcat_1_2"  TRACK=tc_1_2

HOST=%($TOMCAT_1_3)
        PROC "tomcat_1_3"  TRACK=tc_1_3

HOST=%($TOMCAT_2_1)
        PROC "tomcat_2_1"  TRACK=tc_2_1

Note: I have many. many more hosts to define, which is why I would prefer to use macros if possible.