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:
Chris A. Evans
2017-11-14 08:35:32 -06:00
committed by Tony Murray
parent 8e61c6394a
commit 64aed60f09
8 changed files with 15876 additions and 2 deletions

BIN
html/images/os/siteboss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View 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

View 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

View File

@ -916,12 +916,22 @@ function ignore_storage($os, $descr)
* @param $value
* @param $data
* @param $group
* @param null $index
* @param array $pre_cache
* @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']);
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) {
return true;
}
@ -941,6 +951,8 @@ function can_skip_sensor($value, $data, $group)
}
}
return false;
}
@ -992,7 +1004,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
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;
// process the description

View 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
);

View 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

File diff suppressed because it is too large Load Diff

View 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