mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: move some os from linux and freebsd discovery files to yaml (#5429)
This commit is contained in:
committed by
Neil Lathwood
parent
34084af803
commit
0ab2f18f7d
@@ -5,3 +5,11 @@ icon: cambium
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
group: cambium
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.17713.21
|
||||
- sysDescr_regex:
|
||||
- '/^Cambium PTP 50650/'
|
||||
- '/^PTP250/'
|
||||
- '/^Cambium/'
|
||||
|
||||
|
@@ -7,6 +7,9 @@ over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
discovery:
|
||||
- sysDescr_regex: '/^Linux.*Cisco Small Business/'
|
||||
|
||||
poller_modules:
|
||||
cisco-cbqos: 1
|
||||
cisco-cef: 1
|
||||
|
@@ -2,6 +2,11 @@ os: ciscowap
|
||||
text: 'Cisco Wireless Acess Point'
|
||||
type: wireless
|
||||
icon: cisco
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.9.6.1.32.321.1
|
||||
- sysDescr:
|
||||
- 'Cisco Small Business WAP'
|
||||
poller_modules:
|
||||
cisco-cbqos: 1
|
||||
cisco-cef: 1
|
||||
|
@@ -8,3 +8,6 @@ over:
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
processor_stacked: 1
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.40310
|
||||
|
@@ -8,3 +8,5 @@ over:
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
processor_stacked: 1
|
||||
discovery:
|
||||
- sysDescr_regex: '/^Linux.*endian/'
|
||||
|
@@ -6,3 +6,5 @@ over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
discovery:
|
||||
- sysDescr_regex: '/^Linux mirthtemplate/'
|
||||
|
@@ -6,3 +6,6 @@ over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
processor_stacked: 1
|
||||
discovery:
|
||||
- sysDescr:
|
||||
- m0n0wall
|
||||
|
@@ -4,3 +4,7 @@ type: environment
|
||||
over:
|
||||
- { graph: device_temperature, text: Temperature }
|
||||
- { graph: device_humidity, text: Humidity }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.5528.100.20.10.2014
|
||||
- .1.3.6.1.4.1.5528.100.20.10.2016
|
||||
|
@@ -6,3 +6,6 @@ processor_stacked: 1
|
||||
over:
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_ucd_memory, text: 'Memory Usage' }
|
||||
discovery:
|
||||
- sysDescr:
|
||||
- pfSense
|
||||
|
@@ -2,3 +2,8 @@ os: powerwalker
|
||||
text: 'PowerWalker UPS'
|
||||
type: power
|
||||
icon: powerwalker
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.935.10
|
||||
- sysDescr_regex:
|
||||
- '/^Network Management Card for UPS/'
|
||||
|
@@ -8,3 +8,6 @@ over:
|
||||
- { graph: device_processor, text: 'Processor Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
processor_stacked: 1
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.15397.2
|
||||
|
@@ -4,3 +4,9 @@ ifname: 1
|
||||
type: network
|
||||
over:
|
||||
- { graph: device_bits, text: Traffic }
|
||||
discovery:
|
||||
- sysDescr:
|
||||
- 'TG585v7'
|
||||
- 'SpeedTouch '
|
||||
- sysDescr_regex:
|
||||
- '/^ST/'
|
||||
|
11
includes/definitions/voswall.yaml
Normal file
11
includes/definitions/voswall.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
os: voswall
|
||||
group: unix
|
||||
text: Voswall
|
||||
type: firewall
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
processor_stacked: 1
|
||||
discovery:
|
||||
- sysDescr:
|
||||
- Voswall
|
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
if (starts_with($sysDescr, array('Cambium PTP 50650', 'PTP250', 'Cambium'))) {
|
||||
$os = 'cambium';
|
||||
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.17713.21')) {
|
||||
$os = 'cambium';
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (str_contains($sysDescr, 'Cisco Small Business WAP')) {
|
||||
$os = 'ciscowap';
|
||||
}
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.9.6.1.32.321.1')) {
|
||||
$os = 'ciscowap';
|
||||
}
|
@@ -1,12 +1,6 @@
|
||||
<?php
|
||||
|
||||
// FreeBSD variants, check for specialized distros first
|
||||
if (str_contains($sysDescr, 'pfSense')) {
|
||||
$os = 'pfsense';
|
||||
} elseif (str_contains($sysDescr, 'Voswall')) {
|
||||
$os = 'voswall';
|
||||
} elseif (str_contains($sysDescr, 'm0n0wall')) {
|
||||
$os = 'monowall';
|
||||
} elseif (str_contains($sysDescr, 'FreeBSD')) {
|
||||
// do not move to yaml, this check needs to happen last
|
||||
if (starts_with($sysDescr, 'FreeBSD')) {
|
||||
$os = 'freebsd';
|
||||
}
|
||||
|
@@ -5,16 +5,8 @@ if (starts_with($sysDescr, 'Linux')) {
|
||||
$os = 'linux';
|
||||
|
||||
// Specific Linux-derivatives
|
||||
if (starts_with($sysObjectId, array('.1.3.6.1.4.1.5528.100.20.10.2014', '.1.3.6.1.4.1.5528.100.20.10.2016'))) {
|
||||
$os = 'netbotz';
|
||||
} elseif (str_contains($sysDescr, 'endian')) {
|
||||
$os = 'endian';
|
||||
} elseif (str_contains($sysDescr, 'Cisco Small Business')) {
|
||||
$os = 'ciscosmblinux';
|
||||
} elseif (str_contains(snmp_get($device, 'ENTITY-MIB::entPhysicalMfgName.1', '-Osqnv'), 'QNAP')) {
|
||||
if (str_contains(snmp_get($device, 'ENTITY-MIB::entPhysicalMfgName.1', '-Osqnv'), 'QNAP')) {
|
||||
$os = 'qnap';
|
||||
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.15397.2')) {
|
||||
$os = 'procera';
|
||||
} elseif (starts_with($sysObjectId, array('.1.3.6.1.4.1.10002.1', '.1.3.6.1.4.1.41112.1.4')) || str_contains(snmp_get($device, 'dot11manufacturerName.5', '-Osqnv', 'IEEE802dot11-MIB'), 'Ubiquiti')) {
|
||||
$os = 'airos';
|
||||
if (str_contains(snmp_walk($device, 'dot11manufacturerProductName', '-Osqnv', 'IEEE802dot11-MIB'), 'UAP')) {
|
||||
@@ -24,14 +16,10 @@ if (starts_with($sysDescr, 'Linux')) {
|
||||
}
|
||||
} elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) {
|
||||
$os = 'pktj';
|
||||
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.40310')) {
|
||||
$os = 'cumulus';
|
||||
} elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) {
|
||||
$os = 'ddnos';
|
||||
} elseif (is_numeric(trim(snmp_get($device, 'roomTemp.0', '-OqvU', 'CAREL-ug40cdz-MIB', 'carel')))) {
|
||||
$os = 'pcoweb'; // Carel PCOweb
|
||||
} elseif (starts_with($sysDescr, 'Linux mirthtemplate')) {
|
||||
$os = 'mirth';
|
||||
} elseif ($wrt = snmp_get($device, '.1.3.6.1.4.1.2021.7890.1.101.1', '-Osqnv')) {
|
||||
$wrt = trim($wrt, '"');
|
||||
if (starts_with($wrt, 'ASUSWRT-Merlin')) {
|
||||
|
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Neil Lathwood <neil@lathwood.co.uk>
|
||||
* 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.
|
||||
*/
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.935.10') || starts_with($sysDescr, 'Network Management Card for UPS')) {
|
||||
$os = 'powerwalker';
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (str_contains($sysDescr, array('TG585v7', 'SpeedTouch ')) || starts_with($sysDescr, 'ST')) {
|
||||
$os = 'speedtouch';
|
||||
}
|
@@ -1 +1,2 @@
|
||||
1.3.6.1.2.1.1.1.0|4|FreeBSD
|
||||
1.3.6.1.2.1.1.1.0|4|FreeBSD some.example.org 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.2238
|
||||
|
Reference in New Issue
Block a user