From: Stephen L Johnson Date: Tue, 28 Dec 1999 20:35:35 +0000 (+0000) Subject: General bug fixed and minor functional changes. X-Git-Tag: spong-2_6b~17 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b0026a9f77667bb2102e7bce765efb95d0f34c;p=spong.git General bug fixed and minor functional changes. --- diff --git a/contrib/plugins/spong-server/data_rrd_disk b/contrib/plugins/spong-server/data_rrd_disk index ad0f04c..3e0cac6 100755 --- a/contrib/plugins/spong-server/data_rrd_disk +++ b/contrib/plugins/spong-server/data_rrd_disk @@ -2,6 +2,7 @@ $DATAFUNCS{'rrd_disks'} = \&data_rrd_disks; use Data::Dumper; +use File::Basename; # Take the disk status messages and create rrd databases for each of # mount point. Skipping the @DFIGNORE mount points. @@ -24,7 +25,7 @@ sub data_rrd_disks { my( $line, $rawfs, $used, $pct, $name, %namemap, $target ); - &main::save_data('>', "$RRDDIR/$host/disk-name-map", ""); + &main::save_data('>', "$RRDDIR/$host/.rrd-disk", ""); foreach $line ( split(/\n/,$message) ) { if ( $line =~ m!^(\S+)\s.*\s(\d+)\s+\d+\s+(\d+)%\s+[^/]*(/.*)$! ) { @@ -76,10 +77,8 @@ sub data_rrd_disks { } -print Data::Dumper->Dump([\%namemap],['$namemap']); $line = ""; while(($k,$v) = (each %namemap)) { -print "\$k = $k, \$v = $v\n"; $line .= "$k:$v\n"; } diff --git a/contrib/plugins/spong-server/data_rrd_la b/contrib/plugins/spong-server/data_rrd_la index 6876177..35589ee 100755 --- a/contrib/plugins/spong-server/data_rrd_la +++ b/contrib/plugins/spong-server/data_rrd_la @@ -22,9 +22,9 @@ sub data_rrd_la { my( $line, $rawfs, $used, $pct, $name, %namemap, $target ); - &main::save_data('>', "$RRDDIR/$host/name-map", ""); + &main::save_data('>', "$RRDDIR/$host/.rrd-la", ""); - if ( $sum =~ m/load\s+=\s+([^, ]),\s+([\d]+)\s+users,\s+(\d+)/ ) { + if ( $sum =~ m/load\s+=\s+([^,]+),\s+([\d]+)\s+users,\s+(\d+)/ ) { ( $load, $users, $jobs ) = ( $1, $2, $3 ); # If .rrd file not found, built it @@ -36,14 +36,14 @@ sub data_rrd_la { eval { system "$RRDTOOL create $RRDDIR/$host/la.rrd " . "DS:loadavg:GAUGE:600:0:100 DS:users:GAUGE:600:0:U " . - "DS:GAUGE:600:0:U $RRAS"; + "DS:jobs:GAUGE:600:0:U $RRAS"; }; } if (@?) { &error("Error: rrdtool create: $@"); } } # Update the .rrd file - &debug("Updating $host $name rrd file"); + &debug("Updating $host Load Avg rrd file"); { local $SIG{'PIPE'} = 'IGNORE'; local $SIG{'CHLD'} = 'IGNORE';