mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
clean up polling source files, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1865 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if($device[os] != "Snom") {
|
||||
|
||||
if ($device['os'] != "Snom")
|
||||
{
|
||||
echo(" TCP");
|
||||
|
||||
$oids = array ('tcpActiveOpens', 'tcpPassiveOpens', 'tcpAttemptFails', 'tcpEstabResets', 'tcpCurrEstab',
|
||||
@@ -17,33 +17,36 @@ if($device[os] != "Snom") {
|
||||
$rrd_create = "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797";
|
||||
|
||||
foreach($oids as $oid){
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$oid_ds = truncate($oid, 19, '');
|
||||
$rrd_create .= " DS:$oid_ds:COUNTER:600:U:10000000"; ## Limit to 10MPPS
|
||||
$snmpstring .= " $oid.0";
|
||||
$snmpstring .= " $oid.0";
|
||||
}
|
||||
|
||||
$snmpstring .= " tcpHCInSegs.0";
|
||||
$snmpstring .= " tcpHCOutSegs.0";
|
||||
|
||||
$data = snmp_get_multi($device, $snmpstring);
|
||||
|
||||
|
||||
$rrdupdate = "N";
|
||||
|
||||
foreach($oids as $oid){
|
||||
if(is_numeric($data[0][$oid]))
|
||||
{
|
||||
$value = $data[0][$oid];
|
||||
} else {
|
||||
$value = "0";
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
if (is_numeric($data[0][$oid]))
|
||||
{
|
||||
$value = $data[0][$oid];
|
||||
} else {
|
||||
$value = "0";
|
||||
}
|
||||
$rrdupdate .= ":$value";
|
||||
}
|
||||
|
||||
unset($snmpstring);
|
||||
|
||||
if(isset($data[0]['tcpInSegs']) && isset($data[0]['tcpOutSegs'])) {
|
||||
if(!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); }
|
||||
if (isset($data[0]['tcpInSegs']) && isset($data[0]['tcpOutSegs']))
|
||||
{
|
||||
if (!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); }
|
||||
rrdtool_update($rrd_file, $rrdupdate);
|
||||
$graphs['netstat_tcp'] = TRUE;
|
||||
}
|
||||
@@ -51,4 +54,4 @@ if($device[os] != "Snom") {
|
||||
unset($oids, $data, $data_array, $oid, $protos);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user