From 6af535d5f62b6caea53b0b69cce5173cfd3d72a9 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 28 Jul 2010 15:57:32 +0000 Subject: [PATCH] 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 --- html/includes/graphs/generic_bits.inc.php | 2 +- html/includes/graphs/generic_multi_bits.inc.php | 2 +- html/includes/graphs/multiport/bits_duo.inc.php | 2 +- html/includes/graphs/multiport/bits_trio.inc.php | 2 +- includes/polling/os/screenos.inc.php | 7 +++---- includes/port-descr-parser.inc.php | 4 ++-- irc.php | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/html/includes/graphs/generic_bits.inc.php b/html/includes/graphs/generic_bits.inc.php index 12e283c8b9..6965cd301f 100644 --- a/html/includes/graphs/generic_bits.inc.php +++ b/html/includes/graphs/generic_bits.inc.php @@ -30,7 +30,7 @@ $rrd_options .= " VDEF:d95thout=doutbits,5,PERCENT"; $rrd_options .= " AREA:inbits_max#aDEB7B:"; $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 .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; diff --git a/html/includes/graphs/generic_multi_bits.inc.php b/html/includes/graphs/generic_multi_bits.inc.php index 1b050111dc..3106cdbb6e 100644 --- a/html/includes/graphs/generic_multi_bits.inc.php +++ b/html/includes/graphs/generic_multi_bits.inc.php @@ -31,7 +31,7 @@ if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } $rrd_options .= " LINE1.25:doutbits#".$colour_line_out.":"; } else { $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 .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; diff --git a/html/includes/graphs/multiport/bits_duo.inc.php b/html/includes/graphs/multiport/bits_duo.inc.php index 7dcede6890..8d92cf5da2 100644 --- a/html/includes/graphs/multiport/bits_duo.inc.php +++ b/html/includes/graphs/multiport/bits_duo.inc.php @@ -68,7 +68,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; } $rrd_options .= " LINE1.25:doutbits_tot#000099:"; $rrd_options .= " LINE0.5:nothing#555555:"; } 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 .= " GPRINT:inbitsb:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbitsb:AVERAGE:%6.2lf%s"; diff --git a/html/includes/graphs/multiport/bits_trio.inc.php b/html/includes/graphs/multiport/bits_trio.inc.php index 75307b83c9..e26b6c68d3 100644 --- a/html/includes/graphs/multiport/bits_trio.inc.php +++ b/html/includes/graphs/multiport/bits_trio.inc.php @@ -98,7 +98,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; } $rrd_options .= " LINE1:doutbitsb#000099:"; $rrd_options .= " LINE0.5:nothing#555555:"; } 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 .= " GPRINT:inbits:LAST:%6.2lf%s"; $rrd_options .= " GPRINT:inbits:AVERAGE:%6.2lf%s"; diff --git a/includes/polling/os/screenos.inc.php b/includes/polling/os/screenos.inc.php index 6beec5c473..08607baf49 100755 --- a/includes/polling/os/screenos.inc.php +++ b/includes/polling/os/screenos.inc.php @@ -14,8 +14,7 @@ $sess_data = shell_exec($sess_cmd); list ($sessalloc, $sessmax, $sessfailed) = explode("\n", $sess_data); if (!is_file($sessrrd)) { - `rrdtool create $sessrrd \ - --step 300 \ + shell_exec($config['rrdtool'] ." create $sessrrd --step 300 \ DS:allocate:GAUGE:600:0:3000000 \ DS:max:GAUGE:600:0:3000000 \ DS:failed:GAUGE:600:0:1000 \ @@ -26,9 +25,9 @@ if (!is_file($sessrrd)) { RRA:MAX:0.5:1:800 \ RRA:MAX:0.5:6: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"); ?> diff --git a/includes/port-descr-parser.inc.php b/includes/port-descr-parser.inc.php index d258507c15..4400f44109 100644 --- a/includes/port-descr-parser.inc.php +++ b/includes/port-descr-parser.inc.php @@ -22,9 +22,9 @@ $port_ifAlias['speed'] = $speed; $port_ifAlias['notes'] = $notes; -# if($debug) { + if($debug) { print_r($port_ifAlias); -# } + } } diff --git a/irc.php b/irc.php index b973083eb0..1d911f990f 100755 --- a/irc.php +++ b/irc.php @@ -42,7 +42,7 @@ class observiumbot $pps_out = format_bi($port['ifOutUcastPkts_rate']); $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"); } }