diff --git a/includes/discovery/current/apc.inc.php b/includes/discovery/current/apc.inc.php index 4dfe087bf..102da3ad0 100644 --- a/includes/discovery/current/apc.inc.php +++ b/includes/discovery/current/apc.inc.php @@ -40,7 +40,7 @@ if ($device['os'] == "apc") { $descr = "Output"; } - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); } } @@ -60,7 +60,7 @@ if ($device['os'] == "apc") $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! $descr = "Output Feed"; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); } } diff --git a/includes/discovery/current/gamatronicups.inc.php b/includes/discovery/current/gamatronicups.inc.php index 04baa647e..058ecffd3 100644 --- a/includes/discovery/current/gamatronicups.inc.php +++ b/includes/discovery/current/gamatronicups.inc.php @@ -16,7 +16,7 @@ if ($device['os'] == "gamatronicups") $warnlimit = NULL; $limit = NULL; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current); } for ($i = 1; $i <= 3; $i++) @@ -31,7 +31,7 @@ if ($device['os'] == "gamatronicups") $warnlimit = NULL; $limit = NULL; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current); } } diff --git a/includes/discovery/current/ipoman.inc.php b/includes/discovery/current/ipoman.inc.php index 3c3fe93a3..f44f1f590 100644 --- a/includes/discovery/current/ipoman.inc.php +++ b/includes/discovery/current/ipoman.inc.php @@ -40,7 +40,7 @@ if ($device['os'] == "ipoman") $descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') : "Inlet $index"); $current = $entry['inletStatusCurrent'] / $divisor; $high_limit = $entry['inletConfigCurrentHigh'] / 10; - echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current); # FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf? } } @@ -54,7 +54,7 @@ if ($device['os'] == "ipoman") $descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'],'"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'],'"') : "Output $index"); $current = $entry['outletStatusCurrent'] / $divisor; $high_limit = $entry['outletConfigCurrentHigh'] / 10; - echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current); } } } diff --git a/includes/discovery/current/mgeups.inc.php b/includes/discovery/current/mgeups.inc.php index 15fc7cb16..5e3377b55 100644 --- a/includes/discovery/current/mgeups.inc.php +++ b/includes/discovery/current/mgeups.inc.php @@ -29,7 +29,7 @@ if ($device['os'] == "mgeups") $limit = NULL; $lowwarnlimit = NULL; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); @@ -55,7 +55,7 @@ if ($device['os'] == "mgeups") $limit = NULL; $lowwarnlimit = NULL; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current); } } diff --git a/includes/discovery/current/rfc1628.inc.php b/includes/discovery/current/rfc1628.inc.php index 4d2d80e8e..1ce63940f 100644 --- a/includes/discovery/current/rfc1628.inc.php +++ b/includes/discovery/current/rfc1628.inc.php @@ -25,7 +25,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $index = 500+$current_id; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current); } } @@ -41,7 +41,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $precision = 1; $index = $i; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU")); @@ -56,7 +56,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $precision = 1; $index = 100+$i; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU")); @@ -71,7 +71,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $precision = 1; $index = 200+$i; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } diff --git a/includes/discovery/current/xups.inc.php b/includes/discovery/current/xups.inc.php index 7242ac6b4..1d8dfa727 100644 --- a/includes/discovery/current/xups.inc.php +++ b/includes/discovery/current/xups.inc.php @@ -25,7 +25,7 @@ if ($device['os'] == "powerware") $type = "xups"; $index = "1.2.3.".$current_id; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } @@ -41,7 +41,7 @@ if ($device['os'] == "powerware") $divisor = 1; $index = "4.4.1.3.".$i; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "xupsInputCurrent", "-OsqnU", "XUPS-MIB")); @@ -56,7 +56,7 @@ if ($device['os'] == "powerware") $divisor = 1; $index = "3.4.1.3.".$i; - echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } diff --git a/includes/discovery/fanspeeds/areca.inc.php b/includes/discovery/fanspeeds/areca.inc.php index fd82ed817..f29f3f83c 100644 --- a/includes/discovery/fanspeeds/areca.inc.php +++ b/includes/discovery/fanspeeds/areca.inc.php @@ -3,24 +3,25 @@ global $valid_sensor; ## Areca Fanspeeds -if ($device['os'] == "areca") +if ($device['os'] == "areca") { $oids = snmp_walk($device, "1.3.6.1.4.1.18928.1.2.2.1.9.1.2", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } if ($oids) echo("Areca "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); $index = $split_oid[count($split_oid)-1]; $oid = "1.3.6.1.4.1.18928.1.2.2.1.9.1.3." . $index; $current = snmp_get($device, $oid, "-Oqv", ""); + discover_sensor($valid_sensor, 'fanspeed', $device, $oid, $index, 'areca', trim($descr,'"'), '1', '1', NULL, NULL, NULL, NULL, $current); } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/fanspeeds/lmsensors.inc.php b/includes/discovery/fanspeeds/lmsensors.inc.php index 7a14808b9..0b2891516 100644 --- a/includes/discovery/fanspeeds/lmsensors.inc.php +++ b/includes/discovery/fanspeeds/lmsensors.inc.php @@ -3,16 +3,16 @@ global $valid_sensor; ## LMSensors Fanspeeds -if ($device['os'] == "linux") +if ($device['os'] == "linux") { $oids = snmp_walk($device, "lmFanSensorsDevice", "-OsqnU", "LM-SENSORS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("LM-SENSORS "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -20,11 +20,12 @@ if ($device['os'] == "linux") $oid = "1.3.6.1.4.1.2021.13.16.3.1.3.". $index; $current = snmp_get($device, $oid, "-Oqv", "LM-SENSORS-MIB"); $descr = trim(str_ireplace("fan-", "", $descr)); - if($current > '0') { + if ($current > '0') + { discover_sensor($valid_sensor, 'fanspeed', $device, $oid, $index, 'lmsensors', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/fanspeeds/supermicro.inc.php b/includes/discovery/fanspeeds/supermicro.inc.php index 3c07a7d28..cf5e800da 100644 --- a/includes/discovery/fanspeeds/supermicro.inc.php +++ b/includes/discovery/fanspeeds/supermicro.inc.php @@ -3,16 +3,16 @@ global $valid_sensor; ## Supermicro Fanspeeds -if ($device['os'] == "linux") +if ($device['os'] == "linux") { $oids = snmp_walk($device, "1.3.6.1.4.1.10876.2.1.1.1.1.3", "-OsqnU", "SUPERMICRO-HEALTH-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("Supermicro "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$kind) = explode(" ", $data); $split_oid = explode('.',$oid); @@ -32,7 +32,7 @@ if ($device['os'] == "linux") $divisor = "1"; $monitor = snmp_get($device, $monitor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB"); $descr = str_replace(' Fan Speed','',$descr); - $descr = str_replace(' Speed','',$descr); + $descr = str_replace(' Speed','',$descr); if ($monitor == 'true') { discover_sensor($valid_sensor, 'fanspeed', $device, $fan_oid, $index, 'supermicro', $descr, $divisor, '1', $low_limit, NULL, NULL, NULL, $current); @@ -42,4 +42,4 @@ if ($device['os'] == "linux") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/frequencies/apc.inc.php b/includes/discovery/frequencies/apc.inc.php index c8d8db877..71a25b257 100644 --- a/includes/discovery/frequencies/apc.inc.php +++ b/includes/discovery/frequencies/apc.inc.php @@ -3,17 +3,17 @@ global $valid_sensor; ## APC -if ($device['os'] == "apc") +if ($device['os'] == "apc") { $oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.8.5.3.2.1.4", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } if ($oids) echo("APC In "); $divisor = 1; $type = "apc"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$current) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -29,10 +29,10 @@ if ($device['os'] == "apc") if ($oids) echo(" APC Out "); $divisor = 1; $type = "apc"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$current) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -69,4 +69,5 @@ if ($device['os'] == "apc") discover_sensor($valid_sensor, 'freq', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/frequencies/ipoman.inc.php b/includes/discovery/frequencies/ipoman.inc.php index 952b10633..07d0f02ee 100644 --- a/includes/discovery/frequencies/ipoman.inc.php +++ b/includes/discovery/frequencies/ipoman.inc.php @@ -7,8 +7,8 @@ if ($device['os'] == "ipoman") { echo(" IPOMANII-MIB "); - if(!is_array($cache['ipoman'])) - { + if (!is_array($cache['ipoman'])) + { echo("outletConfigDesc "); $cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB"); echo("outletConfigLocation "); @@ -26,9 +26,9 @@ if ($device['os'] == "ipoman") echo("inletStatusFrequency "); $oids = snmpwalk_cache_multi_oid($device, "inletStatusFrequency", $oids, "IPOMANII-MIB"); - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $freq_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.4.' . $index; $divisor = 10; @@ -36,9 +36,10 @@ if ($device['os'] == "ipoman") $current = $entry['inletStatusFrequency'] / 10; $low_limit = $entry['inletConfigFrequencyLow']; $high_limit = $entry['inletConfigFrequencyHigh']; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current); # FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf? } } } + ?> \ No newline at end of file diff --git a/includes/discovery/frequencies/mgeups.inc.php b/includes/discovery/frequencies/mgeups.inc.php index 788ada4ec..e10d46e09 100644 --- a/includes/discovery/frequencies/mgeups.inc.php +++ b/includes/discovery/frequencies/mgeups.inc.php @@ -3,7 +3,7 @@ global $valid_sensor; ## MGE UPS Frequencies -if ($device['os'] == "mgeups") +if ($device['os'] == "mgeups") { echo("MGE "); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); @@ -23,7 +23,7 @@ if ($device['os'] == "mgeups") $type = "mge-ups"; $divisor = 10; $index = $i; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); if ($debug) { echo($oids."\n"); } @@ -42,7 +42,8 @@ if ($device['os'] == "mgeups") $type = "mge-ups"; $divisor = 10; $index = 100+$i; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/frequencies/rfc1628.inc.php b/includes/discovery/frequencies/rfc1628.inc.php index 33b570cbb..db45f2683 100644 --- a/includes/discovery/frequencies/rfc1628.inc.php +++ b/includes/discovery/frequencies/rfc1628.inc.php @@ -3,10 +3,10 @@ global $valid_sensor; ## RFC1628 -if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") +if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") { echo("RFC1628 "); - + $oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU")); if ($debug) { echo($oids."\n"); } list($unused,$numPhase) = explode(' ',$oids); @@ -18,7 +18,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $divisor = 10; $index = '3.2.0.'.$i; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $freq_oid = "1.3.6.1.2.1.33.1.4.2.0"; @@ -27,7 +27,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $divisor = 10; $index = '4.2.0'; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); $freq_oid = "1.3.6.1.2.1.33.1.5.1.0"; $descr = "Bypass"; @@ -35,6 +35,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $type = "rfc1628"; $divisor = 10; $index = '5.1.0'; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/frequencies/xups.inc.php b/includes/discovery/frequencies/xups.inc.php index 1cc3b323c..aaae3cc13 100644 --- a/includes/discovery/frequencies/xups.inc.php +++ b/includes/discovery/frequencies/xups.inc.php @@ -6,9 +6,9 @@ global $valid_sensor; if ($device['os'] == "powerware") { echo("XUPS-MIB "); - + # I'm not sure if there is provision for frequency of multiple phases in this MIB -TL - + # XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500 $freq_oid = ".1.3.6.1.4.1.534.1.3.1.0"; $descr = "Input"; @@ -16,7 +16,7 @@ if ($device['os'] == "powerware") $current = snmp_get($device, $freq_oid, "-Oqv") / $divisor; $type = "xups"; $index = '3.1.0'; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); # XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500 $freq_oid = "1.3.6.1.4.1.534.1.4.2.0"; @@ -25,7 +25,7 @@ if ($device['os'] == "powerware") $current = snmp_get($device, $freq_oid, "-Oqv") / $divisor; $type = "xups"; $index = '4.2.0'; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); # XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500 $freq_oid = "1.3.6.1.4.1.534.1.5.1.0"; @@ -38,7 +38,8 @@ if ($device['os'] == "powerware") $current /= $divisor; $type = "xups"; $index = '5.1.0'; - echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/adva.inc.php b/includes/discovery/temperatures/adva.inc.php index 608358413..6fd0fd4d1 100755 --- a/includes/discovery/temperatures/adva.inc.php +++ b/includes/discovery/temperatures/adva.inc.php @@ -21,9 +21,9 @@ Disabled needing rewrite $temperature_hss1 = trim(shell_exec($config['snmpget'] . " -M " . $config['mibdir'] . " -O qv -$snmpver -c $community $hostname:$port $oid_hss1")); $temperature_hss2 = trim(shell_exec($config['snmpget'] . " -M " . $config['mibdir'] . " -O qv -$snmpver -c $community $hostname:$port $oid_hss2")); echo("Adva Chassis "); - if($temperature_chassis != "0") + if ($temperature_chassis != "0") { - if(mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_chassis' AND temperature_host = '$id'"),0) == '0') + if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_chassis' AND temperature_host = '$id'"),0) == '0') { $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_chassis', '$descr_chassis',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_chassis')"; mysql_query($query); @@ -37,9 +37,9 @@ Disabled needing rewrite $temperature_exists[] = "$id $oid_chassis"; } echo("STM16 "); - if($temperature_stm16 != "0") + if ($temperature_stm16 != "0") { - if(mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_stm16' AND temperature_host = '$id'"),0) == '0') + if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_stm16' AND temperature_host = '$id'"),0) == '0') { $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_stm16', '$descr_stm16',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_stm16')"; mysql_query($query); @@ -53,9 +53,9 @@ Disabled needing rewrite $temperature_exists[] = "$id $oid_stm16"; } echo("HSS1 "); - if($temperature_hss1 != "0") + if ($temperature_hss1 != "0") { - if(mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_hss1' AND temperature_host = '$id'"),0) == '0') + if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_hss1' AND temperature_host = '$id'"),0) == '0') { $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_hss1', '$descr_hss1',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_hss1')"; mysql_query($query); @@ -69,9 +69,9 @@ Disabled needing rewrite $temperature_exists[] = "$id $oid_hss1"; } echo("HSS2 "); - if($temperature_hss2 != "0") + if ($temperature_hss2 != "0") { - if(mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_hss2' AND temperature_host = '$id'"),0) == '0') + if (mysql_result(mysql_query("SELECT count(temperature_id) FROM `temperature` WHERE temperature_oid = '$oid_hss2' AND temperature_host = '$id'"),0) == '0') { $query = "INSERT INTO temperature (`temperature_host`, `temperature_oid`, `temperature_descr`, `temperature_precision`, `temperature_limit`, `temperature_current`) values ('$id', '$oid_hss2', '$descr_hss2',1," . ($config['defaults']['temperature_limit'] ? $config['defaults']['temperature_limit'] : '60') . ", '$temperature_hss2')"; mysql_query($query); diff --git a/includes/discovery/temperatures/akcp.inc.php b/includes/discovery/temperatures/akcp.inc.php index 10800a61e..69284e6f9 100644 --- a/includes/discovery/temperatures/akcp.inc.php +++ b/includes/discovery/temperatures/akcp.inc.php @@ -8,7 +8,7 @@ if ($device['os'] == "akcp" || $device['os'] == "minkelsrms") if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("AKCP "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -38,4 +38,4 @@ if ($device['os'] == "akcp" || $device['os'] == "minkelsrms") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/apc.inc.php b/includes/discovery/temperatures/apc.inc.php index 4edfe880c..cdba73c46 100644 --- a/includes/discovery/temperatures/apc.inc.php +++ b/includes/discovery/temperatures/apc.inc.php @@ -2,7 +2,7 @@ global $valid_sensor; -if ($device['os'] == "apc") +if ($device['os'] == "apc") { $oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.1.2.2.2.0", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } @@ -14,8 +14,9 @@ if ($device['os'] == "apc") $type = "apc"; $index = 0; $descr = "Internal Temperature"; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'apc', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/areca.inc.php b/includes/discovery/temperatures/areca.inc.php index f82f8fdc1..f97e40f0a 100644 --- a/includes/discovery/temperatures/areca.inc.php +++ b/includes/discovery/temperatures/areca.inc.php @@ -2,13 +2,13 @@ global $valid_sensor; -if ($device['os'] == "areca") +if ($device['os'] == "areca") { $oids = snmp_walk($device, "1.3.6.1.4.1.18928.1.1.2.14.1.2", "-Osqn", ""); if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("Areca Harddisk "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -31,7 +31,7 @@ if ($device['os'] == "areca") if ($oids) echo("Areca Controller "); $precision = 1; $type = "areca"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -41,9 +41,10 @@ if ($device['os'] == "areca") $index = $split_oid[count($split_oid)-1]; $oid = "1.3.6.1.4.1.18928.1.2.2.1.10.1.3." . $index; $current = snmp_get($device, $oid, "-Oqv", ""); + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'areca', trim($descr,'"'), '1', '1', NULL, NULL, NULL, NULL, $current); } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/cisco-envmon.inc.php b/includes/discovery/temperatures/cisco-envmon.inc.php index 98b3ff03c..2184da747 100644 --- a/includes/discovery/temperatures/cisco-envmon.inc.php +++ b/includes/discovery/temperatures/cisco-envmon.inc.php @@ -3,13 +3,13 @@ global $valid_sensor; global $entity_temperature; -if (mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = '".$device['device_id']."' AND `sensor_class` = 'temperature' AND (`sensor_type` = 'cisco-entity-sensor' OR `sensor_type` = 'entity-sensor')"),0) == "0" && ($device['os'] == "ios" || $device['os_group'] == "ios")) +if (mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = '".$device['device_id']."' AND `sensor_class` = 'temperature' AND (`sensor_type` = 'cisco-entity-sensor' OR `sensor_type` = 'entity-sensor')"),0) == "0" && ($device['os'] == "ios" || $device['os_group'] == "ios")) { echo("Cisco "); $oids = snmp_walk($device, ".1.3.6.1.4.1.9.9.13.1.3.1.2", "-Osqn", "CISCO-ENVMON-MIB"); $oids = str_replace('.1.3.6.1.4.1.9.9.13.1.3.1.2.','',$oids); $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -25,10 +25,11 @@ if (mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = $descr = str_replace("temperature", "", $descr); $descr = str_replace("temperature", "", $descr); $descr = trim($descr); + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'cisco', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/dell.inc.php b/includes/discovery/temperatures/dell.inc.php index 7d16b6134..6e43949e9 100644 --- a/includes/discovery/temperatures/dell.inc.php +++ b/includes/discovery/temperatures/dell.inc.php @@ -1,5 +1,5 @@ +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/ftos-c-series.inc.php b/includes/discovery/temperatures/ftos-c-series.inc.php index af4cbacf0..2fd9a8d71 100644 --- a/includes/discovery/temperatures/ftos-c-series.inc.php +++ b/includes/discovery/temperatures/ftos-c-series.inc.php @@ -9,26 +9,25 @@ global $valid_sensor; #F10-C-SERIES-CHASSIS-MIB::chSysCardTemp.1 = Gauge32: 25 #F10-C-SERIES-CHASSIS-MIB::chSysCardTemp.2 = Gauge32: 26 -if ($device['os'] == "ftos" || $device['os_group'] == "ftos") +if ($device['os'] == "ftos" || $device['os_group'] == "ftos") { echo("FTOS C-Series "); $oids = snmpwalk_cache_oid($device, "chSysCardTemp", array(), "F10-C-SERIES-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" ); - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $descr = "Slot ".$index; $oid = ".1.3.6.1.4.1.6027.3.8.1.2.1.1.5.".$index; $current = $entry['chSysCardTemp']; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-cseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } unset($oids); - } - -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/ftos-e-series.inc.php b/includes/discovery/temperatures/ftos-e-series.inc.php index f9f5d00a7..b074bf113 100644 --- a/includes/discovery/temperatures/ftos-e-series.inc.php +++ b/includes/discovery/temperatures/ftos-e-series.inc.php @@ -11,26 +11,25 @@ global $valid_sensor; #F10-CHASSIS-MIB::chSysCardUpperTemp.3 = Gauge32: 34 #F10-CHASSIS-MIB::chSysCardUpperTemp.4 = Gauge32: 34 -if ($device['os'] == "ftos" || $device['os_group'] == "ftos") +if ($device['os'] == "ftos" || $device['os_group'] == "ftos") { echo("FTOS E-Series "); $oids = snmpwalk_cache_oid($device, "chSysCardUpperTemp", array(), "F10-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" ); - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $descr = "Slot ".$index; $oid = ".1.3.6.1.4.1.6027.3.1.1.2.3.1.8.".$index; $current = $entry['chSysCardUpperTemp']; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-eseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } unset($oids); - } - -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/ftos-s-series.inc.php b/includes/discovery/temperatures/ftos-s-series.inc.php index 3927ed5e5..bb5c1a639 100644 --- a/includes/discovery/temperatures/ftos-s-series.inc.php +++ b/includes/discovery/temperatures/ftos-s-series.inc.php @@ -7,28 +7,26 @@ global $valid_sensor; #F10-S-SERIES-CHASSIS-MIB::chStackUnitTemp.1 = Gauge32: 47 #F10-S-SERIES-CHASSIS-MIB::chStackUnitModelID.1 = STRING: S25-01-GE-24V -if ($device['os'] == "ftos" || $device['os_group'] == "ftos") +if ($device['os'] == "ftos" || $device['os_group'] == "ftos") { echo("FTOS C-Series "); $oids = snmpwalk_cache_oid($device, "chStackUnitTemp", array(), "F10-S-SERIES-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" ); $oids = snmpwalk_cache_oid($device, "chStackUnitSysType", $oids, "F10-S-SERIES-CHASSIS-MIB", $config['mib_dir'].":".$config['mib_dir']."/ftos" ); - - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $descr = "Unit ".$index . " " . $entry['chStackUnitSysType']; $oid = ".1.3.6.1.4.1.6027.3.10.1.2.2.1.14.".$index; $current = $entry['chStackUnitTemp']; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'ftos-sseries', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } unset($oids); - } - -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/ipoman.inc.php b/includes/discovery/temperatures/ipoman.inc.php index 2b256060a..52327e894 100644 --- a/includes/discovery/temperatures/ipoman.inc.php +++ b/includes/discovery/temperatures/ipoman.inc.php @@ -1,11 +1,11 @@ +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/ironware.inc.php b/includes/discovery/temperatures/ironware.inc.php index 286dd45a0..3e5eed063 100644 --- a/includes/discovery/temperatures/ironware.inc.php +++ b/includes/discovery/temperatures/ironware.inc.php @@ -2,13 +2,13 @@ global $valid_sensor; -if($device['os'] == "ironware") +if ($device['os'] == "ironware") { echo("IronWare "); $oids = snmp_walk($device,"snAgentTempSensorDescr","-Osqn","FOUNDRY-SN-AGENT-MIB:FOUNDRY-SN-ROOT-MIB"); $oids = trim($oids); $oids = str_replace(".1.3.6.1.4.1.1991.1.1.2.13.1.1.3.", "", $oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data != "") @@ -29,7 +29,7 @@ if($device['os'] == "ironware") $descr = str_replace("Active management module", "Mgmt Module", $descr); $descr = str_replace(" ", " ", $descr); $descr = trim($descr); - + $current = $temperature / 2; discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $oid, 'ironware', $descr, '2', '1', NULL, NULL, NULL, NULL, $current); @@ -38,4 +38,4 @@ if($device['os'] == "ironware") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/junos.inc.php b/includes/discovery/temperatures/junos.inc.php index 45713da51..8c9a1900e 100644 --- a/includes/discovery/temperatures/junos.inc.php +++ b/includes/discovery/temperatures/junos.inc.php @@ -7,7 +7,7 @@ if ($device['os'] == "junos" || $device['os_group'] == "junos") echo("JunOS "); $oids = snmp_walk($device,"1.3.6.1.4.1.2636.3.1.13.1.7","-Osqn","JUNIPER-MIB", $config['install_dir']."/mibs/junos"); $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); $data = substr($data, 29); @@ -25,10 +25,11 @@ if ($device['os'] == "junos" || $device['os_group'] == "junos") $descr = str_replace("temperature", "", $descr); $descr = str_replace("sensor", "", $descr); $descr = trim($descr); + discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $oid, 'junos', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/junose.inc.php b/includes/discovery/temperatures/junose.inc.php index 8ab5b32b8..ded7ad0b8 100644 --- a/includes/discovery/temperatures/junose.inc.php +++ b/includes/discovery/temperatures/junose.inc.php @@ -8,11 +8,11 @@ if ($device['os'] == "junose") { echo("JunOSe: "); $oids = snmpwalk_cache_multi_oid($device, "juniSystemTempValue", array(), "Juniper-System-MIB", $config['install_dir']."/mibs/junose"); - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { - if(is_numeric($entry['juniSystemTempValue']) && is_numeric($index) && $entry['juniSystemTempValue'] > "0") + if (is_numeric($entry['juniSystemTempValue']) && is_numeric($index) && $entry['juniSystemTempValue'] > "0") { $entPhysicalIndex = snmp_get($device, "juniSystemTempPhysicalIndex.".$index, "-Oqv", "Juniper-System-MIB", "+".$config['install_dir']."/mibs/junose"); $descr = snmp_get($device, "entPhysicalDescr.".$entPhysicalIndex, "-Oqv", "ENTITY-MIB"); @@ -20,10 +20,11 @@ if ($device['os'] == "junose") $descr = str_replace("temperature sensor on", "", trim($descr)); $oid = ".1.3.6.1.4.1.4874.2.2.2.1.9.4.1.3.".$index; $current = $entry['juniSystemTempValue']; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'junose', $descr, '1', '1', NULL, NULL, NULL, NULL, $current); } } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/lm-sensors.inc.php b/includes/discovery/temperatures/lm-sensors.inc.php index fdb36fc5c..8e1346833 100644 --- a/includes/discovery/temperatures/lm-sensors.inc.php +++ b/includes/discovery/temperatures/lm-sensors.inc.php @@ -8,7 +8,7 @@ if ($device['os'] == "linux") if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("LM-SENSORS "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -21,7 +21,7 @@ if ($device['os'] == "linux") $descr = str_ireplace("temperature-", "", $descr); $descr = str_ireplace("temp-", "", $descr); $descr = trim($descr); - if($temperature != "0" && $temperature <= "1000") + if ($temperature != "0" && $temperature <= "1000") { discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'lmsensors', $descr, '1000', '1', NULL, NULL, NULL, NULL, $temperature); } @@ -29,4 +29,4 @@ if ($device['os'] == "linux") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/observernms-custom.inc.php b/includes/discovery/temperatures/observernms-custom.inc.php index b398ba9e3..6f4fdd309 100644 --- a/includes/discovery/temperatures/observernms-custom.inc.php +++ b/includes/discovery/temperatures/observernms-custom.inc.php @@ -2,14 +2,14 @@ global $valid_sensor; -if($device['os_group'] == "unix") +if ($device['os_group'] == "unix") { # FIXME snmp_walk # ObserverNMS-style temperature $oids = shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -CI -c ".$device['community']." ".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891 | sed s/.1.3.6.1.4.1.2021.7891.// | grep '.1.1 ' | grep -v '.101.' | cut -d'.' -f 1"); $oids = trim($oids); if ($oids) echo("Observer-Style "); - foreach(explode("\n",$oids) as $oid) + foreach (explode("\n",$oids) as $oid) { $oid = trim($oid); if ($oid != "") @@ -23,4 +23,4 @@ if($device['os_group'] == "unix") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/papouch-tme.inc.php b/includes/discovery/temperatures/papouch-tme.inc.php index a71f746c6..249a719a8 100644 --- a/includes/discovery/temperatures/papouch-tme.inc.php +++ b/includes/discovery/temperatures/papouch-tme.inc.php @@ -2,7 +2,7 @@ global $valid_sensor; -if ($device['os'] == "papouch-tme") +if ($device['os'] == "papouch-tme") { echo("Papouch TME "); @@ -17,4 +17,4 @@ if ($device['os'] == "papouch-tme") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/powerconnect.inc.php b/includes/discovery/temperatures/powerconnect.inc.php index 514abda9a..8594f6026 100644 --- a/includes/discovery/temperatures/powerconnect.inc.php +++ b/includes/discovery/temperatures/powerconnect.inc.php @@ -2,7 +2,7 @@ global $valid_sensor; -if ($device['os'] == "powerconnect") +if ($device['os'] == "powerconnect") { $oids = snmp_get($device, ".1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.4.0", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } @@ -15,8 +15,9 @@ if ($device['os'] == "powerconnect") $type = "powerconnect"; $index = "0"; $descr = "Internal Temperature"; + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, $type, $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current); } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/rfc1628.inc.php b/includes/discovery/temperatures/rfc1628.inc.php index 5185b7115..c7f6e4726 100644 --- a/includes/discovery/temperatures/rfc1628.inc.php +++ b/includes/discovery/temperatures/rfc1628.inc.php @@ -2,13 +2,13 @@ global $valid_sensor; -if($device['os'] == "netmanplus" || $device['os'] == 'deltaups') +if ($device['os'] == "netmanplus" || $device['os'] == 'deltaups') { $oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.7", "-Osqn", "UPS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("RFC1628 Battery Temperature "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -19,9 +19,10 @@ if($device['os'] == "netmanplus" || $device['os'] == 'deltaups') $temperature_oid = "1.3.6.1.2.1.33.1.2.7.$temperature_id"; $temperature = snmp_get($device, $temperature_oid, "-Ovq"); $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1)); + discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'rfc1628', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature); } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/supermicro.inc.php b/includes/discovery/temperatures/supermicro.inc.php index 4b25cd06a..96481d2d8 100644 --- a/includes/discovery/temperatures/supermicro.inc.php +++ b/includes/discovery/temperatures/supermicro.inc.php @@ -2,13 +2,13 @@ global $valid_sensor; -if($device['os'] == "linux") +if ($device['os'] == "linux") { # Supermicro sensors $oids = snmp_walk($device, "1.3.6.1.4.1.10876.2.1.1.1.1.3", "-Osqn", "SUPERMICRO-HEALTH-MIB"); $oids = trim($oids); if ($oids) echo("Supermicro "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -38,4 +38,4 @@ if($device['os'] == "linux") } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/xups.inc.php b/includes/discovery/temperatures/xups.inc.php index 9487aff1c..041612419 100644 --- a/includes/discovery/temperatures/xups.inc.php +++ b/includes/discovery/temperatures/xups.inc.php @@ -2,7 +2,7 @@ global $valid_sensor; -if($device['os'] == "powerware") +if ($device['os'] == "powerware") { # XUPS-MIB::xupsEnvAmbientTemp.0 = INTEGER: 52 # XUPS-MIB::xupsEnvAmbientLowerLimit.0 = INTEGER: 0 @@ -11,7 +11,7 @@ if($device['os'] == "powerware") if ($debug) { echo($oids."\n"); } $oids = trim($oids); if ($oids) echo("Powerware Ambient Temperature "); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); if ($data) @@ -24,9 +24,10 @@ if($device['os'] == "powerware") $highlimit = snmp_get($device,"upsEnvAmbientUpperLimit.$temperature_id", "-Ovq", "XUPS-MIB"); $temperature = snmp_get($device, $temperature_oid, "-Ovq"); $descr = "Ambient" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1)); + discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, '1.6.1.'.$temperature_id, 'powerware', $descr, '1', '1', $lowlimit, NULL, NULL, $highlimit, $temperature); } } } -?> +?> \ No newline at end of file diff --git a/includes/discovery/temperatures/zyxel-ies.inc.php b/includes/discovery/temperatures/zyxel-ies.inc.php index fa57949b5..aa01c5c2c 100644 --- a/includes/discovery/temperatures/zyxel-ies.inc.php +++ b/includes/discovery/temperatures/zyxel-ies.inc.php @@ -4,25 +4,25 @@ global $valid_sensor; if ($device['os'] == 'ies') { - echo("ZyXEL IES "); - - $oids = array(); - + + $oids = array(); + $oids = snmpwalk_cache_multi_oid($device, "accessSwitchSysTempCurValue", $oids, "ZYXEL-AS-MIB"); $oids = snmpwalk_cache_multi_oid($device, "accessSwitchSysTempHighThresh", $oids, "ZYXEL-AS-MIB"); - - if(is_array($oids)) + + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $entPhysicalIndex = $index; $descr = trim(snmp_get($device, "accessSwitchSysTempDescr.".$index, "-Oqv", "ZYXEL-AS-MIB"),'"'); $oid = ".1.3.6.1.4.1.890.1.5.1.1.6.1.2.".$index; $current = $entry['accessSwitchSysTempCurValue']; $divisor = '1'; - discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'zyxel-ies', $descr, '1', '1', NULL, $entry['accessSwitchSysTempHighThresh'], NULL, NULL, $current); + discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'zyxel-ies', $descr, '1', '1', NULL, $entry['accessSwitchSysTempHighThresh'], NULL, NULL, $current); } } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/voltages/apc.inc.php b/includes/discovery/voltages/apc.inc.php index d846af41f..9eeff5aa4 100644 --- a/includes/discovery/voltages/apc.inc.php +++ b/includes/discovery/voltages/apc.inc.php @@ -3,25 +3,25 @@ global $valid_sensor; ## APC Voltages -if ($device['os'] == "apc") +if ($device['os'] == "apc") { $oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.8.5.3.3.1.3", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } if ($oids) echo("APC In "); $divisor = 1; $type = "apc"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$current) = explode(" ", $data,2); $split_oid = explode('.',$oid); $index = $split_oid[count($split_oid)-3]; $oid = "1.3.6.1.4.1.318.1.1.8.5.3.3.1.3." . $index . ".1.1"; $descr = "Input Feed " . chr(64+$index); - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, "3.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'voltage', $device, $oid, "3.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } @@ -30,17 +30,18 @@ if ($device['os'] == "apc") if ($oids) echo(" APC Out "); $divisor = 1; $type = "apc"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$current) = explode(" ", $data,2); $split_oid = explode('.',$oid); $index = $split_oid[count($split_oid)-3]; $oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.3." . $index . ".1.1"; $descr = "Output Feed"; if (count(explode("\n", $oids)) > 1) { $descr .= " $index"; } - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, "4.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $oid, "4.3.1.3.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } @@ -54,7 +55,8 @@ if ($device['os'] == "apc") $type = "apc"; $index = "3.2.1.0"; $descr = "Input"; - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.1.4.2.1.0", "-OsqnU", ""); @@ -67,7 +69,9 @@ if ($device['os'] == "apc") $type = "apc"; $index = "4.2.1.0"; $descr = "Output"; - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/voltages/areca.inc.php b/includes/discovery/voltages/areca.inc.php index 00985573c..e11149653 100644 --- a/includes/discovery/voltages/areca.inc.php +++ b/includes/discovery/voltages/areca.inc.php @@ -3,17 +3,17 @@ global $valid_sensor; ## Areca Voltages -if ($device['os'] == "areca") +if ($device['os'] == "areca") { $oids = snmp_walk($device, "1.3.6.1.4.1.18928.1.2.2.1.8.1.2", "-OsqnU", ""); if ($debug) { echo($oids."\n"); } if ($oids) echo("Areca "); $divisor = 1000; $type = "areca"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -22,9 +22,10 @@ if ($device['os'] == "areca") $current = snmp_get($device, $oid, "-Oqv", "") / $divisor; if ($descr != '"Battery Status"' || $current != 0.255) # FIXME not sure if this is supposed to be a voltage, but without BBU it's 225, then ignore. { - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, trim($descr,'"'), $divisor, '1', NULL, NULL, NULL, NULL, $current)); + discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, trim($descr,'"'), $divisor, '1', NULL, NULL, NULL, NULL, $current); } } } } + ?> \ No newline at end of file diff --git a/includes/discovery/voltages/gamatronicups.inc.php b/includes/discovery/voltages/gamatronicups.inc.php index 4546f245f..37215a6ee 100644 --- a/includes/discovery/voltages/gamatronicups.inc.php +++ b/includes/discovery/voltages/gamatronicups.inc.php @@ -2,9 +2,9 @@ global $valid_sensor; -if ($device['os'] == "gamatronicups") +if ($device['os'] == "gamatronicups") { - for($i = 1; $i <= 3 ;$i++) + for($i = 1; $i <= 3 ;$i++) { $volt_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.2.$i"; $descr = "Input Phase $i"; @@ -14,10 +14,11 @@ if ($device['os'] == "gamatronicups") $index = $i; $lowlimit = 0; $limit = NULL; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt); } - for($i = 1; $i <= 3 ;$i++) + for($i = 1; $i <= 3 ;$i++) { $volt_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.2.$i"; $descr = "Output Phase $i"; @@ -27,8 +28,9 @@ if ($device['os'] == "gamatronicups") $index = 100+$i; $lowlimit = 0; $limit = NULL; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt)); - } + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt); + } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/voltages/ipoman.inc.php b/includes/discovery/voltages/ipoman.inc.php index 71ad80b37..1954d00f6 100644 --- a/includes/discovery/voltages/ipoman.inc.php +++ b/includes/discovery/voltages/ipoman.inc.php @@ -7,8 +7,8 @@ if ($device['os'] == "ipoman") { echo(" IPOMANII-MIB "); - if(!is_array($cache['ipoman'])) - { + if (!is_array($cache['ipoman'])) + { echo("outletConfigDesc "); $cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB"); echo("outletConfigLocation "); @@ -26,9 +26,9 @@ if ($device['os'] == "ipoman") echo("inletStatusVoltage "); $oids = snmpwalk_cache_multi_oid($device, "inletStatusVoltage", $oids, "IPOMANII-MIB"); - if(is_array($oids)) + if (is_array($oids)) { - foreach($oids as $index => $entry) + foreach ($oids as $index => $entry) { $volt_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.2.' . $index; $divisor = 10; @@ -36,9 +36,11 @@ if ($device['os'] == "ipoman") $current = $entry['inletStatusVoltage'] / 10; $low_limit = $entry['inletConfigVoltageLow']; $high_limit = $entry['inletConfigVoltageHigh']; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current); # FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf? } } } + ?> \ No newline at end of file diff --git a/includes/discovery/voltages/linux.inc.php b/includes/discovery/voltages/linux.inc.php index eba6826fb..ac361383e 100644 --- a/includes/discovery/voltages/linux.inc.php +++ b/includes/discovery/voltages/linux.inc.php @@ -3,25 +3,28 @@ global $valid_sensor; ## LMSensors Voltages -if ($device['os'] == "linux") +if ($device['os'] == "linux") { $oids = snmp_walk($device, "lmVoltSensorsDevice", "-OsqnU", "LM-SENSORS-MIB"); if ($debug) { echo($oids."\n"); } if ($oids) echo("LM-SENSORS "); $divisor = 1000; $type = "lmsensors"; - foreach(explode("\n", $oids) as $data) + + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); $index = $split_oid[count($split_oid)-1]; $oid = "1.3.6.1.4.1.2021.13.16.4.1.3." . $index; $current = snmp_get($device, $oid, "-Oqv", "LM-SENSORS-MIB") / $divisor; - echo(discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } } + ?> \ No newline at end of file diff --git a/includes/discovery/voltages/mgeups.inc.php b/includes/discovery/voltages/mgeups.inc.php index 6fd0533b5..bd7aa6f5e 100644 --- a/includes/discovery/voltages/mgeups.inc.php +++ b/includes/discovery/voltages/mgeups.inc.php @@ -3,7 +3,7 @@ global $valid_sensor; ## MGE UPS Voltages -if ($device['os'] == "mgeups") +if ($device['os'] == "mgeups") { echo("MGE "); $oids = trim(snmp_walk($device, "mgoutputVoltage", "-OsqnU", "MG-SNMP-UPS-MIB")); @@ -14,18 +14,19 @@ if ($device['os'] == "mgeups") $volt_oid = ".1.3.6.1.4.1.705.1.7.2.1.2.$i"; $descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i"; $current = snmp_get($device, $volt_oid, "-Oqv"); - if (!$current) + if (!$current) { $volt_oid .= ".0"; - $current = snmp_get($device, $volt_oid, "-Oqv"); + $current = snmp_get($device, $volt_oid, "-Oqv"); } $current /= 10; $type = "mge-ups"; - $divisor = 10; + $divisor = 10; $index = $i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } - + $oids = trim(snmp_walk($device, "mgeinputVoltage", "-OsqnU", "MG-SNMP-UPS-MIB")); if ($debug) { echo($oids."\n"); } $numPhase = count(explode("\n",$oids)); @@ -34,16 +35,18 @@ if ($device['os'] == "mgeups") $volt_oid = ".1.3.6.1.4.1.705.1.6.2.1.2.$i"; $descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i"; $current = snmp_get($device, $volt_oid, "-Oqv"); - if (!$current) + if (!$current) { $volt_oid .= ".0"; $current = snmp_get($device, $volt_oid, "-Oqv"); } $current /= 10; $type = "mge-ups"; - $divisor = 10; + $divisor = 10; $index = 100+$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } + ?> \ No newline at end of file diff --git a/includes/discovery/voltages/rfc1628.inc.php b/includes/discovery/voltages/rfc1628.inc.php index a3a7bb242..1251fade6 100644 --- a/includes/discovery/voltages/rfc1628.inc.php +++ b/includes/discovery/voltages/rfc1628.inc.php @@ -3,17 +3,17 @@ global $valid_sensor; ## RFC1628 UPS Voltages -if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") +if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") { echo("RFC1628 "); - + $oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.5", "-Osqn", "UPS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -24,7 +24,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($volt_id+1)); $type = "rfc1628"; $index = "1.2.5.".$volt_id; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt); } } @@ -39,7 +40,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; }; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = $i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU")); @@ -53,7 +55,8 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; }; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = 100+$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } $oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU")); @@ -67,7 +70,9 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups") $divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; }; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = 200+$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } + ?> \ No newline at end of file diff --git a/includes/discovery/voltages/supermicro.inc.php b/includes/discovery/voltages/supermicro.inc.php index 2e84e5101..f5bf88f88 100644 --- a/includes/discovery/voltages/supermicro.inc.php +++ b/includes/discovery/voltages/supermicro.inc.php @@ -3,7 +3,7 @@ global $valid_sensor; ## Supermicro Voltages -if ($device['os'] == "linux") +if ($device['os'] == "linux") { $oids = snmp_walk($device, "1.3.6.1.4.1.10876.2.1.1.1.1.3", "-OsqnU", "SUPERMICRO-HEALTH-MIB"); if ($debug) { echo($oids."\n"); } @@ -11,10 +11,10 @@ if ($device['os'] == "linux") if ($oids) echo("Supermicro "); $type = "supermicro"; $divisor = "1000"; - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$kind) = explode(" ", $data); $split_oid = explode('.',$oid); @@ -36,10 +36,11 @@ if ($device['os'] == "linux") if ($monitor == 'true') { - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', $lowlimit, NULL, NULL, $limit, $current)); + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', $lowlimit, NULL, NULL, $limit, $current); } } } } } -?> + +?> \ No newline at end of file diff --git a/includes/discovery/voltages/xups.inc.php b/includes/discovery/voltages/xups.inc.php index 3a4284afb..f88b60582 100644 --- a/includes/discovery/voltages/xups.inc.php +++ b/includes/discovery/voltages/xups.inc.php @@ -11,10 +11,10 @@ if ($device['os'] == "powerware") $oids = snmp_walk($device, "xupsBatVoltage", "-Osqn", "XUPS-MIB"); if ($debug) { echo($oids."\n"); } $oids = trim($oids); - foreach(explode("\n", $oids) as $data) + foreach (explode("\n", $oids) as $data) { $data = trim($data); - if ($data) + if ($data) { list($oid,$descr) = explode(" ", $data,2); $split_oid = explode('.',$oid); @@ -25,7 +25,8 @@ if ($device['os'] == "powerware") $descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($volt_id+1)); $type = "xups"; $index = '1.2.5.'.$volt_id; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt); } } @@ -42,7 +43,8 @@ if ($device['os'] == "powerware") $divisor = 1; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = '3.4.1.2.'.$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } # XUPS-MIB::xupsOutputNumPhases.0 = INTEGER: 1 @@ -58,7 +60,8 @@ if ($device['os'] == "powerware") $divisor = 1; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = '4.4.1.2.'.$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } # XUPS-MIB::xupsBypassNumPhases.0 = INTEGER: 1 @@ -73,7 +76,9 @@ if ($device['os'] == "powerware") $divisor = 1; $current = snmp_get($device, $volt_oid, "-Oqv") / $divisor; $index = '5.3.1.2.'.$i; - echo(discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current)); + + discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } } + ?> \ No newline at end of file