Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPE ILO4 enhance #7436

Merged
merged 12 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion includes/definitions/discovery/hpe-ilo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mib: CPQHLTH-MIB:CPQIDA-MIB:CPQSTDEQ-MIB
mib: CPQHLTH-MIB:CPQIDA-MIB:CPQSTDEQ-MIB:CPQHOST-MIB
modules:
sensors:
power:
Expand Down Expand Up @@ -89,3 +89,27 @@ modules:
- { descr: ok, graph: 1, value: 2, generic: 0 }
- { descr: degraded, graph: 1, value: 3, generic: 1 }
- { descr: degradedModuleIndexUnknown, graph: 1, value: 4, generic: 1 }
-
oid: cpqDaCntlrTable
value: cpqDaCntlrCondition
num_oid: .1.3.6.1.4.1.232.3.2.2.1.1.6.
descr: 'Array Controller Slot#{{ $cpqDaCntlrSlot }}'
index: 'cpqDaCntlrCondition.{{ $index }}'
state_name: cpqDaCntlrCondition
states:
- { descr: other, graph: 1, value: 1, generic: 3 }
- { descr: ok, graph: 1, value: 2, generic: 0 }
- { descr: degraded, graph: 1, value: 3, generic: 1 }
- { descr: failed, graph: 1, value: 4, generic: 1 }
-
oid: cpqDaLogDrvTable
value: cpqDaLogDrvCondition
num_oid: .1.3.6.1.4.1.232.3.2.3.1.1.11.
descr: 'Logical Drive #{{ $cpqDaLogDrvIndex }}'
index: 'cpqDaLogDrvCondition.{{ $index }}'
state_name: cpqDaLogDrvCondition
states:
- { descr: other, graph: 1, value: 1, generic: 3 }
- { descr: ok, graph: 1, value: 2, generic: 0 }
- { descr: degraded, graph: 1, value: 3, generic: 1 }
- { descr: failed, graph: 1, value: 4, generic: 1 }
23 changes: 12 additions & 11 deletions includes/definitions/hpe-ilo.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
os: hpe-ilo
text: 'HPE Integrated Lights Out'
type: appliance
icon: hpe
over:
- { graph: device_bits, text: Traffic }
discovery:
- sysObjectId:
- .1.3.6.1.4.1.232.9.4.10
mib_dir:
- hp
os: hpe-ilo
text: 'HPE Integrated Lights Out'
type: appliance
icon: hpe
over:
- { graph: device_bits, text: Traffic }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectId:
- .1.3.6.1.4.1.232.9.4.10
mib_dir:
- hp
28 changes: 28 additions & 0 deletions includes/discovery/mempools/hpe-ilo.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

if ($device['os'] == 'hpe-ilo') {
echo 'HPE ILO4 ';

$memory_pool = snmp_get_multi_oid($device, 'cpqHoPhysicalMemoryFree.0 cpqHoPhysicalMemorySize.0 cpqHoPagingMemoryFree.0 cpqHoPagingMemorySize.0', '-OQUs', 'CPQHO
ST-MIB');

$mem_free = $memory_pool['cpqHoPhysicalMemoryFree.0'];
$mem_capacity = $memory_pool['cpqHoPhysicalMemorySize.0'];
$page_free = $memory_pool['cpqHoPagingMemoryFree.0'];
$page_capacity = $memory_pool['cpqHoPagingMemorySize.0'];


if ((is_numeric($mem_free)) && (is_numeric($mem_capacity))) {
discover_mempool($valid_mempool, $device, 0, 'hpe-ilo', 'Physical Memory', '1', null, null);
}
if ((is_numeric($page_free)) && (is_numeric($page_capacity))) {
discover_mempool($valid_mempool, $device, 1, 'hpe-ilo', 'Paging Memory', '1', null, null);
}
}

unset(
$mem_free,
$mem_capacity,
$page_free,
$page_capacity
);
20 changes: 20 additions & 0 deletions includes/discovery/storage/hpe-ilo.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$ilo_storage = snmpwalk_group($device, 'cpqHoFileSysEntry', 'CPQHOST-MIB');
$units = 1024*1024;

if (is_array($ilo_storage)) {
echo 'HPE ILO4 ';
foreach ($ilo_storage as $index => $storage) {
$type = $storage['cpqHoFileSysDesc'];
preg_match_all("/\\[:(.*?)\\]/", $type, $matches);
$fstype = $matches[1][0];
$descr = $storage['cpqHoFileSysDesc'];
$size = $storage['cpqHoFileSysSpaceTotal'];
$used = $storage['cpqHoFileSysSpaceUsed'];
if (is_int($index)) {
discover_storage($valid_storage, $device, $index, $fstype, 'hpe-ilo', $descr, $size, $units, $used);
}
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $hrstorage_array);
}
}
29 changes: 29 additions & 0 deletions includes/polling/mempools/hpe-ilo.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

$data = snmp_get_multi_oid($device, 'cpqHoPhysicalMemorySize.0 cpqHoPhysicalMemoryFree.0 cpqHoPagingMemorySize.0 cpqHoPagingMemoryFree.0', '-OUQs', 'CPQHOST-MIB');
$units = 1024*1024;

if ($mempool['mempool_index'] == 0) {
$mem_capacity = $data['cpqHoPhysicalMemorySize.0'];
$mem_free = $data['cpqHoPhysicalMemoryFree.0'];

$mempool['total'] = $mem_capacity*$units;
$mempool['free'] = $mem_free*$units;
$mempool['used'] = $mempool['total'] - $mempool['free'];
}

if ($mempool['mempool_index'] == 1) {
$page_capacity = $data['cpqHoPagingMemorySize.0'];
$page_free = $data['cpqHoPagingMemoryFree.0'];

$mempool['total'] = $page_capacity*$units;
$mempool['free'] = $page_free*$units;
$mempool['used'] = $mempool['total'] - $mempool['free'];
}

unset(
$mem_free,
$mem_capacity,
$page_free,
$page_capacity
);
14 changes: 14 additions & 0 deletions includes/polling/storage/hpe-ilo.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%
<?php

if (!is_array($storage_cache['hpe-ilo'])) {
$storage_cache['hpe-ilo'] = snmpwalk_group($device, 'cpqHoFileSysEntry', 'CPQHOST-MIB');
echo("HPE ILO4 ");
}

$entry = $storage_cache['hpe-ilo'][$storage[storage_index]];

$storage['units'] = 1024*1024;
$storage['size'] = ($entry['cpqHoFileSysSpaceTotal'] * $storage['units']);
$storage['used'] = ($entry['cpqHoFileSysSpaceUsed'] * $storage['units']);
$storage['free'] = ($storage['size'] - $storage['used']);