From 4aded137e247713b0ecfc80991231703a25e0b45 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Tue, 16 Nov 1999 05:03:51 +0000 Subject: [PATCH] Initial import --- config/spong.conf.linux | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 config/spong.conf.linux diff --git a/config/spong.conf.linux b/config/spong.conf.linux new file mode 100755 index 0000000..f873b7f --- /dev/null +++ b/config/spong.conf.linux @@ -0,0 +1,42 @@ +# --------------------------------------------------------------------------- +# 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 = "/bin/grep"; +$PING = "/bin/ping -c 2 HOST"; +$TRACEROUTE = "/usr/sbin/traceroute"; +$SENDMAIL = "/usr/sbin/sendmail -t"; +$MAILQ = "/usr/sbin/sendmail -bp"; + +undef $LSPS; + +# Routine to calculate swap space for Linux from /proc fs +sub get_swap { + my ( $msg, $page, $avail, $used, $total); + + open (FOO,"-|") or exec "cat /proc/meminfo"; + while ($msg = ) { + if ($msg =~ /Swap:\s+(\d+)\s+(\d+)\s+(\d+)/) { + ($total,$used,$avail) = ($1, $2, $3); + $page = int($used / ($total) * 100); + last; + } + } + close FOO; + + return ($msg, $page); +} + + +1; # I'm a file that gets included in perl code - leave this 1 here... -- 2.30.2