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
Add OS detection and temperature sensor support for Asentria SiteBoss #7655
Changes from 3 commits
ff105f9
b2198d2
3fb99b5
54a713e
5622026
76bbd6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* LibreNMS Temperature Sensor Discovery module for Asentria SiteBoss | ||
* | ||
* © 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. | ||
*/ | ||
|
||
echo 'Asentria SiteBoss '; | ||
|
||
$tempoids = snmp_walk($device, 'esIndexPC', '-Osqn', 'SITEBOSS-530-STD-MIB'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this not be converted to yaml? If not, you should at least use one of the snmp walk cache functions so you don't need to split on new lines and things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked at the YAML sensor docs and certainly considered it, but wasn't as confident in my ability to make it work as I was with the PHP files. |
||
$tempoids = trim($tempoids); | ||
|
||
foreach (explode("\n", $tempoids) as $data) { | ||
$data = trim($data); | ||
$data = explode(" ", $data); | ||
if ($data[1] == '1') { | ||
$oid = str_replace('.1.3.6.1.4.1.3052.12.1.1.1.1.2.', '', $data[0]); | ||
$temperature_oid = ".1.3.6.1.4.1.3052.12.1.1.1.1.6.$oid"; | ||
$descr_oid = ".1.3.6.1.4.1.3052.12.1.1.1.1.4.$oid"; | ||
$descr = snmp_get($device, $descr_oid, '-Oqv', ''); | ||
$temperature = str_replace('"', '', snmp_get($device, $temperature_oid, '-Oqv', '')); | ||
|
||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $oid, 'siteboss', $descr, '1', '1', null, null, null, null, fahrenheit_to_celsius($temperature)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be:
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
/* | ||
* LibreNMS Temperature Sensor polling module for Asentria SiteBoss | ||
* | ||
* © 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. | ||
*/ | ||
|
||
$sensor_value = fahrenheit_to_celsius($sensor_value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the register of the callback this file shouldn't be needed. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the OS /firmware name or does it not have one and so the product name is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter. Did not have one (that I could find) and so the product name was used.