From abc83d46637ebc63479ec745f05ae392f404f04e Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sat, 8 Nov 2008 20:35:27 -0600 Subject: hobbit client --- abs/mv-core/hobbit-client/PKGBUILD | 20 ++ abs/mv-core/hobbit-client/client/bin/bb | Bin 0 -> 177017 bytes abs/mv-core/hobbit-client/client/bin/bbcmd | Bin 0 -> 149244 bytes abs/mv-core/hobbit-client/client/bin/bbdigest | Bin 0 -> 192338 bytes abs/mv-core/hobbit-client/client/bin/bbhostgrep | Bin 0 -> 184578 bytes abs/mv-core/hobbit-client/client/bin/bbhostshow | Bin 0 -> 146205 bytes abs/mv-core/hobbit-client/client/bin/clientupdate | Bin 0 -> 180919 bytes .../hobbit-client/client/bin/hobbitclient-aix.sh | 66 ++++ .../client/bin/hobbitclient-darwin.sh | 57 ++++ .../client/bin/hobbitclient-freebsd.sh | 65 ++++ .../hobbit-client/client/bin/hobbitclient-hp-ux.sh | 67 ++++ .../hobbit-client/client/bin/hobbitclient-irix.sh | 58 ++++ .../hobbit-client/client/bin/hobbitclient-linux.sh | 83 +++++ .../client/bin/hobbitclient-netbsd.sh | 62 ++++ .../client/bin/hobbitclient-openbsd.sh | 62 ++++ .../hobbit-client/client/bin/hobbitclient-osf1.sh | 60 ++++ .../client/bin/hobbitclient-sco_sv.sh | 60 ++++ .../hobbit-client/client/bin/hobbitclient-sunos.sh | 77 +++++ .../hobbit-client/client/bin/hobbitclient.sh | 94 ++++++ abs/mv-core/hobbit-client/client/bin/hobbitlaunch | Bin 0 -> 167359 bytes abs/mv-core/hobbit-client/client/bin/logfetch | Bin 0 -> 217231 bytes abs/mv-core/hobbit-client/client/bin/msgcache | Bin 0 -> 169865 bytes abs/mv-core/hobbit-client/client/bin/orcahobbit | Bin 0 -> 173135 bytes .../hobbit-client/client/etc/clientlaunch.cfg | 43 +++ .../hobbit-client/client/etc/hobbitclient.cfg | 52 +++ .../hobbit-client/client/etc/localclient.cfg | 359 +++++++++++++++++++++ .../hobbit-client/client/ext/hobbit-mem-myth.sh | 52 +++ abs/mv-core/hobbit-client/client/runclient.sh | 133 ++++++++ abs/mv-core/hobbit-client/hobbit-client.install | 14 + 29 files changed, 1484 insertions(+) create mode 100755 abs/mv-core/hobbit-client/PKGBUILD create mode 100755 abs/mv-core/hobbit-client/client/bin/bb create mode 100755 abs/mv-core/hobbit-client/client/bin/bbcmd create mode 100755 abs/mv-core/hobbit-client/client/bin/bbdigest create mode 100755 abs/mv-core/hobbit-client/client/bin/bbhostgrep create mode 100755 abs/mv-core/hobbit-client/client/bin/bbhostshow create mode 100755 abs/mv-core/hobbit-client/client/bin/clientupdate create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-aix.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-darwin.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-freebsd.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-hp-ux.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-irix.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-linux.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-netbsd.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-openbsd.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-osf1.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-sco_sv.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient-sunos.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitclient.sh create mode 100755 abs/mv-core/hobbit-client/client/bin/hobbitlaunch create mode 100755 abs/mv-core/hobbit-client/client/bin/logfetch create mode 100755 abs/mv-core/hobbit-client/client/bin/msgcache create mode 100755 abs/mv-core/hobbit-client/client/bin/orcahobbit create mode 100644 abs/mv-core/hobbit-client/client/etc/clientlaunch.cfg create mode 100644 abs/mv-core/hobbit-client/client/etc/hobbitclient.cfg create mode 100644 abs/mv-core/hobbit-client/client/etc/localclient.cfg create mode 100755 abs/mv-core/hobbit-client/client/ext/hobbit-mem-myth.sh create mode 100755 abs/mv-core/hobbit-client/client/runclient.sh create mode 100755 abs/mv-core/hobbit-client/hobbit-client.install diff --git a/abs/mv-core/hobbit-client/PKGBUILD b/abs/mv-core/hobbit-client/PKGBUILD new file mode 100755 index 0000000..5c583b3 --- /dev/null +++ b/abs/mv-core/hobbit-client/PKGBUILD @@ -0,0 +1,20 @@ +pkgname=hobbit-client +pkgver=4.2.0 +pkgrel=72 +pkgdesc="Hobbit is a system for monitoring servers and networks. " +license="GPL" +arch=('i686') + +url="http://hobbitmon.sourceforge.net/" +source=( ) +depends="pcre " +install=hobbit-client.install + +build() { + +#create client package as well +mkdir -p $startdir/pkg/data/srv/hobbit/ +cp -rp $startdir/client $startdir/pkg/data/srv/hobbit/client + +} + diff --git a/abs/mv-core/hobbit-client/client/bin/bb b/abs/mv-core/hobbit-client/client/bin/bb new file mode 100755 index 0000000..1202ab4 Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/bb differ diff --git a/abs/mv-core/hobbit-client/client/bin/bbcmd b/abs/mv-core/hobbit-client/client/bin/bbcmd new file mode 100755 index 0000000..3dd325b Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/bbcmd differ diff --git a/abs/mv-core/hobbit-client/client/bin/bbdigest b/abs/mv-core/hobbit-client/client/bin/bbdigest new file mode 100755 index 0000000..9f607e9 Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/bbdigest differ diff --git a/abs/mv-core/hobbit-client/client/bin/bbhostgrep b/abs/mv-core/hobbit-client/client/bin/bbhostgrep new file mode 100755 index 0000000..e981aee Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/bbhostgrep differ diff --git a/abs/mv-core/hobbit-client/client/bin/bbhostshow b/abs/mv-core/hobbit-client/client/bin/bbhostshow new file mode 100755 index 0000000..2157ccb Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/bbhostshow differ diff --git a/abs/mv-core/hobbit-client/client/bin/clientupdate b/abs/mv-core/hobbit-client/client/bin/clientupdate new file mode 100755 index 0000000..9db22bd Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/clientupdate differ diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-aix.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-aix.sh new file mode 100755 index 0000000..d1a0dc2 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-aix.sh @@ -0,0 +1,66 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# AIX client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-aix.sh,v 1.14 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +# The sed stuff is to make sure lines are not split into two. +df -Ik | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[realmem]" +lsattr -El sys0 -a realmem +echo "[freemem]" +vmstat 1 2 | tail -1 +echo "[swap]" +lsps -s +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -r +echo "[netstat]" +netstat -s +echo "[ports]" +netstat -an | grep "^tcp" +echo "[ifstat]" +netstat -v +echo "[ps]" +# I think the -f and -l options are ignored with -o, but this works... +ps -A -k -f -l -o pid,ppid,user,stat,pri,pcpu,time,etime,pmem,vsz,args + +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + $TOP -b 20 + fi +fi + +# vmstat +nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-darwin.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-darwin.sh new file mode 100755 index 0000000..600a31f --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-darwin.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# +#----------------------------------------------------------------------------# +# Darwin (Mac OS X) client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-darwin.sh,v 1.17 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +# The sed stuff is to make sure lines are not split into two. +df -H -t nonfs,nullfs,cd9660,procfs,volfs,devfs,fdesc | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[meminfo]" +vm_stat +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -r +echo "[netstat]" +netstat -s +echo "[ifstat]" +netstat -ibn | egrep -v "^lo| # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-freebsd.sh,v 1.17 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +# The sed stuff is to make sure lines are not split into two. +df -H -tnonfs,nullfs,cd9660,procfs,devfs,linprocfs | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[meminfo]" +$BBHOME/bin/freebsd-meminfo +echo "[swapinfo]" +swapinfo -k +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -rn +echo "[ifstat]" +netstat -i -b -n | egrep -v "^lo|$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-hp-ux.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-hp-ux.sh new file mode 100755 index 0000000..54302fa --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-hp-ux.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# +#----------------------------------------------------------------------------# +# HP-UX client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-hp-ux.sh,v 1.20 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +# The sed stuff is to make sure lines are not split into two. +df -Pk | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[memory]" +$BBHOME/bin/hpux-meminfo +echo "[swapinfo]" +/usr/sbin/swapinfo -tm +echo "[ifconfig]" +netstat -in +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ifstat]" +/usr/sbin/lanscan -p | while read PPA; do /usr/sbin/lanadmin -g mibstats $PPA; done +echo "[ports]" +netstat -an | grep "^tcp" +echo "[ps]" +UNIX95=1 ps -Ax -o pid,ppid,user,stime,state,pri,pcpu,time,vsz,args + +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + # Cits Bogajewski 03-08-2005: redirect of top fails + $TOP -d 1 -f $BBHOME/tmp/top.OUT + cat $BBHOME/tmp/top.OUT + rm $BBHOME/tmp/top.OUT + fi +fi + +# vmstat +nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-irix.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-irix.sh new file mode 100755 index 0000000..c906840 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-irix.sh @@ -0,0 +1,58 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# Irix client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-irix.sh,v 1.5 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +df -Plk +echo "[mount]" +mount +echo "[swap]" +swap -ln +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ports]" +netstat -na -f inet -P tcp | tail +3 +netstat -na -f inet6 -P tcp | tail +5 +echo "[ifstat]" +netstat -i -n | egrep -v "^lo|$BBTMP/hobbit_sar.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_sar.$MACHINEDOTS.$$ $BBTMP/hobbit_sar.$MACHINEDOTS" /dev/null 2>&1 & +sleep 5 +if test -f $BBTMP/hobbit_sar.$MACHINEDOTS; then echo "[sar]"; cat $BBTMP/hobbit_sar.$MACHINEDOTS; rm -f $BBTMP/hobbit_sar.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-linux.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-linux.sh new file mode 100755 index 0000000..a9ee6ae --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-linux.sh @@ -0,0 +1,83 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# Linux client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-linux.sh,v 1.20 2006/07/09 19:25:19 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -rsmn +echo "[osversion]" +if [ -x /bin/lsb_release ]; then + /bin/lsb_release -r -i -s | xargs echo + /bin/lsb_release -a +elif [ -f /etc/redhat-release ]; then + cat /etc/redhat-release +elif [ -f /etc/gentoo-release ]; then + cat /etc/gentoo-release +elif [ -f /etc/debian_version ]; then + echo -en "Debian " + cat /etc/debian_version +elif [ -f /etc/SuSE-release ]; then + grep ^SuSE /etc/SuSE-release +elif [ -f /etc/slackware-version ]; then + cat /etc/slackware-version +elif [ -f /etc/mandrake-release ]; then + cat /etc/mandrake-release +elif [ -f /etc/fedora-release ]; then + cat /etc/fedora-release +elif [ -f /etc/arch-release ]; then + cat /etc/arch-release +fi +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +df -Pl -x none -x tmpfs -x shmfs -x unknown -x iso9660 | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[free]" +free +echo "[ifconfig]" +/sbin/ifconfig +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ports]" +# Bug in RedHat's netstat spews annoying error messages. +netstat -ant 2>/dev/null +echo "[ifstat]" +/sbin/ifconfig +echo "[ps]" +ps -Aw -o pid,ppid,user,start,state,pri,pcpu,time,pmem,rsz,vsz,cmd + +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + $TOP -b -n 1 + fi +fi + +# vmstat +nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-netbsd.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-netbsd.sh new file mode 100755 index 0000000..49533da --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-netbsd.sh @@ -0,0 +1,62 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# NetBSD client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-netbsd.sh,v 1.15 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +df -P -tnonfs,kernfs,procfs,cd9660,null | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[meminfo]" +$BBHOME/bin/netbsd-meminfo +echo "[swapctl]" +/sbin/swapctl -s +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ifstat]" +netstat -i -b -n | egrep -v "^lo|$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-openbsd.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-openbsd.sh new file mode 100755 index 0000000..88a98f1 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-openbsd.sh @@ -0,0 +1,62 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# OpenBSD client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-openbsd.sh,v 1.14 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[df]" +df -P -tnonfs,kernfs,procfs,cd9660 | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[meminfo]" +$BBHOME/bin/openbsd-meminfo +echo "[swapctl]" +/sbin/swapctl -s +echo "[ifconfig]" +ifconfig -A +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ifstat]" +netstat -i -b -n | egrep -v "^lo|$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-osf1.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-osf1.sh new file mode 100755 index 0000000..6750152 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-osf1.sh @@ -0,0 +1,60 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# OSF1 client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-osf1.sh,v 1.13 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who +echo "[memory]" +vmstat -P +echo "[swap]" +swapon -s +echo "[df]" +df -t noprocfs | sed -e '/^[^ ][^ ]*$/{ +N +s/[ ]*\n[ ]*/ / +}' +echo "[mount]" +mount +echo "[ifconfig]" +ifconfig -a +echo "[route]" +cat /etc/routes +echo "[netstat]" +netstat -s +echo "[ports]" +netstat -an|grep "^tcp" +echo "[ps]" +ps -ef + +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + $TOP -b -n 1 + fi +fi + +# vmstat +nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-sco_sv.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-sco_sv.sh new file mode 100755 index 0000000..512598c --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-sco_sv.sh @@ -0,0 +1,60 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# SCO_SV client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# Copyright (C) 2006 Charles Goyard # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-sco_sv.sh,v 1.2 2006/08/02 13:35:46 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who -x +echo "[df]" +df -Bk +echo "[mount]" +mount -v +echo "[memsize]" +/etc/memsize +echo "[freemem]" +sar -r 1 2 | tail -1 +echo "[swap]" +swap -l +echo "[ifconfig]" +ifconfig -a +echo "[ifstat]" +ifconfig -in +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ports]" +netstat -an | grep "^tcp" +echo "[ps]" +ps -A -o pid,ppid,user,stime,s,pri,pcpu,time,vsz,args +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + $TOP -b -n 1 + fi +fi +# vmstat +nohup sh -c "vmstat 300 2 1>$BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_vmstat.$MACHINEDOTS.$$ $BBTMP/hobbit_vmstat.$MACHINEDOTS" /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_vmstat.$MACHINEDOTS; fi + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient-sunos.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient-sunos.sh new file mode 100755 index 0000000..d0ae1b9 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient-sunos.sh @@ -0,0 +1,77 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# Solaris client for Hobbit # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient-sunos.sh,v 1.18 2006/07/05 05:52:22 henrik Rel $ + +echo "[date]" +date +echo "[uname]" +uname -a +echo "[uptime]" +uptime +echo "[who]" +who + +echo "[df]" +# All of this because Solaris df cannot show multiple fs-types, or exclude certain fs types. +FSTYPES=`/bin/df -n -l|awk '{print $3}'|egrep -v "^proc|^fd|^mntfs|^ctfs|^devfs|^objfs|^nfs"|sort|uniq` +if test "$FSTYPES" = ""; then FSTYPES="ufs"; fi +set $FSTYPES +/bin/df -F $1 -k | grep -v " /var/run" +shift +while test "$1" != ""; do + /bin/df -F $1 -k | grep -v " /var/run" | tail +2 + shift +done + +echo "[mount]" +mount +echo "[prtconf]" +/usr/sbin/prtconf +echo "[memory]" +vmstat 1 2 | tail -1 +echo "[swap]" +/usr/sbin/swap -s +echo "[ifconfig]" +ifconfig -a +echo "[route]" +netstat -rn +echo "[netstat]" +netstat -s +echo "[ports]" +netstat -na -f inet -P tcp | tail +3 +netstat -na -f inet6 -P tcp | tail +5 +echo "[ifstat]" +/usr/bin/kstat -p -s '[or]bytes64' | sort +echo "[ps]" +ps -A -o pid,ppid,user,stime,s,pri,pcpu,time,pmem,rss,vsz,args + +# $TOP must be set, the install utility should do that for us if it exists. +if test "$TOP" != "" +then + if test -x "$TOP" + then + echo "[top]" + $TOP -b 20 + fi +fi + +# 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 2>&1 & +nohup sh -c "iostat -c 300 2 1>$BBTMP/hobbit_iostatcpu.$MACHINEDOTS.$$ 2>&1; mv $BBTMP/hobbit_iostatcpu.$MACHINEDOTS.$$ $BBTMP/hobbit_iostatcpu.$MACHINEDOTS" /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 2>&1 & +sleep 5 +if test -f $BBTMP/hobbit_vmstat.$MACHINEDOTS; then echo "[vmstat]"; cat $BBTMP/hobbit_vmstat.$MACHINEDOTS; rm -f $BBTMP/hobbit_vmstat.$MACHINEDOTS; fi +if test -f $BBTMP/hobbit_iostatcpu.$MACHINEDOTS; then echo "[iostatcpu]"; cat $BBTMP/hobbit_iostatcpu.$MACHINEDOTS; rm -f $BBTMP/hobbit_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 + +exit + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitclient.sh b/abs/mv-core/hobbit-client/client/bin/hobbitclient.sh new file mode 100755 index 0000000..8d66734 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/bin/hobbitclient.sh @@ -0,0 +1,94 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# Hobbit client main script. # +# # +# This invokes the OS-specific script to build a client message, and sends # +# if off to the Hobbit server. # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: hobbitclient.sh,v 1.17 2006/07/06 09:07:53 henrik Rel $ + +# Must make sure the commands return standard (english) texts. +LANG=C +LC_ALL=C +LC_MESSAGES=C +export LANG LC_ALL LC_MESSAGES + +LOCALMODE="no" +if test $# -ge 1; then + if test "$1" = "--local"; then + LOCALMODE="yes" + fi + shift +fi + +if test "$BBOSSCRIPT" = ""; then + BBOSSCRIPT="hobbitclient-`uname -s | tr '[A-Z]' '[a-z]'`.sh" +fi + +MSGFILE="$BBTMP/msg.$MACHINEDOTS.txt" +MSGTMPFILE="$MSGFILE.$$" +LOGFETCHCFG=$BBTMP/logfetch.$MACHINEDOTS.cfg +LOGFETCHSTATUS=$BBTMP/logfetch.$MACHINEDOTS.status +export LOGFETCHCFG LOGFETCHSTATUS + +rm -f $MSGTMPFILE +touch $MSGTMPFILE + + +CLIENTVERSION="`$BBHOME/bin/clientupdate --level`" + +if test "$LOCALMODE" = "yes"; then + echo "@@client#1|0|127.0.0.1|$MACHINEDOTS|$BBOSTYPE" >> $MSGTMPFILE +fi + +echo "client $MACHINE.$BBOSTYPE $CONFIGCLASS" >> $MSGTMPFILE +$BBHOME/bin/$BBOSSCRIPT >> $MSGTMPFILE +# logfiles +if test -f $LOGFETCHCFG +then + $BBHOME/bin/logfetch $LOGFETCHCFG $LOGFETCHSTATUS >>$MSGTMPFILE +fi +# Client version +echo "[clientversion]" >>$MSGTMPFILE +echo "$CLIENTVERSION" >> $MSGTMPFILE +# System clock +echo "[clock]" >> $MSGTMPFILE +$BBHOME/bin/logfetch --clock >> $MSGTMPFILE + +if test "$LOCALMODE" = "yes"; then + echo "@@" >> $MSGTMPFILE + $BBHOME/bin/hobbitd_client --local --config=$BBHOME/etc/localclient.cfg <$MSGTMPFILE +else + $BB $BBDISP "@" < $MSGTMPFILE >$LOGFETCHCFG.tmp + if test -f $LOGFETCHCFG.tmp + then + if test -s $LOGFETCHCFG.tmp + then + mv $LOGFETCHCFG.tmp $LOGFETCHCFG + else + rm -f $LOGFETCHCFG.tmp + fi + fi +fi + +# Save the latest file for debugging. +rm -f $MSGFILE +mv $MSGTMPFILE $MSGFILE + +if test "$LOCALMODE" != "yes" -a -f $LOGFETCHCFG; then + # Check for client updates + SERVERVERSION=`grep "^clientversion:" $LOGFETCHCFG | cut -d: -f2` + if test "$SERVERVERSION" != "" -a "$SERVERVERSION" != "$CLIENTVERSION"; then + exec $BBHOME/bin/clientupdate --update=$SERVERVERSION --reexec + fi +fi + +exit 0 + diff --git a/abs/mv-core/hobbit-client/client/bin/hobbitlaunch b/abs/mv-core/hobbit-client/client/bin/hobbitlaunch new file mode 100755 index 0000000..9104dda Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/hobbitlaunch differ diff --git a/abs/mv-core/hobbit-client/client/bin/logfetch b/abs/mv-core/hobbit-client/client/bin/logfetch new file mode 100755 index 0000000..0b71938 Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/logfetch differ diff --git a/abs/mv-core/hobbit-client/client/bin/msgcache b/abs/mv-core/hobbit-client/client/bin/msgcache new file mode 100755 index 0000000..33daa51 Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/msgcache differ diff --git a/abs/mv-core/hobbit-client/client/bin/orcahobbit b/abs/mv-core/hobbit-client/client/bin/orcahobbit new file mode 100755 index 0000000..9fcb227 Binary files /dev/null and b/abs/mv-core/hobbit-client/client/bin/orcahobbit differ diff --git a/abs/mv-core/hobbit-client/client/etc/clientlaunch.cfg b/abs/mv-core/hobbit-client/client/etc/clientlaunch.cfg new file mode 100644 index 0000000..8457a8f --- /dev/null +++ b/abs/mv-core/hobbit-client/client/etc/clientlaunch.cfg @@ -0,0 +1,43 @@ +# +# The clientlaunch.cfg file is loaded by "hobbitlaunch". +# It controls which of the Hobbit client-side modules to run, +# (both the main client "hobbitclient.sh" and any client-side +# extensions); how often, and with which parameters, options +# and environment variables. +# +# Note: On the Hobbit *server* itself, this file is normally +# NOT used. Instead, both the client- and server-tasks +# are controlled by the hobbitlaunch.cfg file. +# + +# msgcache is used for passive clients, that cannot connect +# directly to the Hobbit server. This is not the default +# setup, so this task is normally disabled. +[msgcache] + DISABLED + ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg + CMD $HOBBITCLIENTHOME/bin/msgcache --no-daemon --pidfile=$HOBBITCLIENTHOME/logs/msgcache.pid + LOGFILE $HOBBITCLIENTHOME/logs/msgcache.log + +# The main client task +[client] + ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg + CMD $HOBBITCLIENTHOME/bin/hobbitclient.sh + LOGFILE $HOBBITCLIENTHOME/logs/hobbitclient.log + INTERVAL 5m + +# ORCA data collector. This is an experimental add-on module, +# the data sent by this module are not processed by Hobbit 4.2. +[orcadata] + DISABLED + ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg + CMD $HOBBITCLIENTHOME/bin/orcahobbit --orca=/usr/local/orca/orcallator + LOGFILE $HOBBITCLIENTHOME/logs/hobbitclient.log + INTERVAL 5m + +[memmyth] + ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg + CMD /data/srv/hobbit/client/ext/hobbit-mem-myth.sh + LOGFILE /data/srv/hobbit/client/mythmem.log + INTERVAL 5m + diff --git a/abs/mv-core/hobbit-client/client/etc/hobbitclient.cfg b/abs/mv-core/hobbit-client/client/etc/hobbitclient.cfg new file mode 100644 index 0000000..9fff158 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/etc/hobbitclient.cfg @@ -0,0 +1,52 @@ +# Environment settings for the Hobbit client. + +BBDISP="127.0.0.1" # IP address of the Hobbit server +BBDISPLAYS="" # IP of multiple Hobbit servers. BBDISP must be "0.0.0.0". +CONFIGCLASS="$BBOSTYPE" # Default configuration class for logfiles + +PATH="/bin:/usr/bin:/sbin:/usr/sbin:/etc" # PATH setting for the client scripts. + +# You normally dont need to modify anything below here +BBPORT="1984" # Portnumber where hobbitd listens +BBHOME="$HOBBITCLIENTHOME" # Directory for the Hobbit client files +BB="$BBHOME/bin/bb" # The Hobbit client "bb" utility +BBTMP="$BBHOME/tmp" # Where we may store temporary files. +BBCLIENTLOGS="$BBHOME/logs" # Where we store the client logfiles + + +# The following defines a bunch of commands that BB extensions expect to be present. +# Hobbit does not use them, but they are provided here so if you use BB extension +# scripts, then they will hopefully run without having to do a lot of tweaking. + +UPTIME="/usr/bin/uptime" +AWK="/bin/awk" +CAT="/bin/cat" +CP="/bin/cp" +CUT="/bin/cut" +DATE="/bin/date" +EGREP="/bin/egrep" +EXPR="/usr/bin/expr" +FIND="/usr/bin/find" +GREP="/bin/grep" +HEAD="/usr/bin/head" +ID="/usr/bin/id" +LN="/bin/ln" +LS="/bin/ls" +MV="/bin/mv" +RM="/bin/rm" +SED="/bin/sed" +SORT="/usr/bin/sort" +TAIL="/usr/bin/tail" +TOUCH="/bin/touch" +TR="/bin/tr" +UNIQ="/usr/bin/uniq" +WHO="/usr/bin/who" +TOP="/usr/bin/top" +WC="/usr/bin/wc -l" +WCC="/usr/bin/wc" +# DF,DFCMD and PS are for compatibility only, NOT USED by the Hobbit client +DF="/bin/df -Pk" +DFCMD="/bin/df -Pk" +PS="ps ax" + +MAXLINE="32768" diff --git a/abs/mv-core/hobbit-client/client/etc/localclient.cfg b/abs/mv-core/hobbit-client/client/etc/localclient.cfg new file mode 100644 index 0000000..ae35418 --- /dev/null +++ b/abs/mv-core/hobbit-client/client/etc/localclient.cfg @@ -0,0 +1,359 @@ +# localclient.cfg - configuration file for a LOCAL Hobbit client. +# +# By default, Hobbit clients send raw data to the Hobbit server, +# which in turn converts the data into status messages. +# In that case, THIS FILE IS NOT USED and you should IGNORE it. +# +# If you want to configure clients locally (on the server that the +# client runs one), you do it here. You MUST also change the +# clientlaunch.cfg file and add the "--local" option to the +# command launching hobbitclient.sh +# +# The file defines a series of rules: +# UP : Changes the "cpu" status when the system has rebooted recently, +# or when it has been running for too long. +# LOAD : Changes the "cpu" status according to the system load. +# CLOCK : Changes the "cpu" status if the client system clock is +# not synchronized with the clock of the Hobbit server. +# DISK : Changes the "disk" status, depending on the amount of space +# used of filesystems. +# MEMPHYS: Changes the "memory" status, based on the percentage of real +# memory used. +# MEMACT : Changes the "memory" status, based on the percentage of "actual" +# memory used. Note: Not all systems report an "actual" value. +# MEMSWAP: Changes the "memory" status, based on the percentage of swap +# space used. +# PROC : Changes the "procs" status according to which processes were found +# in the "ps" listing from the client. +# LOG : Changes the "msgs" status according to entries in text-based logfiles. +# Note: The "client-local.cfg" file controls which logfiles the client will report. +# FILE : Changes the "files" status according to meta-data for files. +# Note: The "client-local.cfg" file controls which files the client will report. +# DIR : Changes the "files" status according to the size of a directory. +# Note: The "client-local.cfg" file controls which directories the client will report. +# PORT : Changes the "ports" status according to which tcp ports were found +# in the "netstat" listing from the client. +# DEFAULT: Set the default values that apply if no other rules match. +# +# All rules can be qualified so they apply only to certain hosts, or on certain +# times of the day (see below). +# +# Each type of rule takes a number of parameters: +# UP bootlimit toolonglimit +# The cpu status goes yellow if the system has been up for less than +# "bootlimit" time, or longer than "toolonglimit". The time is in +# minutes, or you can add h/d/w for hours/days/weeks - eg. "2h" for +# two hours, or "4w" for 4 weeks. +# Defaults: bootlimit=1h, toolonglimit=-1 (infinite). +# +# LOAD warnlevel paniclevel +# If the system load exceeds "warnlevel" or "paniclevel", the "cpu" +# status will go yellow or red, respectively. These are decimal +# numbers. +# Defaults: warnlevel=5.0, paniclevel=10.0 +# +# CLOCK maximum-offset +# If the system clock of the client differs from that of the Hobbit +# server by more than "maximum-offset" seconds, then the CPU status +# column will go yellow. Note that the accuracy of this test is limited, +# since it is affected by the time it takes a client status report to +# go from the client to the Hobbit server and be processed. You should +# therefore allow for a few seconds (5-10) of slack when you define +# your max. offset. +# It is not wise to use this test, unless your servers are synchronized +# to a common clock, e.g. through NTP. +# +# DISK filesystem warnlevel paniclevel +# DISK filesystem IGNORE +# If the utilization of "filesystem" is reported to exceed "warnlevel" +# or "paniclevel", the "disk" status will go yellow or red, respectively. +# "warnlevel" and "paniclevel" are either the percentage used, or the +# space available as reported by the local "df" command on the host. +# For the latter type of check, the "warnlevel" must be followed by the +# letter "U", e.g. "1024U". +# The special keyword "IGNORE" causes this filesystem to be ignored +# completely, i.e. it will not appear in the "disk" status column and +# it will not be tracked in a graph. This is useful for e.g. removable +# devices, backup-disks and similar hardware. +# "filesystem" is the mount-point where the filesystem is mounted, e.g. +# "/usr" or "/home". A filesystem-name that begins with "%" is interpreted +# as a Perl-compatible regular expression; e.g. "%^/oracle.*/" will match +# any filesystem whose mountpoint begins with "/oracle". +# Defaults: warnlevel=90%, paniclevel=95% +# +# MEMPHYS warnlevel paniclevel +# MEMACT warnlevel paniclevel +# MEMSWAP warnlevel paniclevel +# If the memory utilization exceeds the "warnlevel" or "paniclevel", the +# "memory" status will change to yellow or red, respectively. +# Note: The words "PHYS", "ACT" and "SWAP" are also recognized. +# Defaults: MEMPHYS warnlevel=100 paniclevel=101 (i.e. it will never go red) +# MEMSWAP warnlevel=50 paniclevel=80 +# MEMACT warnlevel=90 paniclevel=97 +# +# PROC processname minimumcount maximumcount color [TRACK=id] [TEXT=displaytext] +# The "ps" listing sent by the client will be scanned for how many +# processes containing "processname" are running, and this is then +# matched against the min/max settings defined here. If the running +# count is outside the thresholds, the color of the "procs" status +# changes to "color". +# To check for a process that must NOT be running: Set minimum and +# maximum to 0. +# +# "processname" can be a simple string, in which case this string must +# show up in the "ps" listing as a command. The scanner will find +# a ps-listing of e.g. "/usr/sbin/cron" if you only specify "processname" +# as "cron". +# "processname" can also be a Perl-compatiable regular expression, e.g. +# "%java.*inst[0123]" can be used to find entries in the ps-listing for +# "java -Xmx512m inst2" and "java -Xmx256 inst3". In that case, +# "processname" must begin with "%" followed by the reg.expression. +# If "processname" contains whitespace (blanks or TAB), you must enclose +# the full string in double quotes - including the "%" if you use regular +# expression matching. E.g. +# PROC "%hobbitd_channel --channel=data.*hobbitd_rrd" 1 1 yellow +# or +# PROC "java -DCLASSPATH=/opt/java/lib" 2 5 +# +# You can have multiple "PROC" entries for the same host, all of the +# checks are merged into the "procs" status and the most severe +# check defines the color of the status. +# +# The TRACK=id option causes the number of processes found to be recorded +# in an RRD file, with "id" as part of the filename. This graph will then +# appear on the "procs" page as well as on the "trends" page. Note that +# "id" must be unique among the processes tracked for each host. +# +# The TEXT=displaytext option affects how the process appears on the +# "procs" status page. By default, the process is listed with the +# "processname" as identification, but if this is a regular expression +# it may be a bit difficult to understand. You can then use e.g. +# "TEXT=Apache" to make these processes appear with the name "Apache" +# instead. +# +# Defaults: mincount=1, maxcount=-1 (unlimited), color="red". +# Note: No processes are checked by default. +# +# Example: Check that "cron" is running: +# PROC cron +# Example: Check that at least 5 "httpd" processes are running, but +# not more than 20: +# PROC httpd 5 20 +# +# LOG filename match-pattern [COLOR=color] [IGNORE=ignore-pattern] [TEXT=displaytext] +# In the "client-local.cfg" file, you can list any number of files +# that the client will collect log data from. These are sent to the +# Hobbit server together with the other client data, and you can then +# choose how to analyze the log data with LOG entries. +# +# ************ IMPORTANT *************** +# To monitor a logfile, you *MUST* configure both client-local.cfg +# and hobbit-clients.cfg. If you configure only the client-local.cfg +# file, the client will collect the log data and you can view it in +# the "client data" display, but it will not affect the color of the +# "msgs" status. On the other hand, if you configure only the +# hobbit-clients.cfg file, then there will be no log data to inspect, +# and you will not see any updates of the "msgs" status either. +# +# "filename" is a filename or pattern. The set of files reported by +# the client is matched against "filename", and if they match then +# this LOG entry is processed against the data from a file. +# +# "match-pattern": The log data is matched against this pattern. If +# there is a match, this log file causes a status change to "color". +# +# "ignore-pattern": The log data that matched "match-pattern" is also +# matched against "ignore-pattern". If the data matches the "ignore-pattern", +# this line of data does not affect the status color. In other words, +# the "ignore-pattern" can be used to refine the strings which cause +# a match. +# Note: The "ignore-pattern" is optional. +# +# "color": The color which this match will trigger. +# Note: "color" is optional, if omitted then "red" will be used. +# +# Example: Go yellow if the text "WARNING" shows up in any logfile. +# LOG %.* WARNING COLOR=yellow +# +# Example: Go red if the text "I/O error" or "read error" appears. +# LOG %/var/(adm|log)/messages %(I/O|read).error COLOR=red +# +# FILE filename [color] [things to check] [TRACK] +# NB: The files you wish to monitor must be listed in a "file:..." +# entry in the client-local.cfg file, in order for the client to +# report any data about them. +# +# "filename" is a filename or pattern. The set of files reported by +# the client is matched against "filename", and if they match then +# this FILE entry is processed against the data from that file. +# +# [things to check] can be one or more of the following: +# - "NOEXIST" triggers a warning if the file exists. By default, +# a warning is triggered for files that have a FILE entry, but +# which do not exist. +# - "TYPE=type" where "type" is one of "file", "dir", "char", "block", +# "fifo", or "socket". Triggers warning if the file is not of the +# specified type. +# - "OWNERID=owner" and "GROUPID=group" triggers a warning if the owner +# or group does not match what is listed here. "owner" and "group" is +# specified either with the numeric uid/gid, or the user/group name. +# - "MODE=mode" triggers a warning if the file permissions are not +# as listed. "mode" is written in the standard octal notation, e.g. +# "644" for the rw-r--r-- permissions. +# - "SIZEmin.size" triggers a warning it the file +# size is greater than "max.size" or less than "min.size", respectively. +# You can append "K" (KB), "M" (MB), "G" (GB) or "T" (TB) to the size. +# If there is no such modifier, KB is assumed. +# E.g. to warn if a file grows larger than 1MB (1024 KB): "SIZE<1M". +# - "SIZE=size" triggers a warning it the file size is not what is listed. +# - "MTIME>min.mtime" and "MTIME86400". +# - "MTIME=timestamp" checks if a file was last modified at "timestamp". +# "timestamp" is a unix epoch time (seconds since midnight Jan 1 1970 UTC). +# - "CTIME>min.ctime", "CTIME0 MTIME<600 yellow +# +# Example: Check the timestamp, size and SHA-1 hash of the /bin/sh program: +# FILE /bin/sh MTIME=1128514608 SIZE=645140 SHA1=5bd81afecf0eb93849a2fd9df54e8bcbe3fefd72 +# +# DIR directory [color] [SIZEminsize] [TRACK] +# NB: The directories you wish to monitor must be listed in a "dir:..." +# entry in the client-local.cfg file, in order for the client to +# report any data about them. +# +# "directory" is a filename or pattern. The set of directories reported by +# the client is matched against "directory", and if they match then +# this DIR entry is processed against the data for that directory. +# +# "SIZEminsize" defines the size limits that the +# directory must stay within. If it goes outside these limits, a warning +# will trigger. Note the Hobbit uses the raw number reported by the +# local "du" command on the client. This is commonly KB, but it may be +# disk blocks which are often 512 bytes. +# +# "TRACK" causes the size of this directory to be tracked in an RRD file, +# and shown on the graph on the "files" display. +# +# PORT [LOCAL=addr] [EXLOCAL=addr] [REMOTE=addr] [EXREMOTE=addr] [STATE=state] [EXSTATE=state] [min=mincount] [max=maxcount] [col=color] [TRACK=id] [TEXT=displaytext] +# The "netstat" listing sent by the client will be scanned for how many +# sockets match the criteria listed. +# "addr" is a (partial) address specification in the format used on +# the output from netstat. This is typically "10.0.0.1:80" for the IP +# 10.0.0.1, port 80. Or "*:80" for any local address, port 80. +# NB: The Hobbit clients normally report only the numeric data for +# IP-adresses and port-numbers, so you must specify the port +# number (e.g. "80") instead of the service name ("www"). +# "state" causes only the sockets in the specified state to be included; +# it is usually LISTEN or ESTABLISHED. +# The socket count is then matched against the min/max settings defined +# here. If the count is outside the thresholds, the color of the "ports" +# status changes to "color". +# To check for a socket that must NOT exist: Set minimum and +# maximum to 0. +# +# "addr" and "state" can be a simple strings, in which case these string must +# show up in the "netstat" at the appropriate column. +# "addr" and "state" can also be a Perl-compatiable regular expression, e.g. +# "LOCAL=%(:80|:443)" can be used to find entries in the netstat local port for +# both http (port 80) and https (port 443). In that case, portname or state must +# begin with "%" followed by the reg.expression. +# +# The TRACK=id option causes the number of sockets found to be recorded +# in an RRD file, with "id" as part of the filename. This graph will then +# appear on the "ports" page as well as on the "trends" page. Note that +# "id" must be unique among the ports tracked for each host. +# +# The TEXT=displaytext option affects how the port appears on the +# "ports" status page. By default, the port is listed with the +# local/remote/state rules as identification, but this may be somewhat +# difficult to understand. You can then use e.g. "TEXT=Secure Shell" to make +# these ports appear with the name "Secure Shell" instead. +# +# Defaults: state="LISTEN", mincount=1, maxcount=-1 (unlimited), color="red". +# Note: No ports are checked by default. +# +# Example: Check that there is someone listening on the https port: +# PORT "LOCAL=%([.:]443)$" state=LISTEN TEXT=https +# +# Example: Check that at least 5 "ssh" connections are established, but +# not more than 10; warn but do not error; graph the connection count: +# PORT "LOCAL=%([.:]22)$" state=ESTABLISHED min=5 max=20 color=yellow TRACK=ssh "TEXT=SSH logins" +# +# Example: Check that ONLY ports 22, 80 and 443 are open for incoming connections: +# PORT STATE=LISTEN LOCAL=%0.0.0.0[.:].* EXLOCAL=%[.:](22|80|443)$ MAX=0 "TEXT=Bad listeners" +# +# +# To apply rules to specific hosts, you can use the "HOST=", "EXHOST=", "PAGE=" +# "EXPAGE=", "CLASS=" or "EXCLASS=" qualifiers. (These act just as in the +# hobbit-alerts.cfg file). +# +# Hostnames are either a comma-separated list of hostnames (from the bb-hosts file), +# "*" to indicate "all hosts", or a Perl-compatible regular expression. +# E.g. "HOST=dns.foo.com,www.foo.com" identifies two specific hosts; +# "HOST=%www.*.foo.com EXHOST=www-test.foo.com" matches all hosts with a name +# beginning with "www", except the "www-test" host. +# "PAGE" and "EXPAGE" match the hostnames against the page on where they are +# located in the bb-hosts file, via the bb-hosts' page/subpage/subparent +# directives. This can be convenient to pick out all hosts on a specific page. +# +# Rules can be dependant on time-of-day, using the standard Hobbit syntax +# (the bb-hosts(5) about the NKTIME parameter). E.g. "TIME=W:0800:2200" +# applied to a rule will make this rule active only on week-days between +# 8AM and 10PM. +# +# You can also associate a GROUP id with a rule. The group-id is passed to +# the alert module, which can then use it to control who gets an alert when +# a failure occurs. E.g. the following associates the "httpd" process check +# with the "web" group, and the "sshd" check with the "admins" group: +# PROC httpd 5 GROUP=web +# PROC sshd 1 GROUP=admins +# In the hobbit-alerts.cfg file, you could then have rules like +# GROUP=web +# MAIL webmaster@foo.com +# GROUP=admins +# MAIL root@foo.com +# +# Qualifiers must be placed after each rule, e.g. +# LOAD 8.0 12.0 HOST=db.foo.com TIME=*:0800:1600 +# +# If you have multiple rules that you want to apply the same qualifiers to, +# you can write the qualifiers *only* on one line, followed by the rules. E.g. +# HOST=%db.*.foo.com TIME=W:0800:1600 +# LOAD 8.0 12.0 +# DISK /db 98 100 +# PROC mysqld 1 +# will apply the three rules to all of the "db" hosts on week-days between 8AM +# and 4PM. This can be combined with per-rule qualifiers, in which case the +# per-rule qualifier overrides the general qualifier; e.g. +# HOST=%.*.foo.com +# LOAD 7.0 12.0 HOST=bax.foo.com +# LOAD 3.0 8.0 +# will result in the load-limits being 7.0/12.0 for the "bax.foo.com" host, +# and 3.0/8.0 for all other foo.com hosts. +# +# The special DEFAULT section can modify the built-in defaults - this must +# be placed at the end of the file. + +DEFAULT + # These are the built-in defaults. + UP 1h + LOAD 5.0 10.0 + DISK * 90 95 + MEMPHYS 100 101 + MEMSWAP 50 80 + MEMACT 90 97 + diff --git a/abs/mv-core/hobbit-client/client/ext/hobbit-mem-myth.sh b/abs/mv-core/hobbit-client/client/ext/hobbit-mem-myth.sh new file mode 100755 index 0000000..642672f --- /dev/null +++ b/abs/mv-core/hobbit-client/client/ext/hobbit-mem-myth.sh @@ -0,0 +1,52 @@ +#!/bin/bash +MBEPID=`ps -ef|grep mythbackend |grep -v runsv|grep -v grep|grep -v logger|awk '{print $2 }'` +MFEPID=`ps -ef|grep mythfrontend |grep -v runsv|grep -v grep|grep -v logger|awk '{print $2 }'` + + + +COLOR=green # By default, everything is OK + + # Do whatever you need to test for something +if [ ! x$MBEPID = x ] +then +VmSize=`cat /proc/$MBEPID/status|grep -i vmsize|awk '{print $2 }'` +VmPeak=`cat /proc/$MBEPID/status|grep -i vmpeak|awk '{print $2 }'` +VmRSS=`cat /proc/$MBEPID/status|grep -i vmrss |awk '{print $2 }'` +MSGMBE=" + VmSize:$VmSize + VmPeak:$VmPeak + VmRSS:$VmRSS + " +# echo $MSGMBE + # Tell Hobbit about it + $BB $BBDISP "data $MACHINE.memmbe $COLOR `date` + + ${MSGMBE} + + " +fi + + + +if [ ! x$MFEPID = x ] +then +VmSize=`cat /proc/$MFEPID/status|grep -i vmsize|awk '{print $2 }'` +VmPeak=`cat /proc/$MFEPID/status|grep -i vmpeak|awk '{print $2 }'` +VmRSS=`cat /proc/$MFEPID/status|grep -i vmrss |awk '{print $2 }'` +MSGMBE=" + VmSize:$VmSize + VmPeak:$VmPeak + VmRSS:$VmRSS + " +# echo $MSGMBE + # Tell Hobbit about it + $BB $BBDISP "data $MACHINE.memmfe $COLOR `date` + + ${MSGMBE} + + " +fi + + + + diff --git a/abs/mv-core/hobbit-client/client/runclient.sh b/abs/mv-core/hobbit-client/client/runclient.sh new file mode 100755 index 0000000..f9d3a6f --- /dev/null +++ b/abs/mv-core/hobbit-client/client/runclient.sh @@ -0,0 +1,133 @@ +#!/bin/sh +#----------------------------------------------------------------------------# +# Hobbit client bootup script. # +# # +# This invokes hobbitlaunch, which in turn runs the Hobbit client and any # +# extensions configured. # +# # +# Copyright (C) 2005-2006 Henrik Storner # +# "status" section (C) Scott Smith 2006 # +# # +# This program is released under the GNU General Public License (GPL), # +# version 2. See the file "COPYING" for details. # +# # +#----------------------------------------------------------------------------# +# +# $Id: runclient.sh,v 1.13 2006/07/14 21:25:19 henrik Rel $ + +# Default settings for this client +MACHINEDOTS="`uname -n`" # This systems hostname +BBOSTYPE="`uname -s | tr '[A-Z]' '[a-z]'`" # This systems operating system in lowercase +BBOSSCRIPT="hobbitclient-$BBOSTYPE.sh" + +# Commandline mods for the defaults +while test "$1" != "" +do + case "$1" in + --hostname=*) + MACHINEDOTS="`echo $1 | sed -e 's/--hostname=//'`" + ;; + --os=*) + BBOSTYPE="`echo $1 | sed -e 's/--os=//' | tr '[A-Z]' '[a-z]'`" + ;; + --class=*) + CONFIGCLASS="`echo $1 | sed -e 's/--class=//' | tr '[A-Z]' '[a-z]'`" + ;; + --help) + echo "Usage: $0 [--hostname=CLIENTNAME] [--os=rhel3|linux22] [--class=CLASSNAME] start|stop" + exit 0 + ;; + start) + CMD=$1 + ;; + stop) + CMD=$1 + ;; + restart) + CMD=$1 + ;; + status) + CMD=$1 + ;; + esac + + shift +done + +OLDDIR="`pwd`" +cd "`dirname $0`" +HOBBITCLIENTHOME="`pwd`" +cd "$OLDDIR" + +MACHINE="`echo $MACHINEDOTS | sed -e 's/\./,/g'`" + +export MACHINE MACHINEDOTS BBOSTYPE BBOSSCRIPT HOBBITCLIENTHOME CONFIGCLASS + +case "$CMD" in + "start") + if test ! -w $HOBBITCLIENTHOME/logs; then + echo "Cannot write to the $HOBBITCLIENTHOME/logs directory" + exit 1 + fi + if test ! -w $HOBBITCLIENTHOME/tmp; then + echo "Cannot write to the $HOBBITCLIENTHOME/tmp directory" + exit 1 + fi + + if test -s $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid; then + echo "Hobbit client already running, re-starting it" + $0 stop + rm -f $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid + fi + + $HOBBITCLIENTHOME/bin/hobbitlaunch --config=$HOBBITCLIENTHOME/etc/clientlaunch.cfg --log=$HOBBITCLIENTHOME/logs/clientlaunch.log --pidfile=$HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid + if test $? -eq 0; then + echo "Hobbit client for $BBOSTYPE started on $MACHINEDOTS" + else + echo "Hobbit client startup failed" + fi + ;; + + "stop") + if test -s $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid; then + kill `cat $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid` + echo "Hobbit client stopped" + else + echo "Hobbit client not running" + fi + ;; + + "restart") + if test -s $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid; then + $0 stop + else + echo "Hobbit client not running, continuing to start it" + fi + + $0 start + ;; + + "status") + if test -s $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid + then + kill -0 `cat $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid` + if test $? -eq 0 + then + echo "Hobbit client (clientlaunch) running with PID `cat $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid`" + else + echo "Hobbit client not running, removing stale PID file" + rm -f $HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid + fi + else + echo "Hobbit client (clientlaunch) does not appear to be running" + fi + ;; + + *) + echo "Usage: $0 start|stop|restart|status" + break; + +esac + +exit 0 + diff --git a/abs/mv-core/hobbit-client/hobbit-client.install b/abs/mv-core/hobbit-client/hobbit-client.install new file mode 100755 index 0000000..f5ca232 --- /dev/null +++ b/abs/mv-core/hobbit-client/hobbit-client.install @@ -0,0 +1,14 @@ +post_install() { + chown -R nobody /data/srv/hobbit +# chown -R nobody /data/srv/httpd/htdocs/hobbit +# chown -R nobody /var/log/hobbit +} + +post_upgrade() { + post_install $1 +} + +op=$1 +shift +$op $* +# vim: ft=sh ts=2 -- cgit v0.12