$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.
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+[^/]*(/.*)$! ) {
}
-print Data::Dumper->Dump([\%namemap],['$namemap']);
$line = "";
while(($k,$v) = (each %namemap)) {
-print "\$k = $k, \$v = $v\n";
$line .= "$k:$v\n";
}
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
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';