refactor: move some os from linux and freebsd discovery files to yaml (#5429)

This commit is contained in:
Tony Murray
2017-01-14 08:54:16 -06:00
committed by Neil Lathwood
parent 34084af803
commit 0ab2f18f7d
20 changed files with 63 additions and 67 deletions

View File

@@ -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/'

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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/'

View File

@@ -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/'

View File

@@ -6,3 +6,6 @@ over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
processor_stacked: 1
discovery:
- sysDescr:
- m0n0wall

View File

@@ -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

View File

@@ -6,3 +6,6 @@ processor_stacked: 1
over:
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_ucd_memory, text: 'Memory Usage' }
discovery:
- sysDescr:
- pfSense

View File

@@ -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/'

View File

@@ -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

View File

@@ -4,3 +4,9 @@ ifname: 1
type: network
over:
- { graph: device_bits, text: Traffic }
discovery:
- sysDescr:
- 'TG585v7'
- 'SpeedTouch '
- sysDescr_regex:
- '/^ST/'

View 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

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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')) {

View File

@@ -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';
}

View File

@@ -1,5 +0,0 @@
<?php
if (str_contains($sysDescr, array('TG585v7', 'SpeedTouch ')) || starts_with($sysDescr, 'ST')) {
$os = 'speedtouch';
}

View File

@@ -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