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

Added support dellNet devices #10016

Merged
merged 14 commits into from Apr 12, 2019
@@ -0,0 +1,23 @@
os: dell-net
text: 'Dell Networking OS'
type: network
icon: dell
group: dell
mib_dir:
- dell
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectID:
# DELL-NETWORKING-PRODUCTS-MIB::dellNetESeriesProducts = .1.3.6.1.4.1.6027.1.1
# DELL-NETWORKING-PRODUCTS-MIB::dellNetCSeriesProducts = .1.3.6.1.4.1.6027.1.2
# DELL-NETWORKING-PRODUCTS-MIB::dellNetSSeriesProducts = .1.3.6.1.4.1.6027.1.3
# DELL-NETWORKING-PRODUCTS-MIB::dellNetMSeriesProducts = .1.3.6.1.4.1.6027.1.4
# DELL-NETWORKING-PRODUCTS-MIB::dellNetZSeriesProducts = .1.3.6.1.4.1.6027.1.5
- .1.3.6.1.4.1.6027.1.1
- .1.3.6.1.4.1.6027.1.2
- .1.3.6.1.4.1.6027.1.3
- .1.3.6.1.4.1.6027.1.4
- .1.3.6.1.4.1.6027.1.5
@@ -0,0 +1,68 @@
mib: DELL-NETWORKING-CHASSIS-MIB:DELL-NETWORKING-IF-EXTENSION-MIB
modules:
processors:
data:
-
snmp_flags: ['-ObsQ']
oid: dellNetCpuUtilTable
value: dellNetCpuUtil1Min
num_oid: '.1.3.6.1.4.1.6027.3.26.1.4.4.1.4.{{ $index }}'
descr: '1m Utilization'
index: 'dellNetCpuUtil1Min.{{ $index }}'
-
snmp_flags: ['-ObsQ']
oid: dellNetCpuUtilTable
value: dellNetCpuUtil5Min
num_oid: '.1.3.6.1.4.1.6027.3.26.1.4.4.1.5.{{ $index }}'
descr: '5m Utilization'
index: 'dellNetCpuUtil5Min.{{ $index }}'
storage:
data:
-
snmp_flags: ['-ObsQ']
oid: dellNetCpuUtilTable
value: dellNetCpuFlashUsageUtil
num_oid: '.1.3.6.1.4.1.6027.3.26.1.4.4.1.7.{{ $index }}'
descr: 'Flash Storage'
index: 'dellNetCpuFlashUsageUtil.{{ $index }}'
sensors:
temperature:
data:
-
oid: dellNetStackUnitTable
value: dellNetStackUnitTemp
num_oid: '.1.3.6.1.4.1.6027.3.26.1.3.4.1.13.{{ $index }}'
descr: 'Stack Unit {{ $index }}'
group: Chassis
-
oid: dellNetIfTransceiverDataTable
value: dellNetIfTransTemperature
num_oid: '.1.3.6.1.4.1.6027.3.11.1.3.1.1.16.{{ $index }}'
descr: 'Transceiver {{ $index }}'
group: Transceivers
state:
data:
-
snmp_flags: ['-ObsQ']
oid: dellNetFanTrayTable
value: dellNetFanTrayOperStatus
num_oid: '.1.3.6.1.4.1.6027.3.26.1.4.7.1.4.{{ $index }}'
descr: 'Fantray {{ $dellNetFanTrayIndex }}'
group: Fans
state_name: dellNetFanTrayOperStatus
states:
- { value: 1, descr: up, graph: 1, generic: 0 }
- { value: 2, descr: down, graph: 1, generic: 2 }
- { value: 3, descr: absent, graph: 1, generic: 2 }
-
snmp_flags: ['-ObsQ']
oid: dellNetPowerSupplyTable
value: dellNetPowerSupplyOperStatus
num_oid: '.1.3.6.1.4.1.6027.3.26.1.4.6.1.4.{{ $index }}'
descr: 'PSU {{ $dellNetPowerSupplyIndex }}'
group: PSUs
state_name: dellNetPowerSupplyOperStatus
states:
- { value: 1, descr: up, graph: 1, generic: 0 }
- { value: 2, descr: down, graph: 1, generic: 2 }
- { value: 3, descr: absent, graph: 1, generic: 2 }
@@ -0,0 +1,40 @@
<?php
/**
* dell-net.inc.php
*
* LibreNMS memory discovery module for Dell-Networking
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2019 Spencer Butler
* @author Spencer Butler <github@crooked.app>
*/
$mem_data = snmpwalk_cache_oid($device, 'dellNetCpuUtilTable', [], 'DELL-NETWORKING-CHASSIS-MIB', 'dell', '-OUseQ');
$mem_data = snmpwalk_cache_oid($device, 'DellNetProcessorEntry', $mem_data, 'DELL-NETWORKING-CHASSIS-MIB', 'dell', '-OUseQ');
if (is_array($mem_data)) {

Check notice on line 30 in includes/discovery/mempools/dell-net.inc.php

Scrutinizer / Inspection

includes/discovery/mempools/dell-net.inc.php#L30

The condition ``is_array($mem_data)`` is always ``true``.
foreach ($mem_data as $index => $data) {
$size = $data['dellNetProcessorMemSize'];
if (preg_match('/stack/', $index) && isset($size)) {
$type = 'dell-net';
$descr = 'Memory' . $index;
discover_mempool($valid_mempool, $device, $index, $type, $descr, null, null, null);
}
}
}
unset($mem_data);
@@ -0,0 +1,42 @@
<?php
/**
* dell-net.inc.php
*
* LibreNMS os poller module for Dell-Networking
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2019 Spencer Butler
* @author Spencer Butler <github@crooked.app>
*/
$mem_data = snmpwalk_cache_oid($device, 'dellNetCpuUtilTable', [], 'DELL-NETWORKING-CHASSIS-MIB', 'dell', '-OUseQ');
$mem_data = snmpwalk_cache_oid($device, 'DellNetProcessorEntry', $mem_data, 'DELL-NETWORKING-CHASSIS-MIB', 'dell', '-OUseQ');
if (is_array($mem_data)) {

Check notice on line 29 in includes/polling/mempools/dell-net.inc.php

Scrutinizer / Inspection

includes/polling/mempools/dell-net.inc.php#L29

The condition ``is_array($mem_data)`` is always ``true``.
foreach ($mem_data as $index => $data) {
$size = $data['dellNetProcessorMemSize'];
if (preg_match('/stack/', $index) && isset($size)) {
$perc = $data['dellNetCpuUtilMemUsage'];
$total = $data['dellNetProcessorMemSize'];
This conversation was marked as resolved by spencerbutler

This comment has been minimized.

Copy link
@PipoCanaja

PipoCanaja Mar 25, 2019

Contributor

This oid appears to return a number in megabytes. So you need to convert it to bytes first before doing your maths. This should solve the display of the value in the GUI.

This comment has been minimized.

Copy link
@spencerbutler

spencerbutler Mar 26, 2019

Author Contributor

commit 9096d10 fixes this.

$mempool['total'] = $total;
$mempool['used'] = $perc/100 * $total;
$mempool['free'] = $total - $total/$perc;
This conversation was marked as resolved by spencerbutler

This comment has been minimized.

Copy link
@PipoCanaja

PipoCanaja Mar 25, 2019

Contributor

The formula for the 'free' value seems weird. I would simply do $mempool['free'] = $mempool['total'] - $mempool['used']

This comment has been minimized.

Copy link
@spencerbutler

spencerbutler Mar 26, 2019

Author Contributor

commit 5a691bd fixes this.

}
}
}
unset($mem_data);
@@ -0,0 +1,31 @@
<?php
/**
* dell-net.inc.php
*
* LibreNMS os poller module for Dell-Networking
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2019 Spencer Butler
* @author Spencer Butler <github@crooked.app>
*/
$temp_data = snmpwalk_group($device, 'dellNetStackUnitTable', 'DELL-NETWORKING-CHASSIS-MIB');
$hardware = $temp_data[1]['dellNetStackUnitDescription'];
$version = $temp_data[1]['dellNetStackUnitCodeVersion'];
$features = $temp_data[1]['dellNetStackUnitServiceTag'] . '/' . $temp_data[1]['dellNetStackUnitExpServiceCode'];
unset($temp_data);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.