some fixes, and cleanups, also bits per second not bytes ;)

git-svn-id: http://www.observium.org/svn/observer/trunk@1502 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-07-28 15:57:32 +00:00
parent 29f5afa472
commit 6af535d5f6
7 changed files with 10 additions and 11 deletions

View File

@ -30,7 +30,7 @@ $rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT";
$rrd_options .= " AREA:inbits_max#aDEB7B:"; $rrd_options .= " AREA:inbits_max#aDEB7B:";
$rrd_options .= " AREA:inbits#CDEB8B:"; $rrd_options .= " AREA:inbits#CDEB8B:";
$rrd_options .= " COMMENT:'BPS Now Ave Max 95th %\\n'"; $rrd_options .= " COMMENT:'bps Now Ave Max 95th %\\n'";
$rrd_options .= " LINE1.25:inbits#006600:'In '"; $rrd_options .= " LINE1.25:inbits#006600:'In '";
$rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s";

View File

@ -31,7 +31,7 @@ if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
$rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":"; $rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":";
} else { } else {
$rrd_options .= " AREA:inbits#".$colour_area_in.":"; $rrd_options .= " AREA:inbits#".$colour_area_in.":";
$rrd_options .= " COMMENT:BPS\ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Max\\\\n"; $rrd_options .= " COMMENT:bps\ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Max\\\\n";
$rrd_options .= " LINE1.25:inbits#".$colour_line_in.":In\ "; $rrd_options .= " LINE1.25:inbits#".$colour_line_in.":In\ ";
$rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s";

View File

@ -68,7 +68,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
$rrd_options .= " LINE1.25:doutbits_tot#000099:"; $rrd_options .= " LINE1.25:doutbits_tot#000099:";
$rrd_options .= " LINE0.5:nothing#555555:"; $rrd_options .= " LINE0.5:nothing#555555:";
} else { } else {
$rrd_options .= " COMMENT:BPS\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Min\ \ \ \ \ \ Max\\\\n"; $rrd_options .= " COMMENT:bps\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Min\ \ \ \ \ \ Max\\\\n";
$rrd_options .= " AREA:inbits_tot#cdeb8b:Peering\ In\ "; $rrd_options .= " AREA:inbits_tot#cdeb8b:Peering\ In\ ";
$rrd_options .= " GPRINT:inbitsb:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbitsb:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:inbitsb:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:inbitsb:AVERAGE:%6.2lf%s";

View File

@ -98,7 +98,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
$rrd_options .= " LINE1:doutbitsb#000099:"; $rrd_options .= " LINE1:doutbitsb#000099:";
$rrd_options .= " LINE0.5:nothing#555555:"; $rrd_options .= " LINE0.5:nothing#555555:";
} else { } else {
$rrd_options .= " COMMENT:BPS\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Min\ \ \ \ \ \ Max\\\\n"; $rrd_options .= " COMMENT:bps\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ Average\ \ \ \ \ \ Min\ \ \ \ \ \ Max\\\\n";
$rrd_options .= " AREA:inbits_tot#cdeb8b:ATM\ \ In\ "; $rrd_options .= " AREA:inbits_tot#cdeb8b:ATM\ \ In\ ";
$rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:LAST:%6.2lf%s";
$rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s";

View File

@ -14,8 +14,7 @@ $sess_data = shell_exec($sess_cmd);
list ($sessalloc, $sessmax, $sessfailed) = explode("\n", $sess_data); list ($sessalloc, $sessmax, $sessfailed) = explode("\n", $sess_data);
if (!is_file($sessrrd)) { if (!is_file($sessrrd)) {
`rrdtool create $sessrrd \ shell_exec($config['rrdtool'] ." create $sessrrd --step 300 \
--step 300 \
DS:allocate:GAUGE:600:0:3000000 \ DS:allocate:GAUGE:600:0:3000000 \
DS:max:GAUGE:600:0:3000000 \ DS:max:GAUGE:600:0:3000000 \
DS:failed:GAUGE:600:0:1000 \ DS:failed:GAUGE:600:0:1000 \
@ -26,9 +25,9 @@ if (!is_file($sessrrd)) {
RRA:MAX:0.5:1:800 \ RRA:MAX:0.5:1:800 \
RRA:MAX:0.5:6:800 \ RRA:MAX:0.5:6:800 \
RRA:MAX:0.5:24:800 \ RRA:MAX:0.5:24:800 \
RRA:MAX:0.5:288:800`; RRA:MAX:0.5:288:800");
} }
shell_exec($config['rrdtool'] . " update $sessrrd N:$sessalloc:$sessmax:$sessfailed"); rrdtool_update("$sessrrd", "N:$sessalloc:$sessmax:$sessfailed");
?> ?>

View File

@ -22,9 +22,9 @@
$port_ifAlias['speed'] = $speed; $port_ifAlias['speed'] = $speed;
$port_ifAlias['notes'] = $notes; $port_ifAlias['notes'] = $notes;
# if($debug) { if($debug) {
print_r($port_ifAlias); print_r($port_ifAlias);
# } }
} }

View File

@ -42,7 +42,7 @@ class observiumbot
$pps_out = format_bi($port['ifOutUcastPkts_rate']); $pps_out = format_bi($port['ifOutUcastPkts_rate']);
$irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, 'id' . $port['interface_id'] . " " . $port['ifAdminStatus'] . "/" . $port['ifOperStatus'] . " " . $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, 'id' . $port['interface_id'] . " " . $port['ifAdminStatus'] . "/" . $port['ifOperStatus'] . " " .
$bps_in. " > BPS > " . $bps_out . " | " . $pps_in. "pps > PPS > " . $pps_out ."pps"); $bps_in. " > bps > " . $bps_out . " | " . $pps_in. "pps > PPS > " . $pps_out ."pps");
} }
} }