mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Add OS detection and temperature sensor support for Asentria SiteBoss (#7655)
* Initial commit. OS definition/polling, temp sensor discovery/polling, MIBs, logo, snmprec test * replaced logo with 32x32, shortened sysObjectID in definitions, modifided sensor discovery * fix syntax error caught by inspection * requested chases to siteboss temp discovery file, removal of siteboss temp polling file * converted temp sensor to yaml and added better support to skip values * updated to use pre_cache with index
This commit is contained in:
committed by
Tony Murray
parent
8e61c6394a
commit
64aed60f09
BIN
html/images/os/siteboss.png
Normal file
BIN
html/images/os/siteboss.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
15
includes/definitions/discovery/siteboss.yaml
Normal file
15
includes/definitions/discovery/siteboss.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
mib: SITEBOSS-530-STD-MIB
|
||||||
|
modules:
|
||||||
|
sensors:
|
||||||
|
temperature:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: esPointTable
|
||||||
|
value: esPointValueInt
|
||||||
|
num_oid: .1.3.6.1.4.1.3052.12.1.1.1.1.6.
|
||||||
|
descr: esPointName
|
||||||
|
skip_values:
|
||||||
|
-
|
||||||
|
oid: esIndexPC
|
||||||
|
op: '!='
|
||||||
|
value: 1
|
13
includes/definitions/siteboss.yaml
Normal file
13
includes/definitions/siteboss.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
os: siteboss
|
||||||
|
text: 'Asentria SiteBoss'
|
||||||
|
type: server
|
||||||
|
icon: siteboss
|
||||||
|
over:
|
||||||
|
- { graph: device_bits, text: 'Device Traffic' }
|
||||||
|
- { graph: device_processor, text: 'CPU Usage' }
|
||||||
|
- { graph: device_mempool, text: 'Memory Usage' }
|
||||||
|
mib_dir:
|
||||||
|
- asentria
|
||||||
|
discovery:
|
||||||
|
- sysObjectId:
|
||||||
|
- .1.3.6.1.4.1.3052.12
|
@@ -916,12 +916,22 @@ function ignore_storage($os, $descr)
|
|||||||
* @param $value
|
* @param $value
|
||||||
* @param $data
|
* @param $data
|
||||||
* @param $group
|
* @param $group
|
||||||
|
* @param null $index
|
||||||
|
* @param array $pre_cache
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function can_skip_sensor($value, $data, $group)
|
function can_skip_sensor($value, $data, $group, $pre_cache = array())
|
||||||
{
|
{
|
||||||
$skip_values = array_replace((array)$group['skip_values'], (array)$data['skip_values']);
|
$skip_values = array_replace((array)$group['skip_values'], (array)$data['skip_values']);
|
||||||
foreach ($skip_values as $skip_value) {
|
foreach ($skip_values as $skip_value) {
|
||||||
|
if (is_array($skip_value) && $pre_cache) {
|
||||||
|
// Dynamic skipping of data
|
||||||
|
$op = isset($skip_value['op']) ? $skip_value['op'] : '!=';
|
||||||
|
$tmp_value = $pre_cache[$skip_value['oid']];
|
||||||
|
if (compare_var($tmp_value, $skip_value['value'], $op) == true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($value == $skip_value) {
|
if ($value == $skip_value) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -941,6 +951,8 @@ function can_skip_sensor($value, $data, $group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -992,7 +1004,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
|
|||||||
|
|
||||||
d_echo("Final sensor value: $value\n");
|
d_echo("Final sensor value: $value\n");
|
||||||
|
|
||||||
if (can_skip_sensor($value, $data, $sensor_options) === false && is_numeric($value)) {
|
if (can_skip_sensor($value, $data, $sensor_options, $raw_data[$index]) === false && is_numeric($value)) {
|
||||||
$oid = $data['num_oid'] . $index;
|
$oid = $data['num_oid'] . $index;
|
||||||
|
|
||||||
// process the description
|
// process the description
|
||||||
|
23
includes/polling/os/siteboss.inc.php
Normal file
23
includes/polling/os/siteboss.inc.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LibreNMS OS Polling module for Asentria
|
||||||
|
*
|
||||||
|
* © 2017 Chris A. Evans <thecityofguanyu@outlook.com>
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$asentsysdescr = $poll_device['sysDescr'];
|
||||||
|
$version = preg_replace('/^\s*(\S+\s+\S+\s+)/', '', $asentsysdescr);
|
||||||
|
$hardware = preg_match('/^\S+\s+\d+\s+/', $asentsysdescr, $matches);
|
||||||
|
$hardware = trim($matches[0]);
|
||||||
|
|
||||||
|
unset(
|
||||||
|
$asentsysdescr,
|
||||||
|
$matches
|
||||||
|
);
|
25
mibs/asentria/ASENTRIA-ROOT-MIB
Normal file
25
mibs/asentria/ASENTRIA-ROOT-MIB
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
ASENTRIA-ROOT-MIB DEFINITIONS ::= BEGIN
|
||||||
|
|
||||||
|
IMPORTS
|
||||||
|
MODULE-IDENTITY,
|
||||||
|
enterprises
|
||||||
|
FROM SNMPv2-SMI;
|
||||||
|
|
||||||
|
asentria MODULE-IDENTITY
|
||||||
|
LAST-UPDATED "201003090000Z"
|
||||||
|
ORGANIZATION "Asentria Corporation"
|
||||||
|
CONTACT-INFO
|
||||||
|
"Phone: 206-344-8800
|
||||||
|
Fax: 206-344-2116
|
||||||
|
Email: support@asentria.com"
|
||||||
|
DESCRIPTION
|
||||||
|
"Asentria root MIB module"
|
||||||
|
REVISION "201003090000Z"
|
||||||
|
DESCRIPTION
|
||||||
|
"Updated CONTACT-INFO comment."
|
||||||
|
REVISION "200709090000Z"
|
||||||
|
DESCRIPTION
|
||||||
|
"Asentria root MIB module"
|
||||||
|
::= { enterprises 3052 }
|
||||||
|
--1.3.6.1.4.1.3052
|
||||||
|
END
|
15784
mibs/asentria/SITEBOSS-530-STD-MIB
Normal file
15784
mibs/asentria/SITEBOSS-530-STD-MIB
Normal file
File diff suppressed because it is too large
Load Diff
2
tests/snmpsim/siteboss.snmprec
Normal file
2
tests/snmpsim/siteboss.snmprec
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1.3.6.1.2.1.1.1.0|4|SiteBoss 530 2.10.540 STD
|
||||||
|
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.3052.12.3.2
|
Reference in New Issue
Block a user