mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
osnexus quantastor initial support (#12045)
* initial release * fixes * cleaner snmprec * updates * remove legacy files * updates * fixes * cleanup * test data ... again * yaml fix and test data * tests update * polling temps * remove unused line * - hdd temp fix - tests without ignores
This commit is contained in:
parent
dda6377424
commit
9026cf54c0
@ -131,7 +131,7 @@ class YamlDiscovery
|
||||
$value = str_replace($search, $replace, $data[$name]);
|
||||
|
||||
// search discovery data for values
|
||||
$value = preg_replace_callback('/{{ \$([a-zA-Z0-9.]+) }}/', function ($matches) use ($index, $data, $pre_cache) {
|
||||
$value = preg_replace_callback('/{{ \$([a-zA-Z0-9\-.]+) }}/', function ($matches) use ($index, $data, $pre_cache) {
|
||||
$replace = static::getValueFromData($matches[1], $index, $data, $pre_cache, null);
|
||||
if (is_null($replace)) {
|
||||
d_echo('Warning: No variable available to replace ' . $matches[1] . ".\n");
|
||||
|
41
LibreNMS/OS/Quantastor.php
Normal file
41
LibreNMS/OS/Quantastor.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Quantastor.php
|
||||
*
|
||||
* OSNEXUS QuantaStor OS
|
||||
*
|
||||
* 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 2020 Cercel Valentin
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Interfaces\Discovery\OSDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Quantastor extends OS implements OSDiscovery
|
||||
{
|
||||
public function discoverOS(): void
|
||||
{
|
||||
$device = $this->getDeviceModel();
|
||||
$info = snmp_get_multi_oid($this->getDevice(), 'storageSystem-ServiceVersion.0 hwEnclosure-Vendor.0 hwEnclosure-Model.0 storageSystem-SerialNumber.0', '-OQUs', 'QUANTASTOR-SYS-STATS');
|
||||
$device->version = $info['storageSystem-ServiceVersion.0'];
|
||||
$device->hardware = $info['hwEnclosure-Vendor.0'] . ' ' . $info['hwEnclosure-Model.0'];
|
||||
$device->serial = $info['storageSystem-SerialNumber.0'];
|
||||
}
|
||||
}
|
3
html/images/logos/quantastor.svg
Normal file
3
html/images/logos/quantastor.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 26 KiB |
3
html/images/os/quantastor.svg
Normal file
3
html/images/os/quantastor.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="138.19215388576094 71.10800867082732 70.61601950410221 70.61612425807049"><defs><path d="M142.28 74.53C147.73 69.47 156.56 73.42 161.88 76.63C165.3 78.69 168.63 81.2 171.81 83.96C176.75 80.22 186.83 73.05 195 72.35C190.11 73.33 182.73 77.62 173.02 86.26C206 65.48 192.42 87.57 182.9 100.64C162.19 78.99 144.04 72.02 140.03 77.83C140.5 76.61 141.23 75.5 142.28 74.53ZM150 138.48C154.9 137.5 162.27 133.21 171.98 124.57C139.01 145.35 152.58 123.26 162.1 110.19C182.81 131.84 200.96 138.81 204.97 133C204.5 134.22 203.77 135.34 202.72 136.31C197.27 141.36 188.44 137.42 183.12 134.21C179.7 132.14 176.37 129.63 173.19 126.87C168.25 130.61 158.18 137.78 150 138.48Z" id="j21oVcpA0Q"></path><path d="M141.61 135.64C136.55 130.18 140.5 121.35 143.71 116.04C145.77 112.62 148.28 109.29 151.05 106.11C147.3 101.16 140.13 91.09 139.43 82.92C140.42 87.81 144.7 95.19 153.35 104.89C132.57 71.92 154.65 85.5 167.73 95.01C146.08 115.73 139.1 133.87 144.91 137.88C143.69 137.42 142.58 136.69 141.61 135.64ZM203.39 75.19C208.45 80.65 204.5 89.48 201.29 94.8C199.23 98.22 196.72 101.55 193.95 104.73C197.7 109.67 204.87 119.74 205.57 127.91C204.58 123.02 200.3 115.65 191.65 105.94C212.43 138.91 190.35 125.33 177.27 115.82C198.92 95.1 205.9 76.96 200.09 72.95C201.31 73.41 202.42 74.15 203.39 75.19Z" id="e3zHgRA3XH"></path></defs><g><g><use xlink:href="#j21oVcpA0Q" opacity="1" fill="#93bf2c" fill-opacity="1"></use><g><use xlink:href="#j21oVcpA0Q" opacity="1" fill-opacity="0" stroke="#000000" stroke-width="1" stroke-opacity="0"></use></g></g><g><use xlink:href="#e3zHgRA3XH" opacity="1" fill="#0d0d10" fill-opacity="1"></use><g><use xlink:href="#e3zHgRA3XH" opacity="1" fill-opacity="0" stroke="#000000" stroke-width="1" stroke-opacity="0"></use></g></g></g></svg>
|
After Width: | Height: | Size: 2.0 KiB |
131
includes/definitions/discovery/quantastor.yaml
Normal file
131
includes/definitions/discovery/quantastor.yaml
Normal file
@ -0,0 +1,131 @@
|
||||
mib: QUANTASTOR-SYS-STATS:LM-SENSORS-MIB
|
||||
modules:
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
oid: hwDiskTable
|
||||
value: hwDisk-DriveTemp
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.48.1.1.30.{{ $index }}'
|
||||
index: '{{ $hwDisk-Index }}.{{ $index }}'
|
||||
descr: '{{ $hwDisk-Name }}'
|
||||
group: 'HDD'
|
||||
-
|
||||
oid: lmTempSensors
|
||||
value: lmTempSensorsValue
|
||||
divisor: 1000
|
||||
num_oid: '.1.3.6.1.4.1.2021.13.16.2.1.3.{{ $index }}'
|
||||
descr: '{{ $lmTempSensorsDevice }}'
|
||||
group: 'LM-SENSORS'
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: licenseTable
|
||||
value: license-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.21.1.1.5.0'
|
||||
descr: 'License'
|
||||
group: 'Status'
|
||||
state_name: license-status
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: hwDiskTable
|
||||
value: hwDisk-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.48.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: '{{ $hwDisk-Name }} SN {{ $hwDisk-SerialNum }}'
|
||||
group: 'HDD'
|
||||
state_name: hwDisk-status
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
- { value: 1, generic: 1, graph: 1, descr: 'Rebuilding' }
|
||||
-
|
||||
oid: hwUnitTable
|
||||
value: hwUnit-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.49.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: '{{ $hwUnit-Name }}'
|
||||
group: 'Array(s)'
|
||||
state_name: hwUnit-status
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: hwEnclosureTable
|
||||
value: hwEnclosure-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.50.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Enclosure {{ $hwEnclosure-Name }}'
|
||||
group: 'Enclosure(s)'
|
||||
state_name: hwEnclosure-status
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: hwEnclosureTable
|
||||
value: hwEnclosure-AlarmCount
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.50.1.1.22.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Enclosure {{ $hwEnclosure-Name }} alarm'
|
||||
group: 'Enclosure(s)'
|
||||
state_name: hwEnclosure-alarms
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: fcTargetPortTable
|
||||
value: fcTargetPort-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.68.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'FC port {{ $index }} Target state'
|
||||
group: 'FC ports'
|
||||
state_name: fctarget-state
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: fcTargetPortTable
|
||||
value: fcTargetPort-IsTargetModeEnabled
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.68.1.1.33.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'FC port {{ $index }} Target enabled'
|
||||
group: 'FC ports'
|
||||
state_name: fctarget-enablestate
|
||||
states:
|
||||
- { value: 1, generic: 0, graph: 0, descr: 'Enabled' }
|
||||
-
|
||||
oid: hwEnclosureTable
|
||||
value: hwEnclosure-TempSensorUnits
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.50.1.1.20.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Temp sensor {{ $index }}'
|
||||
group: 'Temp sensor(s)'
|
||||
state_name: hwEnclosure-tempsens
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: hwEnclosureTable
|
||||
value: hwEnclosure-PowerSupplyUnits
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.50.1.1.21.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'PSU sensor {{ $index }}'
|
||||
group: 'PSU sensor(s)'
|
||||
state_name: hwEnclosure-psusens
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: storagePoolTable
|
||||
value: storagePool-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.7.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Pool {{ $storagePool-Name }}'
|
||||
group: 'Pools'
|
||||
state_name: storagePool
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
||||
-
|
||||
oid: storageVolumeTable
|
||||
value: storageVolume-State
|
||||
num_oid: '.1.3.6.1.4.1.39324.1.1.3.1.1.5.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Volume {{ $storageVolume-Name }}'
|
||||
group: 'Volumes'
|
||||
state_name: storageVolume
|
||||
states:
|
||||
- { value: 0, generic: 0, graph: 0, descr: 'OK' }
|
24
includes/definitions/quantastor.yaml
Normal file
24
includes/definitions/quantastor.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
os: quantastor
|
||||
text: 'QuantaStor'
|
||||
type: storage
|
||||
icon: quantastor
|
||||
ifXmcbc: true
|
||||
ifname: true
|
||||
mib_dir: osnexus
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
poller_modules:
|
||||
bgp-peers: false
|
||||
wireless: false
|
||||
ospf: false
|
||||
stp: false
|
||||
processor_stacked: true
|
||||
discovery:
|
||||
-
|
||||
sysObjectID: .1.3.6.1.4.1.8072.3.2.10
|
||||
snmpget:
|
||||
oid: QUANTASTOR-SYS-STATS::storageSystem-ProductId.0
|
||||
op: starts
|
||||
value: 'QUANTASTOR'
|
27
includes/polling/sensors/temperature/quantastor.inc.php
Normal file
27
includes/polling/sensors/temperature/quantastor.inc.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* quantastor.inc.php
|
||||
*
|
||||
* OSNEXUS QuantaStor poller temperatures
|
||||
*
|
||||
* 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 2020 Cercel Valentin
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*/
|
||||
|
||||
preg_match('/([0-9]+)/', $sensor_value, $temps);
|
||||
$sensor_value = $temps[0];
|
23466
mibs/osnexus/QUANTASTOR-SYS-STATS
Normal file
23466
mibs/osnexus/QUANTASTOR-SYS-STATS
Normal file
File diff suppressed because it is too large
Load Diff
4266
tests/data/quantastor.json
Normal file
4266
tests/data/quantastor.json
Normal file
File diff suppressed because it is too large
Load Diff
5189
tests/snmpsim/quantastor.snmprec
Normal file
5189
tests/snmpsim/quantastor.snmprec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user