Remove all unneeded if($debug)-statements and replace them with d_echo . discovery dir..

This commit is contained in:
Mark Schouten
2015-08-20 15:59:43 +02:00
parent 4fa88bb928
commit 677a4f3f5f
89 changed files with 192 additions and 561 deletions

View File

@@ -43,9 +43,7 @@ foreach (explode("\n", $ipNetToMedia_data) as $data) {
$old_mac = dbFetchCell('SELECT mac_address from ipv4_mac WHERE ipv4_address=? AND port_id=?', array($ip, $interface['port_id']));
if ($clean_mac != $old_mac && $clean_mac != '' && $old_mac != '') {
if ($debug) {
echo "Changed mac address for $ip from $old_mac to $clean_mac\n";
}
d_echo("Changed mac address for $ip from $old_mac to $clean_mac\n");
log_event("MAC change: $ip : ".mac_clean_to_readable($old_mac).' -> '.mac_clean_to_readable($clean_mac), $device, 'interface', $interface['port_id']);
}
@@ -73,9 +71,7 @@ foreach (dbFetchRows($sql) as $entry) {
$entry_if = $entry['port_id'];
if (!$mac_table[$entry_if][$entry_mac]) {
dbDelete('ipv4_mac', '`port_id` = ? AND `mac_address` = ?', array($entry_if, $entry_mac));
if ($debug) {
echo "Removing MAC $entry_mac from interface ".$interface['ifName'];
}
d_echo("Removing MAC $entry_mac from interface ".$interface['ifName']);
echo '-';
}

View File

@@ -1,7 +1,5 @@
<?php
global $debug;
if ($config['enable_bgp']) {
// Discover BGP peers
echo 'BGP Sessions : ';
@@ -25,9 +23,7 @@ if ($config['enable_bgp']) {
$peer2 = true;
}
if ($debug) {
echo "Peers : $peers_data \n";
}
d_echo("Peers : $peers_data \n");
$peers = trim(str_replace('CISCO-BGP4-MIB::cbgpPeer2RemoteAs.', '', $peers_data));
$peers = trim(str_replace('BGP4-MIB::bgpPeerRemoteAs.', '', $peers));
@@ -45,9 +41,7 @@ if ($config['enable_bgp']) {
}
if ($peer && $peer_ip != '0.0.0.0') {
if ($debug) {
echo "Found peer $peer_ip (AS$peer_as)\n";
}
d_echo("Found peer $peer_ip (AS$peer_as)\n");
$peerlist[] = array(
'ip' => $peer_ip,
@@ -70,9 +64,7 @@ if ($config['enable_bgp']) {
$peer_ip = Net_IPv6::compress(snmp2ipv6(implode('.', array_slice(explode('.', $peer_ip_snmp), (count(explode('.', $peer_ip_snmp)) - 16)))));
if ($peer) {
if ($debug) {
echo "Found peer $peer_ip (AS$peer_as)\n";
}
d_echo("Found peer $peer_ip (AS$peer_as)\n");
$peerlist[] = array(
'ip' => $peer_ip,
@@ -121,19 +113,15 @@ if ($config['enable_bgp']) {
$af_data = snmpwalk_cache_oid($device, 'cbgpPeerAddrFamilyEntry', $cbgp, 'CISCO-BGP4-MIB', $config['mibdir']);
}
if ($debug) {
echo 'afi data :: ';
print_r($af_data);
}
d_echo('afi data :: ';
d_echo($af_data);
foreach ($af_data as $k => $v) {
if ($peer2 === true) {
list(,$k) = explode('.', $k, 2);
}
if ($debug) {
echo "AFISAFI = $k\n";
}
d_echo("AFISAFI = $k\n");
$afisafi_tmp = explode('.', $k);
$safi = array_pop($afisafi_tmp);
@@ -162,9 +150,7 @@ if ($config['enable_bgp']) {
switch ($entry['jnxBgpM2PeerRemoteAddrType']) {
case 'ipv4':
$ip = long2ip(hexdec($entry['jnxBgpM2PeerRemoteAddr']));
if ($debug) {
echo "peerindex for ipv4 $ip is ".$entry['jnxBgpM2PeerIndex']."\n";
}
d_echo("peerindex for ipv4 $ip is ".$entry['jnxBgpM2PeerIndex']."\n");
$j_peerIndexes[$ip] = $entry['jnxBgpM2PeerIndex'];
break;
@@ -173,9 +159,7 @@ if ($config['enable_bgp']) {
$ip6 = trim(str_replace(' ', '', $entry['jnxBgpM2PeerRemoteAddr']), '"');
$ip6 = substr($ip6, 0, 4).':'.substr($ip6, 4, 4).':'.substr($ip6, 8, 4).':'.substr($ip6, 12, 4).':'.substr($ip6, 16, 4).':'.substr($ip6, 20, 4).':'.substr($ip6, 24, 4).':'.substr($ip6, 28, 4);
$ip6 = Net_IPv6::compress($ip6);
if ($debug) {
echo "peerindex for ipv6 $ip6 is ".$entry['jnxBgpM2PeerIndex']."\n";
}
d_echo("peerindex for ipv6 $ip6 is ".$entry['jnxBgpM2PeerIndex']."\n");
$j_peerIndexes[$ip6] = $entry['jnxBgpM2PeerIndex'];
break;

View File

@@ -6,9 +6,7 @@ echo 'Battery Charge: ';
$include_dir = 'includes/discovery/charge';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['charge']);
}
d_echo($valid['sensor']['charge']);
check_valid_sensors($device, 'charge', $valid['sensor']);

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'apc') {
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.3.1.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
// Try High-Precision First
if (!empty($oids)) {
@@ -27,9 +25,7 @@ if ($device['os'] == 'apc') {
else {
// Try to just get capacity
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.2.1.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if (!empty($oids)) {
echo 'APC UPS Battery Charge';

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.4', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {

View File

@@ -4,9 +4,7 @@ echo 'Cisco CEF Switching Path: ';
$cefs = array();
$cefs = snmpwalk_cache_threepart_oid($device, 'CISCO-CEF-MIB::cefSwitchingPath', $cefs);
if ($debug) {
print_r($cefs);
}
d_echo($cefs);
if (is_array($cefs)) {
if (!is_array($entity_array)) {

View File

@@ -33,9 +33,7 @@ if ($device['os_group'] == 'cisco') {
echo ' entSensorThresholdValue';
$t_oids = snmpwalk_cache_twopart_oid($device, 'entSensorThresholdValue', $t_oids, 'CISCO-ENTITY-SENSOR-MIB');
if ($debug) {
print_r($oids);
}
d_echo($oids);
$entitysensor['voltsDC'] = 'voltage';
$entitysensor['voltsAC'] = 'voltage';

View File

@@ -34,10 +34,8 @@ if ($config['enable_vrfs']) {
$ports_oid = '.1.3.6.1.2.1.10.166.11.1.2.1.1.2';
}
if ($debug) {
echo "\n[DEBUG]\nUsing $vpnmib\n[/DEBUG]\n";
echo "\n[DEBUG OIDS]\n$rds\n[/DEBUG]\n";
}
d_echo("\n[DEBUG]\nUsing $vpnmib\n[/DEBUG]\n");
d_echo("\n[DEBUG OIDS]\n$rds\n[/DEBUG]\n");
$rds = trim($rds);

View File

@@ -5,9 +5,7 @@ echo 'Current: ';
$include_dir = 'includes/discovery/current';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['current']);
}
d_echo($valid['sensor']['current']);
check_valid_sensors($device, 'current', $valid['sensor']);

View File

@@ -9,9 +9,7 @@ if ($device['os'] == 'apc') {
}
if ($oids) {
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
@@ -64,9 +62,7 @@ if ($device['os'] == 'apc') {
// should work with firmware v2 and v3
if ($oids) {
echo 'APC PowerNet-MIB Banks ';
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
$type = 'apc';
@@ -132,9 +128,7 @@ if ($device['os'] == 'apc') {
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.26.9.4.3.1.1', '-t 30 -OsqnU', 'PowerNet-MIB');
if ($oids) {
echo 'APC PowerNet-MIB Outlets ';
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
$type = 'apc';
@@ -179,9 +173,7 @@ if ($device['os'] == 'apc') {
$oids = snmp_walk($device, 'atsConfigPhaseTableIndex', '-OsqnU', 'PowerNet-MIB');
if ($oids) {
$type = 'apc';
if ($debug) {
print_r($oids);
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
@@ -239,9 +231,7 @@ if ($device['os'] == 'apc') {
}
if (!empty($oids)) {
if ($debug) {
print_r($oids);
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -4,9 +4,7 @@
if ($device['os'] == 'mgeups') {
echo 'MGE ';
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.7.1', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {
@@ -36,9 +34,7 @@ if ($device['os'] == 'mgeups') {
}//end for
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.6.1', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.6', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {
@@ -28,9 +26,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -49,9 +45,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -70,9 +64,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -12,9 +12,7 @@ if ($device['os'] == 'sentry3') {
//
// Check for Infeeds
$infeed_oids = snmp_walk($device, "infeedID.$towers.1", '-Osqn', 'Sentry3-MIB');
if ($debug) {
echo $infeed_oids."\n";
}
d_echo($infeed_oids."\n");
$infeed_oids = trim($infeed_oids);

View File

@@ -5,9 +5,7 @@ if ($device['os'] == 'powerware') {
echo 'XUPS-MIB ';
$oids = snmp_walk($device, 'xupsBatCurrent', '-Osqn', 'XUPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {
@@ -28,9 +26,7 @@ if ($device['os'] == 'powerware') {
}
$oids = trim(snmp_walk($device, 'xupsOutputCurrent', '-OsqnU', 'XUPS-MIB'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -49,9 +45,7 @@ if ($device['os'] == 'powerware') {
}
$oids = trim(snmp_walk($device, 'xupsInputCurrent', '-OsqnU', 'XUPS-MIB'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -186,25 +186,19 @@ else {
echo "disabled\n";
}
if ($debug) {
print_r($link_exists);
}
d_echo($link_exists);
$sql = "SELECT * FROM `links` AS L, `ports` AS I WHERE L.local_port_id = I.port_id AND I.device_id = '".$device['device_id']."'";
foreach (dbFetchRows($sql) as $test) {
$local_port_id = $test['local_port_id'];
$remote_hostname = $test['remote_hostname'];
$remote_port = $test['remote_port'];
if ($debug) {
echo "$local_port_id -> $remote_hostname -> $remote_port \n";
}
d_echo("$local_port_id -> $remote_hostname -> $remote_port \n");
if (!$link_exists[$local_port_id][$remote_hostname][$remote_port]) {
echo '-';
$rows = dbDelete('links', '`id` = ?', array($test['id']));
if ($debug) {
echo "$rows deleted ";
}
d_echo("$rows deleted ");
}
}

View File

@@ -6,9 +6,7 @@ echo 'Fanspeeds : ';
$include_dir = 'includes/discovery/fanspeeds';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['fanspeed']);
}
d_echo($valid['sensor']['fanspeed']);
check_valid_sensors($device, 'fanspeed', $valid['sensor']);

View File

@@ -3,9 +3,7 @@
// Areca Fanspeeds
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";
}
d_echo($oids."\n");
if ($oids) {
echo 'Areca ';

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'linux') {
$oids = snmp_walk($device, 'coolingDevicechassisIndex.1', '-OsqnU', 'MIB-Dell-10892');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'drac') {
$oids = snmp_walk($device, 'coolingDevicechassisIndex.1', '-OsqnU', 'IDRAC-MIB-SMIv2');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -3,9 +3,7 @@
// LMSensors Fanspeeds
if ($device['os'] == 'linux') {
$oids = snmp_walk($device, 'lmFanSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'routeros') {
$oids = snmp_walk($device, 'mtxrHlActiveFan', '-OsqnU', 'MIKROTIK-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids !== false) {
echo 'MIKROTIK-MIB ';

View File

@@ -3,9 +3,7 @@
// Supermicro Fanspeeds
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";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -6,9 +6,7 @@ echo 'Frequencies: ';
$include_dir = 'includes/discovery/frequencies';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['frequency']);
}
d_echo($valid['sensor']['frequency']);
check_valid_sensors($device, 'frequency', $valid['sensor']);

View File

@@ -3,9 +3,7 @@
// 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";
}
d_echo($oids."\n");
if ($oids) {
echo 'APC In ';
@@ -26,9 +24,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.4.2.1.4', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC Out ';
@@ -53,9 +49,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.3.2.4.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC In ';
@@ -68,9 +62,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.4.2.2.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC Out ';

View File

@@ -4,9 +4,7 @@
if ($device['os'] == 'mgeups') {
echo 'MGE ';
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.7.1', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {
@@ -30,9 +28,7 @@ if ($device['os'] == 'mgeups') {
}
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.6.1', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -14,7 +14,7 @@
function discover_new_device($hostname, $device='', $method='', $interface='') {
global $config, $debug;
global $config;
if (!empty($config['mydomain']) && isDomainResolves($hostname.'.'.$config['mydomain'])) {
$dst_host = $hostname.'.'.$config['mydomain'];
@@ -23,32 +23,24 @@ function discover_new_device($hostname, $device='', $method='', $interface='') {
$dst_host = $hostname;
}
if ($debug) {
echo "discovering $dst_host\n";
}
d_echo("discovering $dst_host\n");
$ip = gethostbyname($dst_host);
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
// $ip isn't a valid IP so it must be a name.
if ($ip == $dst_host) {
if ($debug) {
echo "name lookup of $dst_host failed\n";
}
d_echo("name lookup of $dst_host failed\n");
return false;
}
}
if ($debug) {
echo "ip lookup result: $ip\n";
}
d_echo("ip lookup result: $ip\n");
$dst_host = rtrim($dst_host, '.');
// remove trailing dot
if (match_network($config['autodiscovery']['nets-exclude'], $ip)) {
if ($debug) {
echo "$ip in an excluded network - skipping\n";
}
d_echo("$ip in an excluded network - skipping\n");
return false;
}
@@ -77,9 +69,7 @@ function discover_new_device($hostname, $device='', $method='', $interface='') {
}
}
else {
if ($debug) {
echo "$ip not in a matched network - skipping\n";
}
d_echo("$ip not in a matched network - skipping\n");
}//end if
}//end discover_new_device()
@@ -161,11 +151,9 @@ function discover_device($device, $options=null) {
function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr, $divisor='1', $multiplier='1', $low_limit=null, $low_warn_limit=null, $warn_limit=null, $high_limit=null, $current=null, $poller_type='snmp', $entPhysicalIndex=null, $entPhysicalIndex_measured=null) {
global $config, $debug;
global $config;
if ($debug) {
echo "Discover sensor: $oid, $index, $type, $descr, $poller_type, $precision, $entPhysicalIndex\n";
}
d_echo("Discover sensor: $oid, $index, $type, $descr, $poller_type, $precision, $entPhysicalIndex\n");
if (is_null($low_warn_limit) && !is_null($warn_limit)) {
// Warn limits only make sense when we have both a high and a low limit
@@ -218,9 +206,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
$inserted = dbInsert($insert, 'sensors');
if ($debug) {
echo "( $inserted inserted )\n";
}
d_echo("( $inserted inserted )\n");
echo '+';
log_event('Sensor Added: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr), $device, 'sensor', $inserted);
@@ -258,9 +244,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
if ($high_limit != $sensor_entry['sensor_limit'] && $sensor_entry['sensor_custom'] == 'No') {
$update = array('sensor_limit' => ($high_limit == null ? array('NULL') : $high_limit));
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
if ($debug) {
echo "( $updated updated )\n";
}
d_echo("( $updated updated )\n");
echo 'H';
log_event('Sensor High Limit Updated: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr).' ('.$high_limit.')', $device, 'sensor', $sensor_id);
@@ -269,9 +253,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
if ($sensor_entry['sensor_limit_low'] != $low_limit && $sensor_entry['sensor_custom'] == 'No') {
$update = array('sensor_limit_low' => ($low_limit == null ? array('NULL') : $low_limit));
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
if ($debug) {
echo "( $updated updated )\n";
}
d_echo("( $updated updated )\n");
echo 'L';
log_event('Sensor Low Limit Updated: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr).' ('.$low_limit.')', $device, 'sensor', $sensor_id);
@@ -280,9 +262,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
if ($warn_limit != $sensor_entry['sensor_limit_warn'] && $sensor_entry['sensor_custom'] == 'No') {
$update = array('sensor_limit_warn' => ($warn_limit == null ? array('NULL') : $warn_limit));
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
if ($debug) {
echo "( $updated updated )\n";
}
d_echo("( $updated updated )\n");
echo 'WH';
log_event('Sensor Warn High Limit Updated: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr).' ('.$warn_limit.')', $device, 'sensor', $sensor_id);
@@ -291,9 +271,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
if ($sensor_entry['sensor_limit_low_warn'] != $low_warn_limit && $sensor_entry['sensor_custom'] == 'No') {
$update = array('sensor_limit_low_warn' => ($low_warn_limit == null ? array('NULL') : $low_warn_limit));
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
if ($debug) {
echo "( $updated updated )\n";
}
d_echo("( $updated updated )\n");
echo 'WL';
log_event('Sensor Warn Low Limit Updated: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr).' ('.$low_warn_limit.')', $device, 'sensor', $sensor_id);
@@ -314,9 +292,7 @@ function discover_sensor(&$valid, $class, $device, $oid, $index, $type, $descr,
$updated = dbUpdate($update, 'sensors', '`sensor_id` = ?', array($sensor_entry['sensor_id']));
echo 'U';
log_event('Sensor Updated: '.mres($class).' '.mres($type).' '.mres($index).' '.mres($descr), $device, 'sensor', $sensor_id);
if ($debug) {
echo "( $updated updated )\n";
}
d_echo("( $updated updated )\n");
}
}//end if
$valid[$class][$type][$index] = 1;
@@ -417,9 +393,7 @@ function check_valid_sensors($device, $class, $valid, $poller_type='snmp') {
foreach ($entries as $entry) {
$index = $entry['sensor_index'];
$type = $entry['sensor_type'];
if ($debug) {
echo $index.' -> '.$type."\n";
}
d_echo($index.' -> '.$type."\n");
if (!$valid[$class][$type][$index]) {
echo '-';
@@ -436,13 +410,11 @@ function check_valid_sensors($device, $class, $valid, $poller_type='snmp') {
function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr) {
global $config, $debug;
global $config;
if (dbFetchCell('SELECT COUNT(*) FROM `juniAtmVp` WHERE `port_id` = ? AND `vp_id` = ?', array($port_id, $vp_id)) == '0') {
$inserted = dbInsert(array('port_id' => $port_id, 'vp_id' => $vp_id, 'vp_descr' => $vp_descr), 'juniAtmVp');
if ($debug) {
echo "( $inserted inserted )\n";
}
d_echo("( $inserted inserted )\n");
// FIXME vv no $device!
log_event('Juniper ATM VP Added: port '.mres($port_id).' vp '.mres($vp_id).' descr'.mres($vp_descr), 'juniAtmVp', $inserted);
@@ -457,7 +429,7 @@ function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr) {
function discover_link($local_port_id, $protocol, $remote_port_id, $remote_hostname, $remote_port, $remote_platform, $remote_version, $local_device_id, $remote_device_id) {
global $config, $debug, $link_exists;
global $config, $link_exists;
d_echo("$local_port_id, $protocol, $remote_port_id, $remote_hostname, $remote_port, $remote_platform, $remote_version");
@@ -488,9 +460,7 @@ function discover_link($local_port_id, $protocol, $remote_port_id, $remote_hostn
$inserted = dbInsert($insert_data, 'links');
echo '+';
if ($debug) {
echo "( $inserted inserted )";
}
d_echo("( $inserted inserted )");
}
else {
$data = dbFetchRow('SELECT * FROM `links` WHERE `remote_hostname` = ? AND `local_port_id` = ? AND `protocol` = ? AND `remote_port` = ?', array($remote_hostname, $local_port_id, $protocol, $remote_port));
@@ -512,9 +482,7 @@ function discover_link($local_port_id, $protocol, $remote_port_id, $remote_hostn
$updated = dbUpdate($update_data, 'links', '`id` = ?', array($data['id']));
echo 'U';
if ($debug) {
echo "( $updated updated )";
}
d_echo("( $updated updated )");
}//end if
}//end if
$link_exists[$local_port_id][$remote_hostname][$remote_port] = 1;
@@ -523,11 +491,9 @@ function discover_link($local_port_id, $protocol, $remote_port_id, $remote_hostn
function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size, $units, $used=null) {
global $config, $debug;
global $config;
if ($debug) {
echo "$device, $index, $type, $mib, $descr, $units, $used, $size\n";
}
d_echo("$device, $index, $type, $mib, $descr, $units, $used, $size\n");
if ($descr && $size > '0') {
$storage = dbFetchRow('SELECT * FROM `storage` WHERE `storage_index` = ? AND `device_id` = ? AND `storage_mib` = ?', array($index, $device['device_id'], $mib));
@@ -565,11 +531,9 @@ function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size,
function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $precision='1', $current=null, $entPhysicalIndex=null, $hrDeviceIndex=null) {
global $config, $debug;
global $config;
if ($debug) {
echo "$device, $oid, $index, $type, $descr, $precision, $current, $entPhysicalIndex, $hrDeviceIndex\n";
}
d_echo("$device, $oid, $index, $type, $descr, $precision, $current, $entPhysicalIndex, $hrDeviceIndex\n");
if ($descr) {
$descr = trim(str_replace('"', '', $descr));
@@ -604,9 +568,7 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
'processor_precision' => $precision,
);
dbUpdate($update_data, 'processors', '`device_id`=? AND `processor_index`=? AND `processor_type`=?', array($device['device_id'], $index, $type));
if ($debug) {
print $query."\n";
}
d_echo($query."\n");
}//end if
$valid[$type][$index] = 1;
}//end if
@@ -615,11 +577,9 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
function discover_mempool(&$valid, $device, $index, $type, $descr, $precision='1', $entPhysicalIndex=null, $hrDeviceIndex=null) {
global $config, $debug;
global $config;
if ($debug) {
echo "$device, $oid, $index, $type, $descr, $precision, $current, $entPhysicalIndex, $hrDeviceIndex\n";
}
d_echo("$device, $oid, $index, $type, $descr, $precision, $current, $entPhysicalIndex, $hrDeviceIndex\n");
// FIXME implement the mempool_perc, mempool_used, etc.
if ($descr) {
@@ -663,9 +623,7 @@ function discover_mempool(&$valid, $device, $index, $type, $descr, $precision='1
}
dbUpdate($update_data, 'mempools', 'device_id=? AND mempool_index=? AND mempool_type=?', array($device['device_id'], $index, $type));
if ($debug) {
print $query."\n";
}
d_echo($query."\n");
}//end if
$valid[$type][$index] = 1;
}//end if
@@ -674,11 +632,9 @@ function discover_mempool(&$valid, $device, $index, $type, $descr, $precision='1
function discover_toner(&$valid, $device, $oid, $index, $type, $descr, $capacity_oid=null, $capacity=null, $current=null) {
global $config, $debug;
global $config;
if ($debug) {
echo "$oid, $index, $type, $descr, $capacity, $capacity_oid\n";
}
d_echo("$oid, $index, $type, $descr, $capacity, $capacity_oid\n");
if (dbFetchCell('SELECT COUNT(toner_id) FROM `toner` WHERE device_id = ? AND toner_type = ? AND `toner_index` = ? AND `toner_capacity_oid` =?', array($device['device_id'], $type, $index, $capacity_oid)) == '0') {
$inserted = dbInsert(array('device_id' => $device['device_id'], 'toner_oid' => $oid, 'toner_capacity_oid' => $capacity_oid, 'toner_index' => $index, 'toner_type' => $type, 'toner_descr' => $descr, 'toner_capacity' => $capacity, 'toner_current' => $current), 'toner');

View File

@@ -6,18 +6,14 @@ $hrDevice_oids = array(
'hrDeviceEntry',
'hrProcessorEntry',
);
if ($debug) {
print_r($hrDevices);
}
d_echo($hrDevices);
$hrDevices = array();
foreach ($hrDevice_oids as $oid) {
$hrDevices = snmpwalk_cache_oid($device, $oid, $hrDevices, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
}
if ($debug) {
print_r($hrDevices);
}
d_echo($hrDevices);
if (is_array($hrDevices)) {
$hrDevices = $hrDevices;
@@ -40,10 +36,8 @@ if (is_array($hrDevices)) {
else {
$inserted_rows = dbInsert(array('hrDeviceIndex' => mres($hrDevice['hrDeviceIndex']), 'device_id' => mres($device['device_id']), 'hrDeviceType' => mres($hrDevice['hrDeviceType']), 'hrDeviceDescr' => mres($hrDevice['hrDeviceDescr']), 'hrDeviceStatus' => mres($hrDevice['hrDeviceStatus']), 'hrDeviceErrors' => (int) mres($hrDevice['hrDeviceErrors'])), 'hrDevice');
echo '+';
if ($debug) {
print_r($hrDevice);
echo "$inserted_rows row inserted";
}
d_echo($hrDevice);
d_echo("$inserted_rows row inserted");
}//end if
$valid_hrDevice[$hrDevice['hrDeviceIndex']] = 1;
@@ -57,9 +51,7 @@ foreach (dbFetchRows($sql) as $test_hrDevice) {
if (!$valid_hrDevice[$test_hrDevice['hrDeviceIndex']]) {
echo '-';
dbDelete('hrDevice', '`hrDevice_id` = ?', array($test_hrDevice['hrDevice_id']));
if ($debug) {
print_r($test_hrDevice);
}
d_echo($test_hrDevice);
}
}

View File

@@ -6,9 +6,7 @@ echo 'Humidity : ';
$include_dir = 'includes/discovery/humidity';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['humidity']);
}
d_echo($valid['sensor']['humidity']);
check_valid_sensors($device, 'humidity', $valid['sensor']);

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'akcp' || $device['os'] == 'minkelsrms') {
$oids = snmp_walk($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', '-Osqn', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -1,7 +1,5 @@
<?php
global $debug;
if ($device['os'] == 'mgeups') {
// blatently copyied from APC
echo 'MGE UPS External ';
@@ -52,9 +50,7 @@ if ($device['os'] == 'mgeups') {
$low_warn_limit = ($low_limit + $hysteresis);
$high_warn_limit = ($high_limit - $hysteresis);
if ($debug) {
echo "low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n";
}
d_echo("low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n");
if ($current != 0) {
// Humidity = 0 -> Sensor not available

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'netbotz') {
$oids = snmp_walk($device, '.1.3.6.1.4.1.5528.100.4.1.2.1.4', '-Osqn', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -4,9 +4,7 @@ if ($device['os'] == 'sentry3') {
$oids = snmp_walk($device, 'tempHumidSensorHumidValue', '-Osqn', 'Sentry3-MIB');
$divisor = '1';
$multiplier = '1';
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -7,9 +7,7 @@ if ($device['os'] == 'junose' && $config['enable_ports_junoseatmvp']) {
echo 'JunOSe ATM vps : ';
$vp_array = snmpwalk_cache_multi_oid($device, 'juniAtmVpStatsInCells', $vp_array, 'Juniper-UNI-ATM-MIB', $config['install_dir'].'/mibs/junose');
$valid_vp = array();
if ($debug) {
print_r($vp_array);
}
d_echo($vp_array);
if (is_array($vp_array)) {
foreach ($vp_array as $index => $entry) {
@@ -28,16 +26,12 @@ if ($device['os'] == 'junose' && $config['enable_ports_junoseatmvp']) {
// Remove ATM vps which weren't redetected here
$sql = "SELECT * FROM `ports` AS P, `juniAtmVp` AS J WHERE P.`device_id` = '".$device['device_id']."' AND J.port_id = P.port_id";
if ($debug) {
print_r($valid_vp);
}
d_echo($valid_vp);
foreach (dbFetchRows($sql) as $test) {
$port_id = $test['port_id'];
$vp_id = $test['vp_id'];
if ($debug) {
echo $port_id.' -> '.$vp_id."\n";
}
d_echo($port_id.' -> '.$vp_id."\n");
if (!$valid_vp[$port_id][$vp_id]) {
echo '-';

View File

@@ -59,9 +59,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == 'linux') {
}
$xml = simplexml_load_string('<?xml version="1.0"?> '.$vm_info_xml);
if ($debug) {
print_r($xml);
}
d_echo($xml);
$vmwVmDisplayName = $xml->name;
$vmwVmGuestOS = '';

View File

@@ -5,9 +5,7 @@ echo 'Load: ';
$include_dir = 'includes/discovery/load';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['load']);
}
d_echo($valid['sensor']['load']);
check_valid_sensors($device, 'load', $valid['sensor']);

View File

@@ -30,9 +30,7 @@ if ($device['os'] == 'apc') {
}
if (!empty($oids)) {
if ($debug) {
print_r($oids);
}
d_echo($oids);
$oids = trim($oids);
if ($oids) {

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.4.4.1.5', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {

View File

@@ -9,16 +9,12 @@ require 'includes/include-dir.inc.php';
// Remove memory pools which weren't redetected here
$sql = "SELECT * FROM `mempools` WHERE `device_id` = '".$device['device_id']."'";
if ($debug) {
print_r($valid_mempool);
}
d_echo($valid_mempool);
foreach (dbFetchRows($sql) as $test_mempool) {
$mempool_index = $test_mempool['mempool_index'];
$mempool_type = $test_mempool['mempool_type'];
if ($debug) {
echo $mempool_index.' -> '.$mempool_type."\n";
}
d_echo($mempool_index.' -> '.$mempool_type."\n");
if (!$valid_mempool[$mempool_type][$mempool_index]) {
echo '-';

View File

@@ -7,9 +7,7 @@ if ($device['os'] == 'junos') {
$mempools_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDRAMSize', $mempools_array, 'JUNIPER-MIB', $config['install_dir'].'/mibs/junos');
$mempools_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingMemory', $mempools_array, 'JUNIPER-MIB', $config['install_dir'].'/mibs/junos');
$mempools_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDescr', $mempools_array, 'JUNIPER-MIB', $config['install_dir'].'/mibs/junos');
if ($debug) {
print_r($mempools_array);
}
d_echo($mempools_array);
if (is_array($mempools_array)) {
foreach ($mempools_array as $index => $entry) {
@@ -18,9 +16,7 @@ if ($device['os'] == 'junos') {
continue;
}
if ($debug) {
echo $index.' '.$entry['jnxOperatingDescr'].' -> '.$entry['jnxOperatingBuffer'].' -> '.$entry['jnxOperatingDRAMSize']."\n";
}
d_echo($index.' '.$entry['jnxOperatingDescr'].' -> '.$entry['jnxOperatingBuffer'].' -> '.$entry['jnxOperatingDRAMSize']."\n");
$usage_oid = '.1.3.6.1.4.1.2636.3.1.13.1.8.'.$index;
$descr = $entry['jnxOperatingDescr'];

View File

@@ -6,16 +6,12 @@ if ($device['os'] == 'vrp') {
$mempools_array = snmpwalk_cache_multi_oid($device, 'hwEntityMemUsage', $mempools_array, 'HUAWEI-ENTITY-EXTENT-MIB', $config['install_dir'].'/mibs');
$mempools_array = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $mempools_array, 'HUAWEI-ENTITY-EXTENT-MIB', $config['install_dir'].'/mibs');
$mempools_array = snmpwalk_cache_multi_oid($device, 'hwEntityBomEnDesc', $mempools_array, 'HUAWEI-ENTITY-EXTENT-MIB', $config['install_dir'].'/mibs');
if ($debug) {
print_r($mempools_array);
}
d_echo($mempools_array);
if (is_array($mempools_array)) {
foreach ($mempools_array as $index => $entry) {
if ($entry['hwEntityMemSize'] != 0) {
if ($debug) {
echo $index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityMemUsage'].' -> '.$entry['hwEntityMemSize']."\n";
}
d_echo($index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityMemUsage'].' -> '.$entry['hwEntityMemSize']."\n");
$usage_oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7.'.$index;
$descr = $entry['hwEntityBomEnDesc'];

View File

@@ -7,9 +7,7 @@ $port_stats = snmpwalk_cache_oid($device, 'ifName', $port_stats, 'IF-MIB');
$port_stats = snmpwalk_cache_oid($device, 'ifType', $port_stats, 'IF-MIB');
// End Building SNMP Cache Array
if ($debug) {
print_r($port_stats);
}
d_echo($port_stats);
// Build array of ports in the database
// FIXME -- this stuff is a little messy, looping the array to make an array just seems wrong. :>

View File

@@ -6,9 +6,7 @@ echo 'Power: ';
$include_dir = 'includes/discovery/power';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['power']);
}
d_echo($valid['sensor']['power']);
check_valid_sensors($device, 'power', $valid['sensor']);

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo("RFC1628 ");
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.4.3.0", "-OsqnU"));
if ($debug) {
echo($oids."\n");
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++) {
$current_oid = ".1.3.6.1.2.1.33.1.4.4.1.4.$i";
@@ -22,9 +20,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
if ($debug) {
echo($oids."\n");
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++) {
$current_oid = "1.3.6.1.2.1.33.1.3.3.1.5.$i";
@@ -39,9 +35,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
if ($debug) {
echo($oids."\n");
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++) {
$current_oid = ".1.3.6.1.2.1.33.1.5.3.1.4.$i";

View File

@@ -12,16 +12,12 @@ require 'processors-ucd-old.inc.php';
// Remove processors which weren't redetected here
$sql = "SELECT * FROM `processors` WHERE `device_id` = '".$device['device_id']."'";
if ($debug) {
print_r($valid['processor']);
}
d_echo($valid['processor']);
foreach (dbFetchRows($sql) as $test_processor) {
$processor_index = $test_processor['processor_index'];
$processor_type = $test_processor['processor_type'];
if ($debug) {
echo $processor_index.' -> '.$processor_type."\n";
}
d_echo($processor_index.' -> '.$processor_type."\n");
if (!$valid['processor'][$processor_type][$processor_index]) {
echo '-';

View File

@@ -60,9 +60,7 @@ if (is_array($hrDevice_array)) {
$old_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('hrProcessor-'.$index.'.rrd');
$new_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('processor-hr-'.$index.'.rrd');
if ($debug) {
echo "$old_rrd $new_rrd";
}
d_echo("$old_rrd $new_rrd");
if (is_file($old_rrd)) {
rename($old_rrd, $new_rrd);

View File

@@ -3,9 +3,7 @@
if ($device['os_group'] == 'cisco' || $device['os'] == 'acsw') {
echo 'CISCO-PROCESS-MIB: ';
$processors_array = snmpwalk_cache_oid($device, 'cpmCPU', null, 'CISCO-PROCESS-MIB');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
foreach ($processors_array as $index => $entry) {
if (is_numeric($entry['cpmCPUTotal5minRev']) || is_numeric($entry['cpmCPUTotal5min'])) {
@@ -34,9 +32,7 @@ if ($device['os_group'] == 'cisco' || $device['os'] == 'acsw') {
if (is_file($old_rrd)) {
rename($old_rrd, $new_rrd);
if ($debug) {
echo "$old_rrd $new_rrd";
}
d_echo("$old_rrd $new_rrd");
echo 'Moved RRD ';
}

View File

@@ -3,9 +3,7 @@
if ($device['os'] == 'ironware' || $device['os_group'] == 'ironware') {
echo 'IronWare : ';
$processors_array = snmpwalk_cache_triple_oid($device, 'snAgentCpuUtilEntry', $processors_array, 'FOUNDRY-SN-AGENT-MIB');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
foreach ($processors_array as $index => $entry) {
if (($entry['snAgentCpuUtilValue'] || $entry['snAgentCpuUtil100thPercent']) && $entry['snAgentCpuUtilInterval'] == '300') {

View File

@@ -7,9 +7,7 @@ if ($device['os'] == 'junos') {
$processors_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDRAMSize', $processors_array, 'JUNIPER-MIB', '+'.$config['install_dir'].'/mibs/junos');
$processors_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingMemory', $processors_array, 'JUNIPER-MIB', '+'.$config['install_dir'].'/mibs/junos');
$processors_array = snmpwalk_cache_multi_oid($device, 'jnxOperatingDescr', $processors_array, 'JUNIPER-MIB', '+'.$config['install_dir'].'/mibs/junos');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
if (is_array($processors_array)) {
foreach ($processors_array as $index => $entry) {
@@ -18,9 +16,7 @@ if ($device['os'] == 'junos') {
continue;
}
if ($debug) {
echo $index.' '.$entry['jnxOperatingDescr'].' -> '.$entry['jnxOperatingCPU'].' -> '.$entry['jnxOperatingDRAMSize']."\n";
}
d_echo($index.' '.$entry['jnxOperatingDescr'].' -> '.$entry['jnxOperatingCPU'].' -> '.$entry['jnxOperatingDRAMSize']."\n");
$usage_oid = '.1.3.6.1.4.1.2636.3.1.13.1.8.'.$index;
$descr = $entry['jnxOperatingDescr'];
@@ -33,9 +29,7 @@ if ($device['os'] == 'junos') {
}
$srx_processors_array = snmpwalk_cache_multi_oid($device, 'jnxJsSPUMonitoringCPUUsage', $srx_processors_array, 'JUNIPER-SRX5000-SPU-MONITORING-MIB', '+'.$config['install_dir'].'/mibs/junos');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
if (is_array($srx_processors_array)) {
foreach ($srx_processors_array as $index => $entry) {

View File

@@ -4,9 +4,7 @@
if ($device['os'] == 'junose') {
echo 'JUNOSe : ';
$processors_array = snmpwalk_cache_double_oid($device, 'juniSystemModule', $processors_array, 'Juniper-System-MIB', $config['install_dir'].'/mibs/junose');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
foreach ($processors_array as $index => $entry) {
if ($entry['juniSystemModuleCpuUtilPct'] && $entry['juniSystemModuleCpuUtilPct'] != '-1') {

View File

@@ -6,16 +6,12 @@ if ($device['os'] == 'vrp') {
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityCpuUsage', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityBomEnDesc', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', '+'.$config['install_dir'].'/mibs');
if ($debug) {
print_r($processors_array);
}
d_echo($processors_array);
if (is_array($processors_array)) {
foreach ($processors_array as $index => $entry) {
if ($entry['hwEntityMemSize'] != 0) {
if ($debug) {
echo $index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityCpuUsage'].' -> '.$entry['hwEntityMemSize']."\n";
}
d_echo($index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityCpuUsage'].' -> '.$entry['hwEntityMemSize']."\n");
$usage_oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.'.$index;
$descr = $entry['hwEntityBomEnDesc'];

View File

@@ -17,9 +17,7 @@ echo 'States: ';
$include_dir = 'includes/discovery/states';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['states']);
}
d_echo($valid['sensor']['states']);
check_valid_sensors($device, 'states', $valid['sensor']);

View File

@@ -15,9 +15,7 @@
if ($device['os'] == 'linux') {
$oids = snmp_walk($device, 'virtualDiskNumber', '-Oesqn', 'StorageManagement-MIB');
$main_oid = '.1.3.6.1.4.1.674.10893.1.20.140.1.1.';
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -15,9 +15,7 @@
if ($device['os'] == "drac") {
$oids = snmp_walk($device, "virtualDiskNumber", "-Oesqn", "IDRAC-MIB-SMIv2");
$main_oid = ".1.3.6.1.4.1.674.10892.5.5.1.20.140.1.1.";
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
echo "Dell iDRAC";

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.2', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {
@@ -27,9 +25,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.3', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {

View File

@@ -9,16 +9,12 @@ require 'includes/include-dir.inc.php';
// Remove storage which weren't redetected here
$sql = "SELECT * FROM `storage` WHERE `device_id` = '".$device['device_id']."'";
if ($debug) {
print_r($valid_storage);
}
d_echo($valid_storage);
foreach (dbFetchRows($sql) as $test_storage) {
$storage_index = $test_storage['storage_index'];
$storage_mib = $test_storage['storage_mib'];
if ($debug) {
echo $storage_index.' -> '.$storage_mib."\n";
}
d_echo($storage_index.' -> '.$storage_mib."\n");
if (!$valid_storage[$storage_mib][$storage_index]) {
echo '-';

View File

@@ -36,49 +36,37 @@ if (is_array($hrstorage_array)) {
foreach ($config['ignore_mount'] as $bi) {
if ($bi == $descr) {
$deny = 1;
if ($debug) {
echo "$bi == $descr \n";
}
d_echo("$bi == $descr \n");
}
}
foreach ($config['ignore_mount_string'] as $bi) {
if (strpos($descr, $bi) !== false) {
$deny = 1;
if ($debug) {
echo "strpos: $descr, $bi \n";
}
d_echo("strpos: $descr, $bi \n");
}
}
foreach ($config['ignore_mount_regexp'] as $bi) {
if (preg_match($bi, $descr) > '0') {
$deny = 1;
if ($debug) {
echo "preg_match $bi, $descr \n";
}
d_echo("preg_match $bi, $descr \n");
}
}
if (isset($config['ignore_mount_removable']) && $config['ignore_mount_removable'] && $fstype == 'hrStorageRemovableDisk') {
$deny = 1;
if ($debug) {
echo "skip(removable)\n";
}
d_echo("skip(removable)\n");
}
if (isset($config['ignore_mount_network']) && $config['ignore_mount_network'] && $fstype == 'hrStorageNetworkDisk') {
$deny = 1;
if ($debug) {
echo "skip(network)\n";
}
d_echo("skip(network)\n");
}
if (isset($config['ignore_mount_optical']) && $config['ignore_mount_optical'] && $fstype == 'hrStorageCompactDisc') {
$deny = 1;
if ($debug) {
echo "skip(cd)\n";
}
d_echo("skip(cd)\n");
}
if (!$deny && is_numeric($index)) {

View File

@@ -20,27 +20,21 @@ if (is_array($netapp_storage)) {
foreach ($config['ignore_mount'] as $bi) {
if ($bi == $descr) {
$deny = 1;
if ($debug) {
echo "$bi == $descr \n";
}
d_echo("$bi == $descr \n");
}
}
foreach ($config['ignore_mount_string'] as $bi) {
if (strpos($descr, $bi) !== false) {
$deny = 1;
if ($debug) {
echo "strpos: $descr, $bi \n";
}
d_echo("strpos: $descr, $bi \n");
}
}
foreach ($config['ignore_mount_regexp'] as $bi) {
if (preg_match($bi, $descr) > '0') {
$deny = 1;
if ($debug) {
echo "preg_match $bi, $descr \n";
}
d_echo("preg_match $bi, $descr \n");
}
}

View File

@@ -6,9 +6,7 @@ echo 'Temperatures: ';
$include_dir = 'includes/discovery/temperatures';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['temperature']);
}
d_echo($valid['sensor']['temperature']);
check_valid_sensors($device, 'temperature', $valid['sensor']);

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'akcp' || $device['os'] == 'minkelsrms') {
$oids = snmp_walk($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', '-Osqn', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -2,9 +2,7 @@
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";
}
d_echo($oids."\n");
if ($oids) {
echo 'APC UPS Internal ';
@@ -77,10 +75,8 @@ if ($device['os'] == 'apc') {
$set_oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.4.0', '-OsqnU', '');
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.10.0', '-OsqnU', '');
if ($debug) {
echo $set_oids."\n";
echo $oids."\n";
}
d_echo($oids."\n");
d_echo($set_oids."\n");
if ($oids !== false) {
echo 'APC Portable Supply Temp ';
@@ -103,9 +99,7 @@ if ($device['os'] == 'apc') {
unset($oids);
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.12.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids !== false) {
echo 'APC Portable Return Temp ';
@@ -128,10 +122,7 @@ if ($device['os'] == 'apc') {
unset($oids);
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.14.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids !== false) {
echo 'APC Portable Remote Temp ';
list($oid,$current_raw) = explode(' ', $oids);

View File

@@ -2,9 +2,7 @@
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";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
@@ -29,9 +27,7 @@ if ($device['os'] == 'areca') {
}
$oids = snmp_walk($device, '1.3.6.1.4.1.18928.1.2.2.1.10.1.2', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo 'Areca Controller ';

View File

@@ -14,7 +14,6 @@ if ($device['os'] == 'cometsystem-p85xx') {
/x';
$oids = snmp_walk($device, '.1.3.6.1.4.1.22626.1.5.2', '-OsqnU', '');
// if ($debug) { echo($oids."\n"); }
if ($oids) {
$out = array();
foreach (explode("\n", $oids) as $line) {

View File

@@ -27,9 +27,7 @@
if (strstr($device['hardware'], 'Dell')) {
// stuff partially copied from akcp sensor
$oids = snmp_walk($device, 'temperatureProbeStatus', '-Osqn', 'MIB-Dell-10892');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
@@ -40,9 +38,7 @@ if (strstr($device['hardware'], 'Dell')) {
$data = trim($data);
if ($data) {
list($oid,$status) = explode(' ', $data, 2);
if ($debug) {
echo 'status : '.$status."\n";
}
d_echo('status : '.$status."\n");
if ($status == 'ok') {
// 2 = normal, 0 = not connected

View File

@@ -13,9 +13,7 @@
if (strstr($device['os'], 'drac')) {
$oids = snmp_walk($device, 'temperatureProbeStatus', '-Osqn', 'IDRAC-MIB-SMIv2');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
@@ -26,9 +24,7 @@ if (strstr($device['os'], 'drac')) {
$data = trim($data);
if ($data) {
list($oid,$status) = explode(' ', $data, 2);
if ($debug) {
echo 'status : '.$status."\n";
}
d_echo('status : '.$status."\n");
if ($status == 'ok') {
$split_oid = explode('.', $oid);

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'linux') {
$oids = snmp_walk($device, 'lmTempSensorsDevice', '-Osqn', 'LM-SENSORS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -1,7 +1,5 @@
<?php
global $debug;
if ($device['os'] == 'mgeups') {
// blatently copyied from APC
echo 'MGE UPS External ';
@@ -52,9 +50,7 @@ if ($device['os'] == 'mgeups') {
$low_warn_limit = ($low_limit + $hysteresis);
$high_warn_limit = ($high_limit - $hysteresis);
if ($debug) {
echo "low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n";
}
d_echo("low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n"):
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '10', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, ($current / 10));
}

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'routeros') {
$oids = snmp_walk($device, 'mtxrHlTemperature', '-OsqnU', 'MIKROTIK-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids !== false) {
echo 'MIKROTIK-MIB ';

View File

@@ -3,9 +3,7 @@
if ($device['os'] == "netapp") {
$main_oid = ".1.3.6.1.4.1.789.1.21.1.2.1";
$oids = snmp_walk($device, $main_oid.'.25', "-Osqn");
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
echo "NetApp ";

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'netbotz') {
$oids = snmp_walk($device, '.1.3.6.1.4.1.5528.100.4.1.1.1.4', '-Osqn', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -4,9 +4,7 @@ if ($device['os_group'] == 'unix') {
// FIXME snmp_walk
// ObserverNMS-style temperature
$cmd = $config['snmpwalk'].' -M '.$config['mibdir'].' -M '.$config['mibdir'].' -m SNMPv2-SMI -Osqn -CI '.snmp_gen_auth($device).' '.$device['transport'].':'.$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";
if ($debug) {
echo "$cmd\n";
}
d_echo($cmd."\n");
$oids = shell_exec($cmd);
$oids = trim($oids);

View File

@@ -2,9 +2,7 @@
// RFC1628 UPS
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.7', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'sentry3') {
$oids = snmp_walk($device, 'tempHumidSensorTempValue', '-Osqn', 'Sentry3-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
$divisor = '10';

View File

@@ -3,9 +3,7 @@
if ($device['os'] == 'siklu') {
$oid = 'rbSysTemperature.0';
$oids = snmp_get($device, "$oid", '-OsqnU', 'RADIO-BRIDGE-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if (!empty($oids)) {
echo 'Siklu Temperature ';

View File

@@ -5,9 +5,7 @@ if ($device['os'] == 'powerware') {
// XUPS-MIB::xupsEnvAmbientLowerLimit.0 = INTEGER: 0
// XUPS-MIB::xupsEnvAmbientUpperLimit.0 = INTEGER: 70
$oids = snmp_walk($device, 'xupsEnvAmbientTemp', '-Osqn', 'XUPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -1,7 +1,5 @@
<?php
global $debug;
if ($config['enable_printers']) {
$valid_toner = array();
@@ -13,9 +11,7 @@ if ($config['enable_printers']) {
$oids = trim(snmp_walk($device, 'SNMPv2-SMI::mib-2.43.11.1.1.2.1 ', '-OsqnU'));
}
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo 'Jetdirect ';
@@ -49,10 +45,8 @@ if ($config['enable_printers']) {
}//end if
// Delete removed toners
if ($debug) {
echo "\n Checking ... \n";
print_r($valid_toner);
}
d_echo("\n Checking ... \n");
d_echo($valid_toner);
$sql = "SELECT * FROM toner WHERE device_id = '".$device['device_id']."'";
foreach (dbFetchRows($sql) as $test_toner) {

View File

@@ -3,20 +3,15 @@
echo 'UCD Disk IO : ';
$diskio_array = snmpwalk_cache_oid($device, 'diskIOEntry', array(), 'UCD-DISKIO-MIB', '+'.$config['install_dir'].'/mibs/');
$valid_diskio = array();
// if ($debug) { print_r($diskio_array); }
if (is_array($diskio_array)) {
foreach ($diskio_array as $index => $entry) {
if ($entry['diskIONRead'] > '0' || $entry['diskIONWritten'] > '0') {
if ($debug) {
echo "$index ".$entry['diskIODevice']."\n";
}
d_echo("$index ".$entry['diskIODevice']."\n");
if (dbFetchCell('SELECT COUNT(*) FROM `ucd_diskio` WHERE `device_id` = ? AND `diskio_index` = ?', array($device['device_id'], $index)) == '0') {
$inserted = dbInsert(array('device_id' => $device['device_id'], 'diskio_index' => $index, 'diskio_descr' => $entry['diskIODevice']), 'ucd_diskio');
echo '+';
if ($debug) {
echo $sql." - $inserted inserted ";
}
d_echo($sql." - $inserted inserted ");
}
else {
echo '.';
@@ -31,14 +26,10 @@ if (is_array($diskio_array)) {
// Remove diskio entries which weren't redetected here
$sql = "SELECT * FROM `ucd_diskio` where `device_id` = '".$device['device_id']."'";
if ($debug) {
print_r($valid_diskio);
}
d_echo($valid_diskio);
foreach (dbFetchRows($sql) as $test) {
if ($debug) {
echo $test['diskio_index'].' -> '.$test['diskio_descr']."\n";
}
d_echo($test['diskio_index'].' -> '.$test['diskio_descr']."\n");
if (!$valid_diskio[$test['diskio_index']]) {
echo '-';

View File

@@ -6,9 +6,7 @@ echo 'Voltages: ';
$include_dir = 'includes/discovery/voltages';
require 'includes/include-dir.inc.php';
if ($debug) {
print_r($valid['sensor']['voltage']);
}
d_echo($valid['sensor']['voltage']);
check_valid_sensors($device, 'voltage', $valid['sensor']);

View File

@@ -3,9 +3,7 @@
// APC Voltages
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";
}
d_echo($oids."\n");
if ($oids) {
echo 'APC In ';
@@ -27,9 +25,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.4.3.1.3', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC Out ';
@@ -54,9 +50,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.3.2.1.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC In ';
@@ -70,9 +64,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.4.2.1.0', '-OsqnU', '');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' APC Out ';
@@ -88,9 +80,7 @@ if ($device['os'] == 'apc') {
// PDU
// $oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.15.0", "-OsqnU", "");
$oids = snmp_walk($device, 'rPDUIdentDeviceLinetoLineVoltage.0', '-OsqnU', 'PowerNet-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' Voltage In ';
@@ -104,9 +94,7 @@ if ($device['os'] == 'apc') {
}
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.26.6.3.1.6', '-OsqnU', 'PowerNet-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo ' Voltage In ';

View File

@@ -3,9 +3,7 @@
// Areca Voltages
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";
}
d_echo($oids."\n");
if ($oids) {
echo 'Areca ';

View File

@@ -2,9 +2,7 @@
if ($device['os'] == "drac") {
$oids = snmp_walk($device, "powerSupplyIndex.1", "-OsqnU", "IDRAC-MIB-SMIv2");
if ($debug) {
echo($oids."\n");
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {
echo("Dell iDRAC");

View File

@@ -3,9 +3,7 @@
// LMSensors Voltages
if ($device['os'] == 'linux') {
$oids = snmp_walk($device, 'lmVoltSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo 'LM-SENSORS ';

View File

@@ -4,9 +4,7 @@
if ($device['os'] == 'mgeups') {
echo 'MGE ';
$oids = trim(snmp_walk($device, 'mgoutputVoltage', '-OsqnU', 'MG-SNMP-UPS-MIB'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {
@@ -31,9 +29,7 @@ if ($device['os'] == 'mgeups') {
}
$oids = trim(snmp_walk($device, 'mgeinputVoltage', '-OsqnU', 'MG-SNMP-UPS-MIB'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$numPhase = count(explode("\n", $oids));
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -2,9 +2,7 @@
if ($device['os'] == "routeros") {
$oids = snmp_walk($device, "mtxrHlVoltage", "-OsqnU", "MIKROTIK-MIB");
if ($debug) {
echo($oids."\n");
}
d_echo($oids."\n");
if ($oids !== false) echo("MIKROTIK-MIB ");
$divisor = 10.0;
$type = "mikrotik";

View File

@@ -5,9 +5,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
echo 'RFC1628 ';
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.5', '-Osqn', 'UPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {
@@ -31,9 +29,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -55,9 +51,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -79,9 +73,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
}
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {

View File

@@ -2,9 +2,7 @@
if ($device['os'] == 'sentry3') {
$oids = snmp_walk($device, 'infeedVoltage', '-OsqnU', 'Sentry3-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if ($oids) {
echo 'Sentry3-MIB ';

View File

@@ -3,9 +3,7 @@
if ($device['os'] == 'siklu') {
$oid = 'rbSysVoltage.0';
$oids = snmp_walk($device, "$oid", '-OsqnU', 'RADIO-BRIDGE-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
if (!empty($oids)) {
echo 'Siklu Voltage ';

View File

@@ -3,9 +3,7 @@
// Supermicro Voltages
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";
}
d_echo($oids."\n");
$oids = trim($oids);
if ($oids) {

View File

@@ -6,9 +6,7 @@ if ($device['os'] == 'powerware') {
// XUPS-MIB::xupsBatVoltage.0 = INTEGER: 51
$oids = snmp_walk($device, 'xupsBatVoltage', '-Osqn', 'XUPS-MIB');
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
$oids = trim($oids);
foreach (explode("\n", $oids) as $data) {
@@ -30,9 +28,7 @@ if ($device['os'] == 'powerware') {
// XUPS-MIB::xupsInputNumPhases.0 = INTEGER: 1
$oids = trim(snmp_walk($device, 'xupsInputNumPhases', '-OsqnU', 'XUPS-MIB'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -53,9 +49,7 @@ if ($device['os'] == 'powerware') {
// XUPS-MIB::xupsOutputNumPhases.0 = INTEGER: 1
$oids = trim(snmp_walk($device, 'xupsOutputNumPhases', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {
@@ -76,9 +70,7 @@ if ($device['os'] == 'powerware') {
// XUPS-MIB::xupsBypassNumPhases.0 = INTEGER: 1
$oids = trim(snmp_walk($device, 'xupsBypassNumPhases', '-OsqnU'));
if ($debug) {
echo $oids."\n";
}
d_echo($oids."\n");
list($unused,$numPhase) = explode(' ', $oids);
for ($i = 1; $i <= $numPhase; $i++) {