diff options
Diffstat (limited to 'cluster/procstatd')
-rwxr-xr-x | cluster/procstatd/BUILD | 32 | ||||
-rwxr-xr-x | cluster/procstatd/DEPENDS | 1 | ||||
-rwxr-xr-x | cluster/procstatd/DETAILS | 23 | ||||
-rw-r--r-- | cluster/procstatd/HISTORY | 13 | ||||
-rw-r--r-- | cluster/procstatd/procstatd-1.4.2.config | 257 | ||||
-rw-r--r-- | cluster/procstatd/services | 1 | ||||
-rwxr-xr-x | cluster/procstatd/xinetd.d/procstatd | 13 |
7 files changed, 340 insertions, 0 deletions
diff --git a/cluster/procstatd/BUILD b/cluster/procstatd/BUILD new file mode 100755 index 0000000000..ceac4ab28e --- /dev/null +++ b/cluster/procstatd/BUILD @@ -0,0 +1,32 @@ +( + + patch -p1 < $SCRIPT_DIRECTORY/procstatd-1.4.2.config && + + sedit "s/PREFIX=.*$/PREFIX=\/usr/" Makefile && + sedit "s/share\///g" Makefile && + sedit "s/port = 7881/port = 7885/" parsecl.c && + + make && + make install && + + if spell_ok perl; then + cd webwatch + + install -m 644 webwatch.config /etc/webwatch.config.default + + install -m 755 clean_ipc /usr/bin + install -m 755 clean_procstatd /usr/bin + install -m 755 clean_prog /usr/bin + install -m 755 start_helper /usr/bin + install -m 755 clean_procstatd /usr/bin + install -m 755 webwatchd /usr/bin + + install -m 755 -d /usr/share/procstatd + for FILE in `ls -1 meter/*` ; + do + install -m 644 $FILE /usr/share/procstatd + done + fi + +) > $C_FIFO 2>&1 + diff --git a/cluster/procstatd/DEPENDS b/cluster/procstatd/DEPENDS new file mode 100755 index 0000000000..82c0fbdad1 --- /dev/null +++ b/cluster/procstatd/DEPENDS @@ -0,0 +1 @@ +optional_depends perl diff --git a/cluster/procstatd/DETAILS b/cluster/procstatd/DETAILS new file mode 100755 index 0000000000..f746ebd7c4 --- /dev/null +++ b/cluster/procstatd/DETAILS @@ -0,0 +1,23 @@ + SPELL=procstatd + VERSION=1.4.2 + SOURCE=$SPELL-$VERSION.tgz + MD5[0]=7a4741657e234cfef97e4c154544e9fb +SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION + SOURCE_URL[0]=http://www.phy.duke.edu/brahma/$SOURCE + WEB_SITE=http://www.phy.duke.edu/brahma + ENTERED=20020609 + UPDATED=20020619 + MAINTAINER=zoran@idi.ntnu.no + LICENSE=GPL + SHORT="daemon for gathering statistics about /proc" +cat << EOF +procstatd is a daemon that can be run either from userspace or inetd +that can be queried via a simple API to parse various files in /proc +and transform them into statistics. The returned data is in a simply +parsable ASCII string (in a single packet) and might be used to, for +example, drive a simple display. The nice thing about it is that by +running procstatd's on all nodes of a beowulf or cluster, users or +managers can (with suitable front-end tools) see what the loads and +so forth are. The package contains also a perl script (webwatchd) +for generating a simple html page with the statistics of the nodes. +EOF diff --git a/cluster/procstatd/HISTORY b/cluster/procstatd/HISTORY new file mode 100644 index 0000000000..94452a33dd --- /dev/null +++ b/cluster/procstatd/HISTORY @@ -0,0 +1,13 @@ +2005-01-23 Eric Sandall <eric@sandall.us> + * BUILD: Use spell_ok instead of spell_installed + +2002-06-22 Zoran Constantinescu <zoran@idi.ntnu.no> + * Added entry for xinetd and /etc/services. + +2002-06-19 Zoran Constantinescu <zoran@idi.ntnu.no> + * Updated BUILD with default config for webwatchd. + Added LICENSE entry. + +2002-06-09 Zoran Constantinescu <zoran@idi.ntnu.no> + * Spell created. + diff --git a/cluster/procstatd/procstatd-1.4.2.config b/cluster/procstatd/procstatd-1.4.2.config new file mode 100644 index 0000000000..82c2f33aae --- /dev/null +++ b/cluster/procstatd/procstatd-1.4.2.config @@ -0,0 +1,257 @@ +Only in procstatd-1.4.2/webwatch: .README.swp +diff -ru procstatd-1.4.2/webwatch/clean_ipc procstatd-1.4.2/webwatch/clean_ipc +--- procstatd-1.4.2/webwatch/clean_ipc 2002-06-22 20:01:05.000000000 +0200 ++++ procstatd-1.4.2/webwatch/clean_ipc 2002-06-22 20:01:31.000000000 +0200 +@@ -44,7 +44,7 @@ + if( defined($opt_f) ) { + $configfile = $opt_f; + } else { +- $configfile = "/home/shiva/jpormann/webwatch/webwatch.config"; ++ $configfile = "/etc/webwatch.config"; + } + + # create machine list +diff -ru procstatd-1.4.2/webwatch/clean_procstatd procstatd-1.4.2/webwatch/clean_procstatd +--- procstatd-1.4.2/webwatch/clean_procstatd 2002-06-22 20:01:05.000000000 +0200 ++++ procstatd-1.4.2/webwatch/clean_procstatd 2002-06-22 20:02:52.000000000 +0200 +@@ -32,15 +32,15 @@ + if( defined($opt_f) ) { + $configfile = $opt_f; + } else { +- $configfile = "/home/shiva/jpormann/webwatch/webwatch.config"; ++ $configfile = "/etc/webwatch.config"; + } + + # clear hostlist and set some basic defaults + @hostlist = (); + $hearbeat = 10*60; # heartbeat (in seconds) + $port = 7885; +-$exelocation = "/home/shiva/jpormann/webwatch"; +-$weblocation = "/home/shiva/jpormann/public_html"; ++$exelocation = "/usr/bin"; ++$weblocation = "/usr/share/httpd/htdocs/procstatd"; + + &read_config( $configfile ); + +diff -ru procstatd-1.4.2/webwatch/clean_prog procstatd-1.4.2/webwatch/clean_prog +--- procstatd-1.4.2/webwatch/clean_prog 2002-06-22 20:01:05.000000000 +0200 ++++ procstatd-1.4.2/webwatch/clean_prog 2002-06-22 20:06:08.000000000 +0200 +@@ -43,7 +43,7 @@ + if( defined($opt_f) ) { + $configfile = $opt_f; + } else { +- $configfile = "/home/shiva/jpormann/webwatch/webwatch.config"; ++ $configfile = "/etc/webwatch.config"; + } + + # clear hostlist and set some basic defaults +diff -ru procstatd-1.4.2/webwatch/start_procstatd procstatd-1.4.2/webwatch/start_procstatd +--- procstatd-1.4.2/webwatch/start_procstatd 2002-06-22 20:01:05.000000000 +0200 ++++ procstatd-1.4.2/webwatch/start_procstatd 2002-06-22 20:07:03.000000000 +0200 +@@ -32,15 +32,15 @@ + if( defined($opt_f) ) { + $configfile = $opt_f; + } else { +- $configfile = "/home/shiva/jpormann/webwatch/webwatch.config"; ++ $configfile = "/etc/webwatch.config"; + } + + # clear hostlist and set some basic defaults + @hostlist = (); + $hearbeat = 10*60; # heartbeat (in seconds) + $port = 7885; +-$exelocation = "/home/shiva/jpormann/webwatch"; +-$weblocation = "/home/shiva/jpormann/public_html"; ++$exelocation = "/usr/bin"; ++$weblocation = "/usr/share/httpd/htdocs/procstatd"; + + &read_config( $configfile ); + +diff -ru procstatd-1.4.2/webwatch/webwatch.config procstatd-1.4.2/webwatch/webwatch.config +--- procstatd-1.4.2/webwatch/webwatch.config 2002-06-22 20:30:07.000000000 +0200 ++++ procstatd-1.4.2/webwatch/webwatch.config 2002-06-22 20:44:10.000000000 +0200 +@@ -1,30 +1,32 @@ + # where to put the web page +-weblocation = /home/shiva/jpormann/public_html +-exelocation = /home/shiva/jpormann/webwatch ++weblocation = /tmp ++exelocation = /usr/bin + # might as well use a fully qualified path to the ping command + pingcmd = /bin/ping + # all hostlist sets are accumulated into 1 list +-hostlist = bull,cow1,cow2,cow3,cow4,cow5,cow6,cow7,cow8,cow9 +-hostlist = cow10,cow11,cow12,cow13,cow14,cow15,cow16 +-hostlist = beowulf1,beowulf2,beowulf3,beowulf4,beowulf5,beowulf6,beowulf7 +-hostlist = beowulf8,beowulf9,beowulf10,beowulf11,beowulf12,beowulf13 +-hostlist = beowulf14,beowulf15,beowulf16 ++hostlist = localhost ++#hostlist = bull,cow1,cow2,cow3,cow4,cow5,cow6,cow7,cow8,cow9 ++#hostlist = cow10,cow11,cow12,cow13,cow14,cow15,cow16 ++#hostlist = beowulf1,beowulf2,beowulf3,beowulf4,beowulf5,beowulf6,beowulf7 ++#hostlist = beowulf8,beowulf9,beowulf10,beowulf11,beowulf12,beowulf13 ++#hostlist = beowulf14,beowulf15,beowulf16 + # data items to output +-outputlist = load1:1,load5:1,load15:1,mem_used:1,shm_tot:1 ++outputlist = load1:1,load5:1,load15:1,mem_used:1,shm_tot:1,mem_free:1,proc:1,uptime:1 + # heart beat = refresh rate if no web hits +-heartbeat = 10m ++heartbeat = 30s + # port number to hit on the procstatd hosts + port = 7885 + # header info for the web page +-webtitle = EE Department Beowulf Cluster +-webimage1 = duke.emblem.jpg +-webimage2 = magi.jpg +-weblink1 = EE Department Home Page,http://www.ee.duke.edu +-weblink2 = Duke University,http://www.duke.edu +-weblink3 = Cluster Info,http://www.ee.duke.edu/~jpormann/cluster_info.html +-weblink4 = Beowulf Home Page,http://cesdis.gsfc.nasa.gov/linux/beowulf/beowulf.html ++webtitle = Beowulf Cluster ++#webimage1 = duke.emblem.jpg ++#webimage2 = magi.jpg ++#weblink1 = EE Department Home Page,http://www.ee.duke.edu ++#weblink2 = Duke University,http://www.duke.edu ++#weblink3 = Cluster Info,http://www.ee.duke.edu/~jpormann/cluster_info.html ++#weblink4 = Beowulf Home Page,http://cesdis.gsfc.nasa.gov/linux/beowulf/beowulf.html + # for meterimage=meter_ and meterround=10 + # you need to have files: meter_00.jpg, meter_10.jpg, ... meter_100.jpg ++meterlocation = file:/usr/share/procstatd + meterimage = meter_ + meterround = 10 + +diff -ru procstatd-1.4.2/webwatch/webwatchd procstatd-1.4.2/webwatch/webwatchd +--- procstatd-1.4.2/webwatch/webwatchd 2002-06-22 20:41:25.000000000 +0200 ++++ procstatd-1.4.2/webwatch/webwatchd 2002-06-22 20:50:52.000000000 +0200 +@@ -44,7 +44,7 @@ + if( defined($opt_f) ) { + $configfile = $opt_f; + } else { +- $configfile = "/home/shiva/jpormann/webwatch/webwatch.config"; ++ $configfile = "/etc/webwatch.config"; + } + if( defined($opt_V) ) { + $opt_v = 1; +@@ -55,8 +55,9 @@ + @outputlist = (); + $heartbeat = 10*60; # heartbeat (in seconds) + $port = 7885; +-$exelocation = "/home/shiva/jpormann/webwatch"; +-$weblocation = "/home/shiva/jpormann/public_html"; ++$exelocation = "/usr/bin"; ++$weblocation = "/usr/share/httpd/htdocs/procstatd"; ++$meterlocation = "."; + $title = "EE Department Beowulf Cluster"; + $image1 = "duke.emblem.xbm"; + $image2 = $image1; +@@ -112,7 +113,7 @@ + print FP_HTML "<p>\n"; + print FP_HTML "<hr>\n"; + if( scalar(@webtext) > 0 ) { +- print FP_HTML "<table border=true>\n"; ++ print FP_HTML "<table border=1>\n"; + for($i=0;$i<scalar(@webtext);$i+=2) { + print FP_HTML " <tr>\n"; + print FP_HTML " <td><a href=\"$weblink[$i]\">$webtext[$i]</a></td>\n"; +@@ -128,8 +129,8 @@ + print FP_HTML " Last Update: $tm\n<br>\n"; + print FP_HTML " Update Frequency: $heartbeat seconds\n"; + print FP_HTML "<hr>\n<p>\n"; +- print FP_HTML "<table border=true>\n"; +- print FP_HTML " <caption><b>EE Cluster Statistics</b></caption>\n"; ++ print FP_HTML "<table border=1>\n"; ++ print FP_HTML " <caption><b>$title Statistics</b></caption>\n"; + print FP_HTML " <tr>\n"; + # print the basic stats + print FP_HTML " <td><b>Machine Name</b></td>\n"; +@@ -184,9 +185,9 @@ + # : now round + $pct = int( $pct / $meterround + 0.5 ) * $meterround; + if( $pct > 100.0 ) { +- print FP_HTML " <td><img src=\"${meterimage}max.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}max.jpg\"></td>\n"; + } else { +- print FP_HTML " <td><img src=\"${meterimage}${pct}.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}${pct}.jpg\"></td>\n"; + } + + # percent memory load +@@ -200,9 +201,9 @@ + # : now round + $pct = int( $pct / $meterround + 0.5 ) * $meterround; + if( $pct > 100.0 ) { +- print FP_HTML " <td><img src=\"${meterimage}max.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}max.jpg\"></td>\n"; + } else { +- print FP_HTML " <td><img src=\"${meterimage}${pct}.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}${pct}.jpg\"></td>\n"; + } + + for($j=0;$j<scalar(@outputlist);$j++) { +@@ -227,7 +228,7 @@ + # something went wrong + # : print the basic stats + print FP_HTML " <tr>\n <td>$host</td>\n"; +- $pingok = `$pingcmd -w 0 -q -c 1 $host`; ++ $pingok = `$pingcmd -q -c 1 $host`; + if( $pingok !~ m/1 packets received/ ) { + # machine is down! + if( defined($opt_v) ) { +@@ -255,8 +256,8 @@ + print FP_HTML " <td><center>No-D</center></td>\n"; + } + } # if pingok +- print FP_HTML " <td><img src=\"${meterimage}err.jpg\"></td>\n"; +- print FP_HTML " <td><img src=\"${meterimage}err.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}err.jpg\"></td>\n"; ++ print FP_HTML " <td><img src=\"${meterlocation}/${meterimage}err.jpg\"></td>\n"; + for($j=0;$j<scalar(@outputlist);$j++) { + print FP_HTML " <td>n/a</td>\n"; + } +@@ -270,7 +271,7 @@ + # HTML footer and close the file + print FP_HTML "</table>\n"; + print FP_HTML "<p>\n<hr>\n<p>\n"; +- print FP_HTML "<table border=true>\n <caption><b>Status</b></caption>\n"; ++ print FP_HTML "<table border=1>\n <caption><b>Status</b></caption>\n"; + print FP_HTML " <tr><td>UP</td><td>Machine is up and daemon is running</td></tr>\n"; + print FP_HTML " <tr><td>INIT</td><td>Machine is up and daemon is being initialized</td></tr>\n"; + print FP_HTML " <tr><td>No-D</td><td>Machine is up but no daemon is running</td></tr>\n"; +@@ -312,7 +313,11 @@ + push( @outputlist, @fld ); + } elsif( $_ =~ m/^heartbeat/i ) { + @fld = split( /=\s+/, $_ ); +- if( $fld[1] =~ m/m/i ) { ++ if( $fld[1] =~ m/s/i ) { ++ # time given in seconds ++ $heartbeat = $fld[1]; ++ $heartbeat =~ s/[Ss]//; ++ } elsif( $fld[1] =~ m/m/i ) { + # time given in minutes + $heartbeat = $fld[1]; + $heartbeat =~ s/[Mm]//; +@@ -332,6 +337,9 @@ + } elsif( $_ =~ m/^exelocation/i ) { + @fld = split( /=\s+/, $_ ); + $exelocation = $fld[1]; ++ } elsif( $_ =~ m/^meterlocation/i ) { ++ @fld = split( /=\s+/, $_ ); ++ $meterlocation = $fld[1]; + } elsif( $_ =~ m/^webimage1/i ) { + @fld = split( /=\s+/, $_ ); + $image1 = $fld[1]; +@@ -457,12 +465,13 @@ + @outputlist = (); + $heartbeat = 10*60; # heartbeat (in seconds) + $port = 7885; +- $exelocation = "/home/shiva/jpormann/webwatch"; +- $weblocation = "/home/shiva/jpormann/public_html"; ++ $exelocation = "/usr/bin"; ++ $weblocation = "/usr/share/httpd/htdocs/procstatd"; + $image1 = "duke.emblem.xbm"; + $image2 = $image1; + @webtext = (); + @weblink = (); ++ $meterlocation = "."; + $meterimage = "meter_"; + $meterround = 25; + $pingcmd = "/bin/ping"; diff --git a/cluster/procstatd/services b/cluster/procstatd/services new file mode 100644 index 0000000000..f319ca8687 --- /dev/null +++ b/cluster/procstatd/services @@ -0,0 +1 @@ +procstatd 7885/tcp # private procstatd connection diff --git a/cluster/procstatd/xinetd.d/procstatd b/cluster/procstatd/xinetd.d/procstatd new file mode 100755 index 0000000000..3c5d94abca --- /dev/null +++ b/cluster/procstatd/xinetd.d/procstatd @@ -0,0 +1,13 @@ +service procstatd +{ + socket_type = stream + protocol = tcp + wait = no + user = root + group = tty + server = /usr/sbin/procstatd + server_args = -i 7885 + log_type = FILE /var/log/xinetd/procstatd + log_on_success = PID HOST USERID EXIT DURATION + log_on_failure = USERID ATTEMPT +} |