From 7b60d4c8a0d096fbbb422611fce6fc664a99b7c8 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Tue, 2 Nov 1999 17:23:55 +0000 Subject: [PATCH] Initial import --- config/spong.conf.aix | 21 ++++++++++++ config/spong.conf.bsdi | 22 ++++++++++++ config/spong.conf.hpux | 22 ++++++++++++ config/spong.conf.irix | 22 ++++++++++++ config/spong.conf.osf1 | 43 ++++++++++++++++++++++++ src/lib/Spong/Client/plugins/check_mailq | 32 ++++++++++++++++++ 6 files changed, 162 insertions(+) create mode 100755 config/spong.conf.aix create mode 100755 config/spong.conf.bsdi create mode 100755 config/spong.conf.hpux create mode 100755 config/spong.conf.irix create mode 100755 config/spong.conf.osf1 create mode 100755 src/lib/Spong/Client/plugins/check_mailq diff --git a/config/spong.conf.aix b/config/spong.conf.aix new file mode 100755 index 0000000..4607d11 --- /dev/null +++ b/config/spong.conf.aix @@ -0,0 +1,21 @@ +# --------------------------------------------------------------------------- +# OS Specific variables. A few external programs are used by spong-client, +# spong-network, and spong-message. Chances are these differ from OS to OS. +# A couple of things to watch for. +# +# $DF Your df command should output %used as the first column with a '%' +# $PS You really want you ps command to return sorted via CPU usage +# $PING Make sure your ping command only pings a finite number of times +# --------------------------------------------------------------------------- + +$DF = "/usr/bin/df"; +$UPTIME = "/usr/bin/uptime"; +$PS = "/usr/bin/ps -eF \"pcpu time vsz pid ruser args\" | /usr/bin/sort -r"; +$GREP = "/usr/bin/grep"; +$PING = "/usr/sbin/ping -n -c 2 HOST"; +$TRACEROUTE = "/usr/bin/traceroute"; +$SENDMAIL = "/usr/sbin/sendmail -t"; +$MAILQ = "/usr/sbin/sendmail -bp"; +$RPCINFO = "/bin/rcpinfo -u"; + +1; # I'm a file that gets included in perl code - leave this 1 here... diff --git a/config/spong.conf.bsdi b/config/spong.conf.bsdi new file mode 100755 index 0000000..3f71137 --- /dev/null +++ b/config/spong.conf.bsdi @@ -0,0 +1,22 @@ +# --------------------------------------------------------------------------- +# OS Specific variables. A few external programs are used by spong-client, +# spong-network, and spong-message. Chances are these differ from OS to OS. +# A couple of things to watch for. +# +# $DF Your df command should output %used as the first column with a '%' +# $PS You really want you ps command to return sorted via CPU usage +# $PING Make sure your ping command only pings a finite number of times +# and since some ping command want args after the host, put the +# word HOST where you need the host to be in your ping command +# --------------------------------------------------------------------------- + +$DF = "/bin/df"; +$UPTIME = "/usr/bin/uptime"; +$PS = "/bin/ps -ax"; +$GREP = "/usr/bin/grep"; +$PING = "/sbin/ping -c 2 HOST"; +$TRACEROUTE = "/usr/sbin/traceroute"; +$SENDMAIL = "/usr/sbin/sendmail -t"; +$MAILQ = "/usr/sbin/sendmail -bp"; + +1; # I'm a file that gets included in perl code - leave this 1 here... diff --git a/config/spong.conf.hpux b/config/spong.conf.hpux new file mode 100755 index 0000000..39aebf3 --- /dev/null +++ b/config/spong.conf.hpux @@ -0,0 +1,22 @@ +# --------------------------------------------------------------------------- +# OS Specific variables. A few external programs are used by spong-client, +# spong-network, and spong-message. Chances are these differ from OS to OS. +# A couple of things to watch for. +# +# $DF Your df command should output %used as the first column with a '%' +# $PS You really want you ps command to return sorted via CPU usage +# $PING Make sure your ping command only pings a finite number of times +# and since some ping command want args after the host, put the +# word HOST where you need the host to be in your ping command +# --------------------------------------------------------------------------- + +$DF = "/usr/bin/bdf"; +$UPTIME = "/usr/bin/uptime"; +$PS = "/bin/ps -ef"; +$GREP = "/bin/grep"; +$PING = "/etc/ping HOST -n 2"; +$TRACEROUTE = "/usr/contrib/bin/traceroute"; +$SENDMAIL = "/usr/lib/sendmail -t"; +$MAILQ = "/usr/lib/sendmail -bp"; + +1; # I'm a file that gets included in perl code - leave this 1 here... diff --git a/config/spong.conf.irix b/config/spong.conf.irix new file mode 100755 index 0000000..7058ef5 --- /dev/null +++ b/config/spong.conf.irix @@ -0,0 +1,22 @@ +# --------------------------------------------------------------------------- +# OS Specific variables. A few external programs are used by spong-client, +# spong-network, and spong-message. Chances are these differ from OS to OS. +# A couple of things to watch for. +# +# $DF Your df command should output %used as the first column with a '%' +# $PS You really want you ps command to return sorted via CPU usage +# $PING Make sure your ping command only pings a finite number of times +# and since some ping command want args after the host, put the +# word HOST where you need the host to be in your ping command +# --------------------------------------------------------------------------- + +$DF = "/bin/df -P"; +$UPTIME = "/usr/bsd/uptime"; +$PS = "/bin/ps -ef"; +$GREP = "/sbin/grep"; +$PING = "/usr/etc/ping -c 2 HOST"; +$TRACEROUTE = "/usr/etc/traceroute"; +$SENDMAIL = "/usr/lib/sendmail -t"; +$MAILQ = "/usr/lib/sendmail -bp"; + +1; # I'm a file that gets included in perl code - leave this 1 here... diff --git a/config/spong.conf.osf1 b/config/spong.conf.osf1 new file mode 100755 index 0000000..4d16253 --- /dev/null +++ b/config/spong.conf.osf1 @@ -0,0 +1,43 @@ +# --------------------------------------------------------------------------- +# OS Specific variables. A few external programs are used by spong-client, +# spong-network, and spong-message. Chances are these differ from OS to OS. +# A couple of things to watch for. +# +# $DF Your df command should output %used as the first column with a '%' +# $PS You really want you ps command to return sorted via CPU usage +# $PING Make sure your ping command only pings a finite number of times +# --------------------------------------------------------------------------- + +$DF = "/usr/bin/df"; +$UPTIME = "/usr/ucb/uptime"; # Use berkely uptime, + # OSF1 load avg is 5, 30, 60 seconds +$PS = "/usr/bin/ps -ef -o \"pcpu time vsz pid ruser args\" | /usr/bin/sort -r"; +$GREP = "/usr/bin/grep"; +$PING = "/sbin/ping -n -c 2 HOST"; +$TRACEROUTE = "/usr/sbin/traceroute"; +$SENDMAIL = "/usr/lib/sendmail -t"; +$MAILQ = "/usr/lib/sendmail -bp"; +$RPCINFO = "/usr/sbin/rcpinfo -u"; + +undef $LSPS; + +sub get_swap { + my( $msg, $page, $skip); + + $skip = 1; $msg = ""; $page = 0; + open (FOO,"-|") or exec "/sbin/swapon -s"; + while () { + if (/^Total swap alloc/) { $skip = 0; } + if ($skip) {next;} + $msg .= $_; + if (/Available space:\s+\d+\s+pages \(\s*(\d+)%\)/) { + $page = 100 - $1; + } + } + close FOO; + + return ($msg,$page); + +} + +1; diff --git a/src/lib/Spong/Client/plugins/check_mailq b/src/lib/Spong/Client/plugins/check_mailq new file mode 100755 index 0000000..aa807f4 --- /dev/null +++ b/src/lib/Spong/Client/plugins/check_mailq @@ -0,0 +1,32 @@ +# Register routine with plugin registery +$CHECKFUNCS{'mailq'} = \&check_mailq; + +# Sendmail mailq check for mail servers. If checks the numeber of mail +# message queue against the $MAILQWARN AND $MAILQCRIT variables + +sub check_mailq { + my($mqcnt, $message, $color, $summary ); + + open (FOO,"$MAILQ |"); + $mqcnt = 0; + while () { + if (/Mail Queue\s+\((\d+)/) { $mqcnt = $1; } + + # Grab the first 10 entries. + if (++$lines <= 35) { $message .= $_ }; + } + close FOO; + + $color = "green"; + if ($mqcnt > $MAILQWARN) { $color = "yellow"; } + if ($mqcnt > $MAILQCRIT) { $color = "red"; } + + $summary = "Mail Queue count = $mqcnt"; + + &debug("mailq - $color, $summary"); + &status( $SPONGSERVER, $HOST, "mailq", $color, $summary, $message ); +} + +# I'm include perl code, I need this line. +1; + -- 2.30.2