Minor APC Polling Changes

- Add InRow Serial ID
- Convert from OID to MIB names
This commit is contained in:
Søren Rosiak
2015-04-13 23:11:27 +02:00
parent c899769ca8
commit a15180333a

View File

@@ -1,58 +1,64 @@
<?php <?php
# PDU # PDU
$serial = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.6.0", "-OQv", "", ""),'"'); $serial = trim(snmp_get($device, "PowerNet-MIB::rPDUIdentSerialNumber.0", "-OQv", "", ""),'"');
if ($serial == "") if ($serial == "")
{ {
# ATS # ATS
$serial = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.8.1.6.0", "-OQv", "", ""),'"'); $serial = trim(snmp_get($device, "PowerNet-MIB::atsIdentSerialNumber.0", "-OQv", "", ""),'"');
} }
if ($serial == "") if ($serial == "")
{ {
# UPS # UPS
$serial = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.1.1.2.3.0", "-OQv", "", ""),'"'); $serial = trim(snmp_get($device, "PowerNet-MIB::upsAdvIdentSerialNumber.0", "-OQv", "", ""),'"');
} }
if ($serial == "") if ($serial == "")
{ {
# Masterswitch/AP9606 # Masterswitch/AP9606
$serial = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.4.1.5.0", "-OQv", "", ""),'"'); $serial = trim(snmp_get($device, "PowerNet-MIB::sPDUIdentSerialNumber.0", "-OQv", "", ""),'"');
}
if ($serial == "")
{
# InRow chiller
$serial = trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentSerialNumber.0", "-OQv", "", ""),'"');
} }
///////////////////// /////////////////////
# PDU # PDU
$hardware = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.5.0", "-OQv", "", ""),'"'); $hardware = trim(snmp_get($device, "PowerNet-MIB::rPDUIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.2.0", "-OQv", "", ""),'"'); $hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::rPDUIdentHardwareRev.0", "-OQv", "", ""),'"');
if ($hardware == " ") if ($hardware == " ")
{ {
# ATS # ATS
$hardware = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.8.1.5.0", "-OQv", "", ""),'"'); $hardware = trim(snmp_get($device, "PowerNet-MIB::atsIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.8.1.1.0", "-OQv", "", ""),'"'); $hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::atsIdentHardwareRev.0", "-OQv", "", ""),'"');
} }
if ($hardware == " ") if ($hardware == " ")
{ {
# UPS # UPS
$hardware = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.1.1.1.1.0", "-OQv", "", ""),'"'); $hardware = trim(snmp_get($device, "PowerNet-MIB::upsBasicIdentModel.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.1.1.2.1.0", "-OQv", "", ""),'"'); $hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::upsAdvIdentFirmwareRevision.0", "-OQv", "", ""),'"');
} }
if ($hardware == " ") if ($hardware == " ")
{ {
# Masterswitch/AP9606 # Masterswitch/AP9606
$hardware = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.4.1.4.0", "-OQv", "", ""),'"'); $hardware = trim(snmp_get($device, "PowerNet-MIB::sPDUIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.4.1.1.0", "-OQv", "", ""),'"'); $hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::sPDUIdentHardwareRev.0", "-OQv", "", ""),'"');
} }
if ($hardware == " ") if ($hardware == " ")
{ {
# InRow chiller # InRow chiller
$hardware = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.13.3.2.2.1.4.0", "-OQv", "", ""),'"'); $hardware = trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, ".1.3.6.1.4.1.318.1.1.13.3.2.2.1.7.0", "-OQv", "", ""),'"'); $hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentHardwareRevision.0", "-OQv", "", ""),'"');
} }
///////////////////// /////////////////////
@@ -63,18 +69,24 @@ $APPrev = trim(snmp_get($device, "1.3.6.1.4.1.318.1.4.2.4.1.4.2", "-OQv", "", ""
if ($AOSrev == '') if ($AOSrev == '')
{ {
# PDU # PDU
$version = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.3.0", "-OQv", "", ""),'"'); $version = trim(snmp_get($device, "PowerNet-MIB::rPDUIdentFirmwareRev.0", "-OQv", "", ""),'"');
if ($version == "") if ($version == "")
{ {
# ATS # ATS
$version = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.8.1.2.0", "-OQv", "", ""),'"'); $version = trim(snmp_get($device, "PowerNet-MIB::atsIdentFirmwareRev.0", "-OQv", "", ""),'"');
} }
if ($version == "") if ($version == "")
{ {
# Masterswitch/AP9606 # Masterswitch/AP9606
$version = trim(snmp_get($device, "1.3.6.1.4.1.318.1.1.4.1.2.0", "-OQv", "", ""),'"'); $version = trim(snmp_get($device, "PowerNet-MIB::sPDUIdentFirmwareRev.0", "-OQv", "", ""),'"');
}
if ($version == "")
{
# InRow chiller
$version = trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentFirmwareRevision.0", "-OQv", "", ""),'"');
} }
} }
else else