From b28e33b839513862d808d95319727db28e93393f Mon Sep 17 00:00:00 2001 From: Rosiak Date: Fri, 10 Jul 2015 01:40:14 +0200 Subject: [PATCH] More Dell iDrac Additions - Basic DRAC5 && iDRAC6 recognition - State sensor support based on earlier work from @laf --- includes/discovery/os/drac.inc.php | 4 +++- includes/discovery/states/drac.inc.php | 31 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 includes/discovery/states/drac.inc.php diff --git a/includes/discovery/os/drac.inc.php b/includes/discovery/os/drac.inc.php index 08858b265..783ba91a1 100644 --- a/includes/discovery/os/drac.inc.php +++ b/includes/discovery/os/drac.inc.php @@ -2,7 +2,9 @@ if (!$os) { - if (strstr($sysDescr, "Dell Out-of-band SNMP Agent for Remote Access Controller") || strstr($sysObjectId, "1.3.6.1.4.1.674.10892.5")) { + #DRAC5, iDRAC6 - 1.3.6.1.4.1.674.10892.2 + #iDRAC7, iDRAC8 - 1.3.6.1.4.1.674.10892.5 + if (strstr($sysDescr, "Dell Out-of-band SNMP Agent for Remote Access Controller") || strstr($sysObjectId, "1.3.6.1.4.1.674.10892.2") || strstr($sysObjectId, "1.3.6.1.4.1.674.10892.5")) { $os = "drac"; } } diff --git a/includes/discovery/states/drac.inc.php b/includes/discovery/states/drac.inc.php new file mode 100644 index 000000000..24936a6a3 --- /dev/null +++ b/includes/discovery/states/drac.inc.php @@ -0,0 +1,31 @@ + + * + * 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 ($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"; + } + $oids = trim($oids); + if ($oids) { + echo "Dell iDRAC"; + foreach (explode("\n", $oids) as $data) { + list($oid,) = explode(" ", $data, 2); + $state_oid = "4.1"; + $state_current = snmp_get($device, $main_oid.$state_oid, "-Oevq"); + discover_sensor($valid['sensor'], 'state', $device, $main_oid.$state_oid, "virtualDiskState.$state_oid", 'drac', 'Raid State', '1', '1', NULL, NULL, NULL, NULL, $state_current); + } + } +