Merge branch 'master' of github.com:laf/librenms into issue-803

This commit is contained in:
laf
2015-04-22 10:52:58 +01:00
81 changed files with 22897 additions and 1907 deletions

View File

@@ -1,58 +1,77 @@
<?php
# 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 == "")
{
# 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 == "")
{
# 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 == "")
{
# 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", "", ""),'"');
}
if ($serial == "")
{
# InfraStruxure
$serial = trim(snmp_get($device, "PowerNet-MIB::isxModularPduIdentSerialNumber.0", "-OQv", "", ""),'"');
}
/////////////////////
# 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, "1.3.6.1.4.1.318.1.1.12.1.2.0", "-OQv", "", ""),'"');
$hardware = trim(snmp_get($device, "PowerNet-MIB::rPDUIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::rPDUIdentHardwareRev.0", "-OQv", "", ""),'"');
if ($hardware == " ")
{
# 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, "1.3.6.1.4.1.318.1.1.8.1.1.0", "-OQv", "", ""),'"');
$hardware = trim(snmp_get($device, "PowerNet-MIB::atsIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::atsIdentHardwareRev.0", "-OQv", "", ""),'"');
}
if ($hardware == " ")
{
# 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, "1.3.6.1.4.1.318.1.1.1.1.2.1.0", "-OQv", "", ""),'"');
$hardware = trim(snmp_get($device, "PowerNet-MIB::upsBasicIdentModel.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::upsAdvIdentFirmwareRevision.0", "-OQv", "", ""),'"');
}
if ($hardware == " ")
{
# 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, "1.3.6.1.4.1.318.1.1.4.1.1.0", "-OQv", "", ""),'"');
$hardware = trim(snmp_get($device, "PowerNet-MIB::sPDUIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::sPDUIdentHardwareRev.0", "-OQv", "", ""),'"');
}
if ($hardware == " ")
{
# 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, ".1.3.6.1.4.1.318.1.1.13.3.2.2.1.7.0", "-OQv", "", ""),'"');
$hardware = trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::airIRRCUnitIdentHardwareRevision.0", "-OQv", "", ""),'"');
}
if ($hardware == " ")
{
# InfraStruxure
$hardware = trim(snmp_get($device, "PowerNet-MIB::isxModularPduIdentModelNumber.0", "-OQv", "", ""),'"');
$hardware .= ' ' . trim(snmp_get($device, "PowerNet-MIB::isxModularPduIdentMonitorCardHardwareRev.0", "-OQv", "", ""),'"');
}
/////////////////////
@@ -63,18 +82,30 @@ $APPrev = trim(snmp_get($device, "1.3.6.1.4.1.318.1.4.2.4.1.4.2", "-OQv", "", ""
if ($AOSrev == '')
{
# 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 == "")
{
# 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 == "")
{
# 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", "", ""),'"');
}
if ($version == "")
{
# InfraStruxure
$version = trim(snmp_get($device, "PowerNet-MIB::isxModularPduIdentMonitorCardFirmwareAppRev.0", "-OQv", "", ""),'"');
}
}
else

View File

@@ -1,14 +1,14 @@
<?php
if (preg_match('/^Cisco IOS Software, .+? Software \([^\-]+-([\w\d]+)-\w\), Version ([^,]+)/', $poll_device['sysDescr'], $regexp_result))
if (preg_match('/^Cisco IOS Software, .+? Software(\, )?([\s\w\d]+)? \([^\-]+-([\w\d]+)-\w\), Version ([^,]+)/', $poll_device['sysDescr'], $regexp_result))
{
$features = $regexp_result[1];
$version = $regexp_result[2];
}
elseif( false )
{
# Placeholder
# Other regexp for other type of string
$features = $regexp_result[3];
$version = $regexp_result[4];
$hardware = $regexp_result[2];
$tmp = preg_split("/\\r\\n|\\r|\\n/",$version);
if (!empty($tmp[0])) {
$version = $tmp[0];
}
}
echo("\n".$poll_device['sysDescr']."\n");
@@ -24,7 +24,7 @@ if ($data[1]['entPhysicalContainedIn'] == "0")
$version = $data[1]['entPhysicalSoftwareRev'];
}
if (!empty($data[1]['entPhysicalName']))
if (!empty($data[1]['entPhysicalName']) && $data[1]['entPhysicalName'] != 'Switch System')
{
$hardware = $data[1]['entPhysicalName'];
}

View File

@@ -0,0 +1,6 @@
<?php
$hardware = "Datacom ".str_replace("dmSwitch","DM",snmp_get($device, "swChassisModel.0", "-Ovq", "DMswitch-MIB"));
$version = snmp_get($device, "swFirmwareVer.1", "-Ovq", "DMswitch-MIB");
$features = snmp_get($device, "sysDescr.0", "-Oqv", "SNMPv2-MIB");
$serial = snmp_get($device, "DMswitch-MIB::swSerialNumber.1", "-Ovq","DMswitch-MIB");
?>

View File

@@ -28,6 +28,12 @@ if (strpos($sysdescr_value, 'IBM Networking Operating System') !== false) {
$version = trim(snmp_get($device, ".1.3.6.1.4.1.20301.2.7.13.1.1.1.10.0", "-Ovq") , '" ');
$serial = trim(snmp_get($device, ".1.3.6.1.4.1.20301.100.100.14.9.0", "-Ovq") , '" ');
}
if (empty($version)) {
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');
}
if (empty($serial)) {
$serial = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq") , '" ');
}
} elseif (strpos($sysdescr_value, 'IBM Flex System Fabric') !== false) {
$hardware = str_replace("IBM Flex System Fabric", "", $sysdescr_value);
$version = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.10.1", "-Ovq") , '" ');

View File

@@ -0,0 +1,18 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* 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 (stristr($poll_device['sysObjectID'], "packetlogic") || strstr($poll_device['sysObjectID'], "enterprises.15397.2") || strstr($poll_device['sysObjectID'], ".1.3.6.1.4.1.15397.2")) {
$version = "PacketLogic";
$hardware = "PacketLogic";
}

View File

@@ -0,0 +1,3 @@
<?php
$proc = snmp_get($device, "swCpuUsage.0", "-Ovq", "DMswitch-MIB");
?>