<?php global $debug; if ($device['os'] == 'mgeups') { // blatently copyied from APC echo 'MGE UPS External '; // Environmental monitoring on UPSes etc // FIXME upsmgConfigEnvironmentTable and upsmgEnvironmentSensorTable are used but there are others ... $mge_env_data = snmpwalk_cache_oid($device, 'upsmgConfigEnvironmentTable', array(), 'MG-SNMP-UPS-MIB'); $mge_env_data = snmpwalk_cache_oid($device, 'upsmgEnvironmentSensorTable', $mge_env_data, 'MG-SNMP-UPS-MIB'); /* upsmgConfigSensorIndex.1 = 1 upsmgConfigSensorName.1 = "Environment sensor" upsmgConfigTemperatureLow.1 = 5 upsmgConfigTemperatureHigh.1 = 40 upsmgConfigTemperatureHysteresis.1 = 2 upsmgConfigHumidityLow.1 = 5 upsmgConfigHumidityHigh.1 = 90 upsmgConfigHumidityHysteresis.1 = 5 upsmgConfigInput1Name.1 = "Input #1" upsmgConfigInput1ClosedLabel.1 = "closed" upsmgConfigInput1OpenLabel.1 = "open" upsmgConfigInput2Name.1 = "Input #2" upsmgConfigInput2ClosedLabel.1 = "closed" upsmgConfigInput2OpenLabel.1 = "open" upsmgEnvironmentIndex.1 = 1 upsmgEnvironmentComFailure.1 = no upsmgEnvironmentTemperature.1 = 287 upsmgEnvironmentTemperatureLow.1 = no upsmgEnvironmentTemperatureHigh.1 = no
<?php # NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1 # NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966 # NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166 # NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803 # NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704 # NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104 # NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728 if (!is_array($mempool_cache['hpGlobal'])) { $mempool_cache['hpGlobal'] = snmpwalk_cache_oid($device, "hpGlobal", NULL, "NETSWITCH-MIB", mib_dirs('hp')); if ($debug) { print_r($mempool_cache); } } else { if ($debug) { echo "Cached!"; } } $entry = $mempool_cache['hpGlobal'][$mempool[mempool_index]]; $mempool['units'] = "1"; $mempool['used'] = $entry['hpGlobalMemAllocBytes']; $mempool['total'] = $entry['hpGlobalMemTotalBytes']; $mempool['free'] = $entry['hpGlobalMemFreeBytes'];
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage poller * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // IEEE802dot11-MIB::dot11manufacturerProductName.5 = STRING: UAP-LR // IEEE802dot11-MIB::dot11manufacturerProductVersion.5 = STRING: BZ.ar7240.v3.1.9.2442.131217.1549 $data = snmpwalk_cache_oid($device, 'dot11manufacturerProductName', array(), 'IEEE802dot11-MIB'); if ($data) { $data = snmpwalk_cache_oid($device, 'dot11manufacturerProductVersion', $data, 'IEEE802dot11-MIB'); $data = current($data); $hardware = 'Unifi ' . $data['dot11manufacturerProductName']; list(, $version) = preg_split('/\\.v/', $data['dot11manufacturerProductVersion']); } // EOF
$version = $data[1]['entPhysicalSoftwareRev']; } if (isset($data[1]['entPhysicalName']) && $data[1]['entPhysicalName'] != '') { $hardware = $data[1]['entPhysicalName']; } if (isset($data[1]['entPhysicalModelName']) && $data[1]['entPhysicalModelName'] != '') { $hardware = $data[1]['entPhysicalModelName']; } if (empty($hardware)) { $hardware = snmp_get($device, 'sysObjectID.0', '-Osqv', 'SNMPv2-MIB:CISCO-PRODUCTS-MIB'); } $stats = snmpwalk_cache_oid($device, "bsnAPEntry", $stats, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsb'); $radios = snmpwalk_cache_oid($device, "bsnAPIfEntry", $radios, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsb'); $APstats = snmpwalk_cache_oid($device, 'bsnApIfNoOfUsers', $APstats, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsxb'); $loadParams = snmpwalk_cache_oid($device, "bsnAPIfLoadChannelUtilization", $loadParams, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsb'); $interferences = snmpwalk_cache_oid($device, "bsnAPIfInterferencePower", $interferences, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsb'); $numAccessPoints = count($stats); $numClients = 0; foreach ($APstats as $key => $value) { $numClients += $value['bsnApIfNoOfUsers']; } $rrd_def = array('DS:NUMAPS:GAUGE:600:0:12500000000', 'DS:NUMCLIENTS:GAUGE:600:0:12500000000'); $fields = array('NUMAPS' => $numAccessPoints, 'NUMCLIENTS' => $numClients); $tags = compact('rrd_def'); data_update($device, 'ciscowlc', $tags, $fields); // also save the info about how many clients in the same place as the wireless module $radio = 1; $rrd_name = 'wificlients-radio' . $radio; $rrd_def = 'DS:wificlients:GAUGE:600:-273:10000'; $fields = array('wificlients' => $numClients); $tags = compact('radio', 'rrd_name', 'rrd_def');
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage poller * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // EMBEDDED-NGX-MIB if (!is_array($cache_storage['embedded-ngx-mib'])) { $cache_storage['embedded-ngx-mib'] = snmpwalk_cache_oid($device, "swStorage", NULL, "EMBEDDED-NGX-MIB"); if (OBS_DEBUG && count($cache_storage['embedded-ngx-mib'])) { print_vars($cache_storage['embedded-ngx-mib']); } } $entry = $cache_storage['embedded-ngx-mib'][$storage['storage_index']]; $storage['units'] = 1024; $storage['size'] = $entry['swStorageConfigTotal'] * $storage['units']; $storage['free'] = $entry['swStorageConfigFree'] * $storage['units']; $storage['used'] = $storage['size'] - $storage['free']; // EOF
// isDeviceConfigHumidityHysteresis.2 = INTEGER: 500 // 32768 = No sensor connected if ($value != 32768 && $value != '') { discover_sensor($valid['sensor'], 'humidity', $device, $oid, "isDeviceMonitorHumidity.{$index}", 'ispro-mib', $descr, 0.01, $value, $options); } $oid = ".1.3.6.1.4.1.19011.1.3.2.1.3.1.2.1.4.{$index}"; $value = $entry['isDeviceMonitorHumidityAlarm']; // isDeviceMonitorHumidityAlarm.1 = INTEGER: normal(3) // unknown = No sensor connected if ($value != 'unknown' && $value != '') { discover_sensor($valid['sensor'], 'state', $device, $oid, "isDeviceMonitorHumidityAlarm.{$index}", 'ispro-mib-threshold-state', $descr, 1, $value); } } } $oids = snmpwalk_cache_oid($device, 'isDeviceMonitorDigitalInTable', array(), 'ISPRO-MIB'); $oids = snmpwalk_cache_oid($device, 'isDeviceConfigDigitalInTable', $oids, 'ISPRO-MIB'); foreach ($oids as $index => $entry) { // Unfortunately, there is no (direct) SNMP link between the sensors connected above, even though they are represented together in the Web UI. // Unless we use a ugly "divide by 2" hack, we can't know if these alerts are meant to be "not displayed" like we do for Temp/Humidity. // If you don't want digital sensors displayed, make sure they are set to Disabled and not Normal Open or Normal Close. // isDeviceMonitorDigitalInIndex.1 = INTEGER: 1 // isDeviceMonitorDigitalInName.1 = STRING: "Alarm1-1" // isDeviceMonitorDigitalIn.1 = INTEGER: inactive(2) // isDeviceMonitorDigitalInAlarm.1 = INTEGER: normal(1) $descr = $entry['isDeviceMonitorDigitalInName']; $oid = "1.3.6.1.4.1.19011.1.3.2.1.3.1.3.1.4.{$index}"; $value = $entry['isDeviceMonitorDigitalInAlarm']; if ($entry['isDeviceConfigDigitalInState'] != 'disabled' && $value != '') { discover_sensor($valid['sensor'], 'state', $device, $oid, "isDeviceMonitorDigitalInAlarm.{$index}", 'ispro-mib-trigger-state', $descr, 1, $value); } }
if (isset($data[1]['entPhysicalName']) && $data[1]['entPhysicalName'] != '') { $hardware = $data[1]['entPhysicalName']; } if (isset($data[1]['entPhysicalModelName']) && $data[1]['entPhysicalModelName'] != '') { $hardware = $data[1]['entPhysicalModelName']; } if (empty($hardware)) { $hardware = snmp_get($device, 'sysObjectID.0', '-Osqv', 'SNMPv2-MIB:CISCO-PRODUCTS-MIB'); } $oids_AP_Name = array('bsnAPName'); $oids_AP_Users = array('bsnApIfNoOfUsers'); foreach ($oids_AP_Name as $oid) { $stats = snmpwalk_cache_oid($device, $oid, $stats, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsxb'); } foreach ($oids_AP_Users as $oid) { $APstats = snmpwalk_cache_oid($device, $oid, $APstats, 'AIRESPACE-WIRELESS-MIB', null, '-OQUsxb'); } $numAccessPoints = count($stats); $numClients = 0; foreach ($APstats as $key => $value) { $numClients += $value['bsnApIfNoOfUsers']; } $rrdfile = $host_rrd . '/ciscowlc' . safename('.rrd'); if (!is_file($rrdfile)) { rrdtool_create($rrdfile, ' --step 300 DS:NUMAPS:GAUGE:600:0:12500000000 DS:NUMCLIENTS:GAUGE:600:0:12500000000 ' . $config['rrd_rra']); } $fields = array('NUMAPS' => $numAccessPoints, 'NUMCLIENTS' => $numClients); $ret = rrdtool_update($rrdfile, $fields); // also save the info about how many clients in the same place as the wireless module $wificlientsrrd = $config['rrd_dir'] . '/' . $device['hostname'] . '/' . safename('wificlients-radio1.rrd'); if (!is_file($wificlientsrrd)) {
echo " IP"; // These are at the start of large trees that we don't want to walk the entirety of, so we snmp_get_multi them $oids_gauge = array('tcpCurServerConn', 'tcpCurClientConn', 'tcpActiveServerConn', 'tcpCurClientConnClosing', 'tcpCurServerConnEstablished', 'tcpCurClientConnOpening', 'tcpCurClientConnEstablished', 'tcpCurServerConnClosing', 'tcpSpareConn', 'tcpSurgeQueueLen', 'tcpCurServerConnOpening', 'tcpCurPhysicalServers', 'tcpReuseHit'); $oids_counter = array('tcpTotServerConnOpened', 'tcpTotServerConnClosed', 'tcpTotClientConnOpened', 'tcpTotClientConnClosed', 'tcpTotSyn', 'tcpTotSynProbe', 'tcpTotSvrFin', 'tcpTotCltFin', 'tcpTotRxPkts', 'tcpTotRxBytes', 'tcpTotTxPkts', 'tcpTotTxBytes', 'tcpWaitToSyn', 'tcpTotZombieCltConnFlushed', 'tcpTotZombieSvrConnFlushed', 'tcpTotZombieHalfOpenCltConnFlushed', 'tcpTotZombieHalfOpenSvrConnFlushed', 'tcpTotZombieActiveHalfCloseCltConnFlushed', 'tcpTotZombieActiveHalfCloseSvrConnFlushed', 'tcpTotZombiePassiveHalfCloseCltConnFlushed', 'tcpTotZombiePassiveHalfCloseSrvConnFlushed', 'tcpErrBadCheckSum', 'tcpErrSynInSynRcvd', 'tcpErrSynInEst', 'tcpErrSynGiveUp', 'tcpErrSynSentBadAck', 'tcpErrSynRetry', 'tcpErrFinRetry', 'tcpErrFinGiveUp', 'tcpErrFinDup', 'tcpErrRst', 'tcpErrRstNonEst', 'tcpErrRstOutOfWindow', 'tcpErrRstInTimewait', 'tcpErrSvrRetrasmit', 'tcpErrCltRetrasmit', 'tcpErrFullRetrasmit', 'tcpErrPartialRetrasmit', 'tcpErrSvrOutOfOrder', 'tcpErrCltOutOfOrder', 'tcpErrCltHole', 'tcpErrSvrHole', 'tcpErrCookiePktSeqReject', 'tcpErrCookiePktSigReject', 'tcpErrCookiePktSeqDrop', 'tcpErrCookiePktMssReject', 'tcpErrRetransmit', 'tcpErrRetransmitGiveUp', 'pcbTotZombieCall', 'tcpTotSynHeld', 'tcpTotSynFlush', 'tcpTotFinWaitClosed', 'tcpErrAnyPortFail', 'tcpErrIpPortFail', 'tcpErrSentRst', 'tcpErrBadStateConn', 'tcpErrFastRetransmissions', 'tcpErrFirstRetransmissions', 'tcpErrSecondRetransmissions', 'tcpErrThirdRetransmissions', 'tcpErrForthRetransmissions', 'tcpErrFifthRetransmissions', 'tcpErrSixthRetransmissions', 'tcpErrSeventhRetransmissions', 'tcpErrDataAfterFin', 'tcpErrRstThreshold', 'tcpErrOutOfWindowPkts', 'tcpErrSynDroppedCongestion', 'tcpWaitData', 'tcpErrStrayPkt'); $oids = array_merge($oids_gauge, $oids_counter); unset($snmpstring, $rrdupdate, $snmpdata, $snmpdata_cmd, $rrd_create); $rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/netscaler-stats-tcp.rrd"; foreach ($oids_gauge as $oid) { $oid_ds = truncate(str_replace("tcp", "", str_replace("Active", "Ac", str_replace("Passive", "Ps", str_replace("Zombie", "Zom", $oid)))), 19, ''); $rrd_create .= " DS:{$oid_ds}:GAUGE:600:U:100000000000"; } foreach ($oids_counter as $oid) { $oid_ds = truncate(str_replace("tcp", "", str_replace("Active", "Ac", str_replace("Passive", "Ps", str_replace("Zombie", "Zom", $oid)))), 19, ''); $rrd_create .= " DS:{$oid_ds}:COUNTER:600:U:100000000000"; } $data = snmpwalk_cache_oid($device, "nsTcpStatsGroup", array(), "NS-ROOT-MIB"); $rrdupdate = "N"; foreach ($oids as $oid) { if (is_numeric($data[0][$oid])) { $rrdupdate .= ":" . $data[0][$oid]; } else { $rrdupdate .= ":U"; } } if (!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); } rrdtool_update($rrd_file, $rrdupdate); $graphs['netscaler_tcp_conn'] = TRUE; $graphs['netscaler_tcp_bits'] = TRUE; $graphs['netscaler_tcp_pkts'] = TRUE;
<?php global $debug; if ($device['os'] == "mgeups") { # blatently copyied from APC echo "MGE UPS External "; # Environmental monitoring on UPSes etc // FIXME upsmgConfigEnvironmentTable and upsmgEnvironmentSensorTable are used but there are others ... $mge_env_data = snmpwalk_cache_oid($device, "upsmgConfigEnvironmentTable", array(), "MG-SNMP-UPS-MIB"); $mge_env_data = snmpwalk_cache_oid($device, "upsmgEnvironmentSensorTable", $mge_env_data, "MG-SNMP-UPS-MIB"); /* upsmgConfigSensorIndex.1 = 1 upsmgConfigSensorName.1 = "Environment sensor" upsmgConfigTemperatureLow.1 = 5 upsmgConfigTemperatureHigh.1 = 40 upsmgConfigTemperatureHysteresis.1 = 2 upsmgConfigHumidityLow.1 = 5 upsmgConfigHumidityHigh.1 = 90 upsmgConfigHumidityHysteresis.1 = 5 upsmgConfigInput1Name.1 = "Input #1" upsmgConfigInput1ClosedLabel.1 = "closed" upsmgConfigInput1OpenLabel.1 = "open" upsmgConfigInput2Name.1 = "Input #2" upsmgConfigInput2ClosedLabel.1 = "closed" upsmgConfigInput2OpenLabel.1 = "open" upsmgEnvironmentIndex.1 = 1 upsmgEnvironmentComFailure.1 = no upsmgEnvironmentTemperature.1 = 287 upsmgEnvironmentTemperatureLow.1 = no upsmgEnvironmentTemperatureHigh.1 = no
<?php echo " hrDevice: "; $hrDevice_oids = array('hrDevice', 'hrProcessorLoad'); unset($hrDevice_array); foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmpwalk_cache_oid($device, $oid, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); } if (is_array($hrDevice_array)) { foreach ($hrDevice_array as $index => $entry) { # Workaround bsnmpd reporting CPUs as hrDeviceOther (f**k you, FreeBSD.) if ($entry['hrDeviceType'] == "hrDeviceOther" && preg_match('/^cpu[0-9]+:/', $entry['hrDeviceDescr'])) { $entry['hrDeviceType'] = "hrDeviceProcessor"; } if ($entry['hrDeviceType'] == "hrDeviceProcessor") { $hrDeviceIndex = $entry['hrDeviceIndex']; $usage_oid = ".1.3.6.1.2.1.25.3.3.1.2." . $index; $usage = $entry['hrProcessorLoad']; // What is this for? I have forgotten. What has : in its hrDeviceDescr? // Set description to that found in hrDeviceDescr, first part only if containing a : $descr_array = explode(":", $entry['hrDeviceDescr']); if ($descr_array['1']) { $descr = $descr_array['1']; } else { $descr = $descr_array['0']; } // Workaround to set fake description for Mikrotik who don't populate hrDeviceDescr if ($device['os'] == "routeros" && !isset($entry['hrDeviceDescr'])) { $descr = "Processor"; } // Workaround to set fake description for Engenius who don't populate hrDeviceDescr
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage discovery * @copyright (C) 2006-2014 Adam Armstrong * */ // Note. $cache_discovery['ucd-snmp-mib'] - is cached 'UCD-SNMP-MIB::dskEntry' (see ucd-snmp-mib.inc.php in current directory) $mib = 'HOST-RESOURCES-MIB'; if (!isset($cache_discovery['host-resources-mib'])) { $cache_discovery['host-resources-mib'] = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES", mib_dirs()); if (OBS_DEBUG && count($cache_discovery['host-resources-mib'])) { print_vars($cache_discovery['host-resources-mib']); } } if (count($cache_discovery['host-resources-mib'])) { echo " {$mib} "; foreach ($cache_discovery['host-resources-mib'] as $index => $storage) { $hc = 0; $mib = 'HOST-RESOURCES-MIB'; $fstype = $storage['hrStorageType']; $descr = $storage['hrStorageDescr']; $units = $storage['hrStorageAllocationUnits']; $deny = FALSE; switch ($fstype) { case 'hrStorageVirtualMemory':
<?php $cpe_oids = array('cpeExtPsePortEnable', 'cpeExtPsePortDiscoverMode', 'cpeExtPsePortDeviceDetected', 'cpeExtPsePortIeeePd', 'cpeExtPsePortAdditionalStatus', 'cpeExtPsePortPwrMax', 'cpeExtPsePortPwrAllocated', 'cpeExtPsePortPwrAvailable', 'cpeExtPsePortPwrConsumption', 'cpeExtPsePortMaxPwrDrawn', 'cpeExtPsePortEntPhyIndex', 'cpeExtPsePortEntPhyIndex', 'cpeExtPsePortPolicingCapable', 'cpeExtPsePortPolicingEnable', 'cpeExtPsePortPolicingAction', 'cpeExtPsePortPwrManAlloc'); $peth_oids = array('pethPsePortAdminEnable', 'pethPsePortPowerPairsControlAbility', 'pethPsePortPowerPairs', 'pethPsePortDetectionStatus', 'pethPsePortPowerPriority', 'pethPsePortMPSAbsentCounter', 'pethPsePortType', 'pethPsePortPowerClassifications', 'pethPsePortInvalidSignatureCounter', 'pethPsePortPowerDeniedCounter', 'pethPsePortOverLoadCounter', 'pethPsePortShortCounter', 'pethMainPseConsumptionPower'); $port_stats = snmpwalk_cache_oid($device, 'pethPsePortEntry', $port_stats, 'POWER-ETHERNET-MIB'); $port_stats = snmpwalk_cache_oid($device, 'cpeExtPsePortEntry', $port_stats, 'CISCO-POWER-ETHERNET-EXT-MIB'); if ($port_stats[$port['ifIndex']] && $port['ifType'] == 'ethernetCsmacd' && isset($port_stats[$port['ifIndex']]['dot3StatsIndex'])) { // Check to make sure Port data is cached. $this_port =& $port_stats[$port['ifIndex']]; $rrdfile = $config['rrd_dir'] . '/' . $device['hostname'] . '/' . safename('port-' . $port['ifIndex'] . '-poe.rrd'); if (!file_exists($rrdfile)) { $rrd_create .= $config['rrd_rra']; // FIXME CISCOSPECIFIC $rrd_create .= ' DS:PortPwrAllocated:GAUGE:600:0:U'; $rrd_create .= ' DS:PortPwrAvailable:GAUGE:600:0:U'; $rrd_create .= ' DS:PortConsumption:DERIVE:600:0:U'; $rrd_create .= ' DS:PortMaxPwrDrawn:GAUGE:600:0:U '; rrdtool_create($rrdfile, $rrd_create); } $upd = "{$polled}:" . $port['cpeExtPsePortPwrAllocated'] . ':' . $port['cpeExtPsePortPwrAvailable'] . ':' . $port['cpeExtPsePortPwrConsumption'] . ':' . $port['cpeExtPsePortMaxPwrDrawn']; $ret = rrdtool_update("{$rrdfile}", $upd); echo 'PoE '; } //end if
/** * Observium * * This file is part of Observium. * * @package observium * @subpackage discovery * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $cml['temp'] = snmpwalk_cache_oid($device, 'scEnclTempTable', array(), 'COMPELLENT-MIB'); $cml['fan'] = snmpwalk_cache_oid($device, 'scEnclFanTable', array(), 'COMPELLENT-MIB'); $cml['ctrl'] = snmpwalk_cache_oid($device, 'scCtlrEntry', array(), 'COMPELLENT-MIB'); $cml['disk'] = snmpwalk_cache_oid($device, 'scDiskEntry', array(), 'COMPELLENT-MIB'); $cml['cache'] = snmpwalk_cache_oid($device, 'ScCacheEntry', array(), 'COMPELLENT-MIB'); foreach ($cml['temp'] as $index => $entry) { $oid = '.1.3.6.1.4.1.16139.2.23.1.5.' . $index; $descr = $entry['scEnclTempLocation']; $value = $entry['scEnclTempCurrentC']; if (is_numeric($value)) { discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'compellent', $descr, 1, $value); } } foreach ($cml['fan'] as $index => $entry) { $oid = '.1.3.6.1.4.1.16139.2.20.1.3.' . $index; $descr = $entry['scEnclFanLocation']; $value = $entry['scEnclFanStatus']; if ($value) { discover_status($device, $oid, 'scEnclFanStatus.' . $index, 'compellent-mib-state', $descr, $value, array('entPhysicalClass' => 'fan')); }
$netstats_poll['snmp']['oids'] = array('snmpInPkts', 'snmpOutPkts', 'snmpInBadVersions', 'snmpInBadCommunityNames', 'snmpInBadCommunityUses', 'snmpInASNParseErrs', 'snmpInTooBigs', 'snmpInNoSuchNames', 'snmpInBadValues', 'snmpInReadOnlys', 'snmpInGenErrs', 'snmpInTotalReqVars', 'snmpInTotalSetVars', 'snmpInGetRequests', 'snmpInGetNexts', 'snmpInSetRequests', 'snmpInGetResponses', 'snmpInTraps', 'snmpOutTooBigs', 'snmpOutNoSuchNames', 'snmpOutBadValues', 'snmpOutGenErrs', 'snmpOutGetRequests', 'snmpOutGetNexts', 'snmpOutSetRequests', 'snmpOutGetResponses', 'snmpOutTraps', 'snmpSilentDrops', 'snmpProxyDrops'); foreach ($netstats_poll as $type => $netstats) { $oids = $netstats['oids']; if (isset($netstats['oids_t'])) { $oids_string = implode('.0 ', $netstats['oids_t']) . '.0'; $data = snmp_get_multi($device, $oids_string, '-OQUs', $netstats['mib'], mib_dirs()); // get testing oids if (!count($data)) { continue; } $data_array = $data[0]; $oids_string = implode('.0 ', array_diff($oids, $netstats['oids_t'])) . '.0'; $data = snmp_get_multi($device, $oids_string, '-OQUs', $netstats['mib'], mib_dirs()); $data_array += $data[0]; } else { $data = snmpwalk_cache_oid($device, $type, array(), $netstats['mib'], mib_dirs()); if (!count($data)) { continue; } $data_array = $data[0]; } echo strtoupper($type) . ' '; $rrd_file = $config['rrd_dir'] . '/' . $device['hostname'] . '/netstats-' . $type . '.rrd'; $rrd_create = ''; $rrd_update = 'N'; foreach ($oids as $oid) { $oid_ds = truncate($oid, 19, ''); $rrd_create .= ' DS:' . $oid_ds . ':COUNTER:600:U:4294967295'; // Counter32 max value 2^32 = 4294967295 $value = is_numeric($data_array[$oid]) ? $data_array[$oid] : 'U'; $rrd_update .= ':' . $value;
if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') { global $config; echo 'Aruba Controller: '; $polled = time(); // Build SNMP Cache Array // stuff about the controller $switch_info_oids = array('wlsxSwitchRole', 'wlsxSwitchMasterIp'); $switch_counter_oids = array('wlsxSwitchTotalNumAccessPoints.0', 'wlsxSwitchTotalNumStationsAssociated.0'); $switch_apinfo_oids = array('wlsxWlanRadioEntry', 'wlanAPChInterferenceIndex'); $switch_apname_oids = array('wlsxWlanRadioEntry.16'); $aruba_oids = array_merge($switch_info_oids, $switch_counter_oids); echo 'Caching Oids: '; foreach ($aruba_oids as $oid) { echo "{$oid} "; $aruba_stats = snmpwalk_cache_oid($device, $oid, $aruba_stats, 'WLSX-SWITCH-MIB'); } foreach ($switch_apinfo_oids as $oid) { echo "{$oid} "; $aruba_apstats = snmpwalk_cache_oid_num($device, $oid, $aruba_apstats, 'WLSX-WLAN-MIB'); } foreach ($switch_apname_oids as $oid) { echo "{$oid} "; $aruba_apnames = snmpwalk_cache_oid_num($device, $oid, $aruba_apnames, 'WLSX-WLAN-MIB'); } echo "\n"; $rrdfile = $host_rrd . '/aruba-controller' . safename('.rrd'); if (!is_file($rrdfile)) { rrdtool_create($rrdfile, ' --step 300 DS:NUMAPS:GAUGE:600:0:12500000000 DS:NUMCLIENTS:GAUGE:600:0:12500000000 ' . $config['rrd_rra']); } $fields = array('NUMAPS' => $aruba_stats[0]['wlsxSwitchTotalNumAccessPoints'], 'NUMCLIENTS' => $aruba_stats[0]['wlsxSwitchTotalNumStationsAssociated']);
// ASA: ftp://ftp.cisco.com/pub/mibs/supportlists/asa/asa-supportlist.html if (is_device_mib($device, 'CISCO-EIGRP-MIB')) { $port_db_q = dbFetchRows('SELECT * FROM `eigrp_ports` WHERE `device_id` = ?', array($device['device_id'])); $port_db = array(); foreach ($port_db_q as $db_port) { $port_db[$db_port['eigrp_vpn'] . '-' . $db_port['eigrp_as'] . '-' . $db_port['eigrp_ifIndex']] = $db_port; } if (OBS_DEBUG && count($port_db)) { print_vars($port_db); } $device_context = $device; if (!count($port_db) && !preg_match('/[a-z](60|65|76)\\d{2}/i', $device['hardware'])) { // Since I'm not sure that this MIB supported on other platforms, set retry to 0 for speedup $device_context['snmp_retries'] = 0; } $ports_poll = snmpwalk_cache_oid($device_context, 'CEigrpInterfaceEntry', array(), 'CISCO-EIGRP-MIB'); unset($device_context); foreach ($ports_poll as $id => $eigrp_port) { list($vpn, $as, $ifIndex) = explode('.', $id); echo "{$vpn} {$as} {$ifIndex}" . PHP_EOL; $port = get_port_by_index_cache($device['device_id'], $ifIndex); if (is_array($port_db[$vpn . '-' . $as . '-' . $ifIndex])) { $eigrp_update = NULL; if ($port['port_id'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['port_id']) { $eigrp_update['port_id'] = $port['port_id']; } if ($eigrp_port['cEigrpAuthMode'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['eigrp_authmode']) { $eigrp_update['eigrp_authmode'] = $eigrp_port['cEigrpAuthMode']; } if ($eigrp_port['cEigrpMeanSrtt'] != $port_db[$vpn . '-' . $as . '-' . $ifIndex]['eigrp_MeanSrtt']) { $eigrp_update['eigrp_MeanSrtt'] = $eigrp_port['cEigrpMeanSrtt'];
* LibreNMS * * Copyright (c) 2016 Peter TKATCHENKO https://github.com/Peter2121/ * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ if (!is_array($storage_cache1['eql-storage'])) { $storage_cache1['eql-storage'] = snmpwalk_cache_oid($device, 'EqliscsiVolumeEntry', null, 'EQLVOLUME-MIB', 'equallogic'); d_echo($storage_cache1); } if (!is_array($storage_cache2['eql-storage'])) { $storage_cache2['eql-storage'] = snmpwalk_cache_oid($device, 'EqliscsiVolumeStatusEntry', null, 'EQLVOLUME-MIB', 'equallogic'); d_echo($storage_cache2); } $iind = 0; $storage_cache10 = array(); $storage_cache20 = array(); d_echo($storage); foreach ($storage_cache1['eql-storage'] as $index => $ventry) { if (!array_key_exists('eqliscsiVolumeName', $ventry)) { continue; } if (is_int($index)) { $iind = $index; } else { $arrindex = explode(".", $index); $iind = (int) end($arrindex) + 0;
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage discovery * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $cache_discovery['netapp-mib'] = snmpwalk_cache_oid($device, "dfEntry", array(), 'NETAPP-MIB'); if (count($cache_discovery['netapp-mib'])) { /* Available data: array(40) { ["dfIndex"]=> "3" ["dfFileSys"]=> "/vol/vol0/" ["dfKBytesTotal"]=> "158387408" ["dfKBytesUsed"]=> "7600652" ["dfKBytesAvail"]=> "150786756" ["dfPerCentKBytesCapacity"]=> "5" ["dfInodesUsed"]=> "9405" ["dfInodesFree"]=> "14517028" ["dfPerCentInodeCapacity"]=> "0" ["dfMountedOn"]=> "/vol/vol0/" ["dfMaxFilesAvail"]=> "14526433" ["dfMaxFilesUsed"]=> "9405" ["dfMaxFilesPossible"]=> "39596840" ["dfHighTotalKBytes"]=> "0"
// FIXME I don't know what "unknown" means, perhaps MSTP? (saw it on some cisco devices) // But we can try to retrieve data if ($stpprotocol == 'ieee8021d' || $stpprotocol == 'unknown') { // set time multiplier to convert from centiseconds to seconds // all time values are stored in databese as seconds $tm = '0.01'; // some vendors like PBN dont follow the 802.1D implementation and use seconds in SNMP if ($device['os'] == 'pbn') { preg_match('/^.* Build (?<build>\\d+)/', $device['version'], $version); if ($version[build] <= 16607) { // Buggy version :-( $tm = '1'; } } // read the 802.1D subtree $stp_raw = snmpwalk_cache_oid($device, 'dot1dStp', array(), 'RSTP-MIB'); $stp = array('protocolSpecification' => $stp_raw[0]['dot1dStpProtocolSpecification'], 'priority' => $stp_raw[0]['dot1dStpPriority'], 'topChanges' => $stp_raw[0]['dot1dStpTopChanges'], 'rootCost' => $stp_raw[0]['dot1dStpRootCost'], 'rootPort' => $stp_raw[0]['dot1dStpRootPort'], 'maxAge' => $stp_raw[0]['dot1dStpMaxAge'] * $tm, 'helloTime' => $stp_raw[0]['dot1dStpHelloTime'] * $tm, 'holdTime' => $stp_raw[0]['dot1dStpHoldTime'] * $tm, 'forwardDelay' => $stp_raw[0]['dot1dStpForwardDelay'] * $tm, 'bridgeMaxAge' => $stp_raw[0]['dot1dStpBridgeMaxAge'] * $tm, 'bridgeHelloTime' => $stp_raw[0]['dot1dStpBridgeHelloTime'] * $tm, 'bridgeForwardDelay' => $stp_raw[0]['dot1dStpBridgeForwardDelay'] * $tm); // set device binding $stp['device_id'] = $device['device_id']; // read the 802.1D bridge address and set as MAC in database $mac_raw = snmp_get($device, 'dot1dBaseBridgeAddress.0', '-Oqv', 'RSTP-MIB'); // read Time as timetics (in hundredths of a seconds) since last topology change and convert to seconds $time_since_change = snmp_get($device, 'dot1dStpTimeSinceTopologyChange.0', '-Ovt', 'RSTP-MIB'); if ($time_since_change > '100') { $time_since_change = substr($time_since_change, 0, -2); // convert to seconds since change } else { $time_since_change = '0'; } $stp['timeSinceTopologyChange'] = $time_since_change; // designated root is stored in format 2 octet bridge priority + MAC address, so we need to normalize it
function poll_mibs($device, &$graphs) { if (!is_mib_poller_enabled($device)) { return; } echo 'MIB: polling '; d_echo("\n"); foreach (load_device_mibs($device) as $name => $module) { echo "{$name} "; d_echo("\n"); $oids = snmpwalk_cache_oid($device, $name, array(), $module, null, "-OQUsb"); d_print_r($oids); save_mibs($device, $name, $oids, load_mibdefs($module, $name), $graphs); } echo "\n"; }
<?php $rserver_array = snmpwalk_cache_oid($device, 'cesServerFarmRserverTable', array(), 'CISCO-ENHANCED-SLB-MIB'); $rserver_db = dbFetchRows('SELECT * FROM `loadbalancer_rservers` WHERE `device_id` = ?', array($device['device_id'])); foreach ($rserver_db as $serverfarm) { $serverfarms[$serverfarm['farm_id']] = $serverfarm; } foreach ($rserver_array as $index => $serverfarm) { $farm_id = preg_replace('@\\d+\\."(.*?)"\\.\\d+@', '\\1', $index); $oids = array('cesServerFarmRserverTotalConns', 'cesServerFarmRserverCurrentConns', 'cesServerFarmRserverFailedConns'); $db_oids = array($farm_id => 'farm_id', 'cesServerFarmRserverStateDescr' => 'StateDescr'); if (!is_array($serverfarms[$farm_id])) { $rserver_id = dbInsert(array('device_id' => $device['device_id'], 'farm_id' => $farm_id, 'StateDescr' => $serverfarm['cesServerFarmRserverStateDescr']), 'loadbalancer_rservers'); } else { foreach ($db_oids as $db_oid => $db_value) { $db_update[$db_value] = $serverfarm[$db_oid]; } $updated = dbUpdate($db_update, 'loadbalancer_rservers', '`rserver_id` = ?', $serverfarm['cesServerFarmRserverFailedConns']['farm_id']); } $rrd_name = array('rserver', $serverfarms[$farm_id]['rserver_id']); $rrd_def = array(); foreach ($oids as $oid) { $oid_ds = truncate(str_replace('cesServerFarm', '', $oid), 19, ''); $rrd_def[] = "DS:{$oid_ds}:GAUGE:600:-1:100000000"; } $fields = array(); foreach ($oids as $oid) { if (is_numeric($serverfarm[$oid])) { $value = $serverfarm[$oid]; } else { $value = '0';
$hw = $entPhysical['entPhysicalDescr']; if (!empty($entPhysical['entPhysicalSerialNum'])) { $serial = $entPhysical['entPhysicalSerialNum']; } } $hardware = rewrite_unix_hardware($poll_device['sysDescr'], $hw); // FIXME Below doesn't seem to belong here, but in a vminfo vmware poller module ... /* * CONSOLE: Start the VMware discovery process. */ echo "VMware VM: "; /* * Get a list of all the known Virtual Machines for this host. */ $db_info_list = dbFetchRows("SELECT * FROM vminfo WHERE device_id = ?", array($device["device_id"])); $vm_data = snmpwalk_cache_oid($device, "vmwVmTable", array(), "VMWARE-VMINFO-MIB", mib_dirs(array("vmware"))); foreach ($db_info_list as $db_info) { /* * Fetch the Virtual Machine information. * * VMWARE-VMINFO-MIB::vmwVmDisplayName.224 = STRING: My First VM * VMWARE-VMINFO-MIB::vmwVmGuestOS.224 = STRING: windows7Server64Guest * VMWARE-VMINFO-MIB::vmwVmMemSize.224 = INTEGER: 8192 megabytes * VMWARE-VMINFO-MIB::vmwVmState.224 = STRING: poweredOn * VMWARE-VMINFO-MIB::vmwVmVMID.224 = INTEGER: 224 * VMWARE-VMINFO-MIB::vmwVmCpus.224 = INTEGER: 2 */ $vm_info = $vm_data[$db_info["vmwVmVMID"]]; # $vm_info["vmwVmDisplayName"] = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmDisplayName." . $db_info["vmwVmVMID"], "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB","+" . $config['install_dir'] . "/mibs/vmware:" . $config['install_dir'] . "/mibs"); # $vm_info["vmwVmGuestOS"] = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmGuestOS." . $db_info["vmwVmVMID"], "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB","+" . $config['install_dir'] . "/mibs/vmware:" . $config['install_dir'] . "/mibs"); # $vm_info["vmwVmMemSize"] = snmp_get($device, "VMWARE-VMINFO-MIB::vmwVmMemSize." . $db_info["vmwVmVMID"], "-Osqnv", "+VMWARE-ROOT-MIB:VMWARE-VMINFO-MIB","+" . $config['install_dir'] . "/mibs/vmware:" . $config['install_dir'] . "/mibs");
$device['vlans'] = array(); include "includes/discovery/vlans/q-bridge-mib.inc.php"; include "includes/discovery/vlans/cisco-vtp.inc.php"; // Fetch switchport <> VLAN relationships. This is DIRTY. foreach ($device['vlans'] as $domain_id => $vlans) { foreach ($vlans as $vlan_id => $vlan) { // Pull Tables for this VLAN #/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dStpPortEntry #/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dBasePortEntry // FIXME - do this only when vlan type == ethernet? if (is_numeric($vlan_id) && ($vlan_id < 1002 || $vlan_id > 1105)) { if ($device['os_group'] == "cisco" || $device['os'] == "ios") { # Probably does not work with snmpv3. I have no real idea about what this code is really doing $vlan_device = array_merge($device, array('community' => $device['community'] . "@" . $vlan_id)); $vlan_data = snmpwalk_cache_oid($vlan_device, "dot1dStpPortEntry", array(), "BRIDGE-MIB:Q-BRIDGE-MIB"); $vlan_data = snmpwalk_cache_oid($vlan_device, "dot1dBasePortEntry", $vlan_data, "BRIDGE-MIB:Q-BRIDGE-MIB"); } echo "VLAN {$vlan_id} \n"; if ($vlan_data) { echo str_pad("dot1d id", 10) . str_pad("ifIndex", 10) . str_pad("Port Name", 25) . str_pad("Priority", 10) . str_pad("State", 15) . str_pad("Cost", 10) . "\n"; } foreach ($vlan_data as $vlan_port_id => $vlan_port) { $port = get_port_by_index_cache($device, $vlan_port['dot1dBasePortIfIndex']); echo str_pad($vlan_port_id, 10) . str_pad($vlan_port['dot1dBasePortIfIndex'], 10) . str_pad($port['ifDescr'], 25) . str_pad($vlan_port['dot1dStpPortPriority'], 10) . str_pad($vlan_port['dot1dStpPortState'], 15) . str_pad($vlan_port['dot1dStpPortPathCost'], 10); $db_w = array('device_id' => $device['device_id'], 'port_id' => $port['port_id'], 'vlan' => $vlan_id); $db_a['baseport'] = $vlan_port_id; $db_a['priority'] = isset($vlan_port['dot1dStpPortPriority']) ? $vlan_port['dot1dStpPortPriority'] : 0; $db_a['state'] = isset($vlan_port['dot1dStpPortState']) ? $vlan_port['dot1dStpPortState'] : "unknown"; $db_a['cost'] = isset($vlan_port['dot1dStpPortPathCost']) ? $vlan_port['dot1dStpPortPathCost'] : 0; $from_db = dbFetchRow("SELECT * FROM `ports_vlans` WHERE device_id = ? AND port_id = ? AND `vlan` = ?", array($device['device_id'], $port['port_id'], $vlan_id)); if ($from_db['port_vlan_id']) {
if ($device['os'] == 'apc') { $oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.2.2.0', '-OsqnU', ''); d_echo($oids . "\n"); if ($oids) { echo 'APC UPS Internal '; list($oid, $current) = explode(' ', $oids); $precision = 1; $sensorType = 'apc'; $index = 0; $descr = 'Internal Temperature'; discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '1', '1', null, null, null, null, $current); } // Environmental monitoring on UPSes etc // FIXME emConfigProbesTable may also be used? But not filled out on my device... $apc_env_data = snmpwalk_cache_oid($device, 'iemConfigProbesTable', array(), 'PowerNet-MIB'); $apc_env_data = snmpwalk_cache_oid($device, 'iemStatusProbesTable', $apc_env_data, 'PowerNet-MIB'); foreach (array_keys($apc_env_data) as $index) { $descr = $apc_env_data[$index]['iemStatusProbeName']; $current = $apc_env_data[$index]['iemStatusProbeCurrentTemp']; $sensorType = 'apc'; $oid = '.1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.' . $index; $low_limit = $apc_env_data[$index]['iemConfigProbeMinTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMinTempThreshold'] : null; $low_warn_limit = $apc_env_data[$index]['iemConfigProbeLowTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeLowTempThreshold'] : null; $high_warn_limit = $apc_env_data[$index]['iemConfigProbeHighTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeHighTempThreshold'] : null; $high_limit = $apc_env_data[$index]['iemConfigProbeMaxTempEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMaxTempThreshold'] : null; discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current); } /* [iemConfigProbeHighHumidThreshold] => -1 [iemConfigProbeLowHumidThreshold] => -1 [iemConfigProbeHighHumidEnable] => disabled
<?php // Force10 E-Series // F10-CHASSIS-MIB::chSysCardType.1 = INTEGER: rpmCardEF3(206) // F10-CHASSIS-MIB::chSysCardType.3 = INTEGER: lc2401E24PG3(69) // F10-CHASSIS-MIB::chSysCardType.4 = INTEGER: lc2401E24PG3(69) // F10-CHASSIS-MIB::chSysCardUpperTemp.1 = Gauge32: 34 // F10-CHASSIS-MIB::chSysCardUpperTemp.3 = Gauge32: 34 // F10-CHASSIS-MIB::chSysCardUpperTemp.4 = Gauge32: 34 if ($device['os'] == 'ftos' || $device['os_group'] == 'ftos') { echo 'FTOS E-Series '; $oids = snmpwalk_cache_oid($device, 'chSysCardUpperTemp', array(), 'F10-CHASSIS-MIB', 'ftos'); if (is_array($oids)) { 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); } } }
$remote_port_id = dbFetchCell('SELECT `port_id` FROM `ports` WHERE (`ifDescr` = ? OR `ifName` = ? OR `ifDescr` = ? OR `ifName` = ?) AND `device_id` = ?', array($if, $if, $id, $id, $remote_device_id)); } else { $remote_port_id = '0'; } if (is_numeric($interface['port_id']) && isset($lldp['lldpRemSysName']) && isset($lldp['lldpRemPortId'])) { discover_link($interface['port_id'], 'lldp', $remote_port_id, $lldp['lldpRemSysName'], $lldp['lldpRemPortId'], null, $lldp['lldpRemSysDesc'], $device['device_id'], $remote_device_id); } } //end foreach } //end if } elseif ($config['autodiscovery']['xdp'] === true) { echo ' LLDP-MIB: '; $lldp_array = snmpwalk_cache_threepart_oid($device, 'lldpRemoteSystemsData', array(), 'LLDP-MIB'); d_echo($lldp_array); $dot1d_array = snmpwalk_cache_oid($device, 'dot1dBasePortIfIndex', array(), 'BRIDGE-MIB'); d_echo($dot1d_array); if ($lldp_array) { $lldp_links = ''; foreach (array_keys($lldp_array) as $key) { $lldp_if_array = $lldp_array[$key]; d_echo($lldp_if_array); foreach (array_keys($lldp_if_array) as $entry_key) { if (is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) { $ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex']; } else { $ifIndex = $entry_key; } $interface = dbFetchRow('SELECT * FROM `ports` WHERE `device_id` = ? AND `ifIndex` = ?', array($device['device_id'], $ifIndex)); $lldp_instance = $lldp_if_array[$entry_key]; d_echo($lldp_instance);
<?php // Force10 S-Series // 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' || $device['os'] == 'dnos') { 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)) { 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); } } }
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage discovery * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $processors_array = snmpwalk_cache_oid($device, 'wlsxSysXProcessorTable', array(), $mib); if (is_array($processors_array)) { foreach ($processors_array as $index => $entry) { if (is_numeric($entry['sysXProcessorLoad']) && is_numeric($index)) { $descr = $entry['sysXProcessorDescr']; $usage = $entry['sysXProcessorLoad']; $oid = "1.3.6.1.4.1.14823.2.2.1.1.1.9.1.3.{$index}"; discover_processor($valid['processor'], $device, $oid, $index, 'WLSX-SWITCH-MIB', $descr, 1, $usage); } } } unset($processors_array, $index, $descr, $usage, $oid); // EOF
<?php if ($config['enable_bgp']) { foreach (dbFetchRows('SELECT * FROM bgpPeers WHERE device_id = ?', array($device['device_id'])) as $peer) { // Poll BGP Peer $peer2 = false; echo 'Checking BGP peer ' . $peer['bgpPeerIdentifier'] . ' '; if (!empty($peer['bgpPeerIdentifier'])) { if (!strstr($peer['bgpPeerIdentifier'], ':') || $device['os'] != 'junos') { // v4 BGP4 MIB // FIXME - needs moved to function $peer_data_check = snmpwalk_cache_oid($device, 'cbgpPeer2RemoteAs', array(), 'CISCO-BGP4-MIB', $config['mibdir']); if (count($peer_data_check) > 0) { $peer2 = true; } if ($peer2 === true) { if (strstr($peer['bgpPeerIdentifier'], ':')) { $bgp_peer_ident = ipv62snmp($peer['bgpPeerIdentifier']); } else { $bgp_peer_ident = $peer['bgpPeerIdentifier']; } if (strstr($peer['bgpPeerIdentifier'], ':')) { $ip_type = 2; $ip_len = 16; $ip_ver = 'ipv6'; } else { $ip_type = 1; $ip_len = 4; $ip_ver = 'ipv4'; } $peer_identifier = $ip_type . '.' . $ip_len . '.' . $bgp_peer_ident;
<?php /** * Observium * * This file is part of Observium. * * @package observium * @subpackage discovery * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ // Force10 C-Series // chRpmCpuUtil5Min.1 = Gauge32: 47 $processors_array = snmpwalk_cache_oid($device, 'chRpmCpuUtil5Min', array(), $mib); if (is_array($processors_array)) { foreach ($processors_array as $index => $entry) { $descr = $index == 1 ? 'CP' : 'RP' . strval($index - 1); $oid = ".1.3.6.1.4.1.6027.3.8.1.3.7.1.5.{$index}"; $usage = $entry['chRpmCpuUtil5Min']; discover_processor($valid['processor'], $device, $oid, $index, 'ftos-cseries', $descr, 1, $usage); } } unset($processors_array, $descr, $oid, $usage, $index, $entry); // EOF