Initial commit for ServerIron support

This commit is contained in:
Xavier Beaudouin
2016-02-23 17:57:08 +01:00
parent 7b29b570f6
commit 63a76a7605
7 changed files with 64 additions and 0 deletions

View File

@@ -483,6 +483,19 @@ $config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
$config['os'][$os]['icon'] = 'brocade';
// Brocade/Foundry ServerIron
$os = 'serveriron';
$config['os'][$os]['text'] = 'Brocade ServerIron';
$config['os'][$os]['type'] = 'network';
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
$config['os'][$os]['over'][1]['text'] = 'CPU Usage';
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
$config['os'][$os]['icon'] = 'brocade';
// Cisco Small Business
$os = 'ciscosb';
$config['os'][$os]['group'] = 'cisco';

View File

@@ -0,0 +1,15 @@
<?php
if ($device['os'] == "serveriron") {
echo("nos: ");
$used = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
$total = "100";
$free = ($total - $used);
$percent = $used;
if (is_numeric($used)) {
discover_mempool($valid_mempool, $device, 0, "serveriron", "Memory", "1", NULL, NULL);
}
}

View File

@@ -0,0 +1,7 @@
<?php
if (!$os) {
if (preg_match('/ServerIron/', $sysDescr)) {
$os = 'serveriron';
}
}

View File

@@ -0,0 +1,14 @@
<?php
if ($device['os'] == "serveriron") {
echo("serveriron : ");
$descr = "CPU";
$usage = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq");
if (is_numeric($usage)) {
discover_processor($valid['processor'], $device, "1.3.6.1.4.1.1588.2.1.1.1.26.1", "0", "serveriron", $descr, "1", $usage, NULL, NULL);
}
}
unset ($processors_array);

View File

@@ -0,0 +1,7 @@
<?php
// Somewhat of an uggly hack since Server doesn't support fetching total memory of the device over SNMP
// Given OID returns usage in percent so we set total to 100 in order to get a proper graph
$mempool['total'] = "100";
$mempool['used'] = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
$mempool['free'] = ($mempool['total'] - $mempool['used']);

View File

@@ -0,0 +1,5 @@
<?php
$version = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.1.6.0", "-Ovq"),'"');
$hardware = trim(snmp_get($device, "ENTITY-MIB::entPhysicalDescr.1", "-Ovq"),'"');
$serial = trim(snmp_get($device, "1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq"),'"');

View File

@@ -0,0 +1,3 @@
<?php
$proc = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq"),'"');