From 0ab2f18f7d43769abc5635449c00f94c3256ae6c Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 14 Jan 2017 08:54:16 -0600 Subject: [PATCH] refactor: move some os from linux and freebsd discovery files to yaml (#5429) --- includes/definitions/cambium.yaml | 8 ++++++++ includes/definitions/ciscosmblinux.yaml | 3 +++ includes/definitions/ciscowap.yaml | 5 +++++ includes/definitions/cumulus.yaml | 3 +++ includes/definitions/endian.yaml | 2 ++ includes/definitions/mirth.yaml | 2 ++ includes/definitions/monowall.yaml | 3 +++ includes/definitions/netbotz.yaml | 4 ++++ includes/definitions/pfsense.yaml | 3 +++ includes/definitions/powerwalker.yaml | 5 +++++ includes/definitions/procera.yaml | 3 +++ includes/definitions/speedtouch.yaml | 6 ++++++ includes/definitions/voswall.yaml | 11 +++++++++++ includes/discovery/os/cambium.inc.php | 16 ---------------- includes/discovery/os/ciscowap.inc.php | 9 --------- includes/discovery/os/freebsd.inc.php | 10 ++-------- includes/discovery/os/linux.inc.php | 14 +------------- includes/discovery/os/powerwalker.inc.php | 15 --------------- includes/discovery/os/speedtouch.inc.php | 5 ----- tests/snmpsim/freebsd.snmprec | 3 ++- 20 files changed, 63 insertions(+), 67 deletions(-) create mode 100644 includes/definitions/voswall.yaml delete mode 100644 includes/discovery/os/cambium.inc.php delete mode 100644 includes/discovery/os/ciscowap.inc.php delete mode 100644 includes/discovery/os/powerwalker.inc.php delete mode 100644 includes/discovery/os/speedtouch.inc.php diff --git a/includes/definitions/cambium.yaml b/includes/definitions/cambium.yaml index 152e53096f..0265d1dc6c 100644 --- a/includes/definitions/cambium.yaml +++ b/includes/definitions/cambium.yaml @@ -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/' + diff --git a/includes/definitions/ciscosmblinux.yaml b/includes/definitions/ciscosmblinux.yaml index 9d79b94e5f..3508d219f6 100644 --- a/includes/definitions/ciscosmblinux.yaml +++ b/includes/definitions/ciscosmblinux.yaml @@ -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 diff --git a/includes/definitions/ciscowap.yaml b/includes/definitions/ciscowap.yaml index c374c6f1fe..ba6ced0e48 100644 --- a/includes/definitions/ciscowap.yaml +++ b/includes/definitions/ciscowap.yaml @@ -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 diff --git a/includes/definitions/cumulus.yaml b/includes/definitions/cumulus.yaml index 91d142e47e..b71b735c5c 100644 --- a/includes/definitions/cumulus.yaml +++ b/includes/definitions/cumulus.yaml @@ -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 diff --git a/includes/definitions/endian.yaml b/includes/definitions/endian.yaml index 5de3516a1e..88ad74823e 100644 --- a/includes/definitions/endian.yaml +++ b/includes/definitions/endian.yaml @@ -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/' diff --git a/includes/definitions/mirth.yaml b/includes/definitions/mirth.yaml index c67f47fa0b..18629e15ed 100644 --- a/includes/definitions/mirth.yaml +++ b/includes/definitions/mirth.yaml @@ -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/' diff --git a/includes/definitions/monowall.yaml b/includes/definitions/monowall.yaml index acba7ea05d..b0ec1b4c58 100644 --- a/includes/definitions/monowall.yaml +++ b/includes/definitions/monowall.yaml @@ -6,3 +6,6 @@ over: - { graph: device_bits, text: 'Device Traffic' } - { graph: device_processor, text: 'CPU Usage' } processor_stacked: 1 +discovery: + - sysDescr: + - m0n0wall diff --git a/includes/definitions/netbotz.yaml b/includes/definitions/netbotz.yaml index 0deda89c24..b70b368390 100644 --- a/includes/definitions/netbotz.yaml +++ b/includes/definitions/netbotz.yaml @@ -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 diff --git a/includes/definitions/pfsense.yaml b/includes/definitions/pfsense.yaml index 5b1b50f265..fe4a0ab81f 100644 --- a/includes/definitions/pfsense.yaml +++ b/includes/definitions/pfsense.yaml @@ -6,3 +6,6 @@ processor_stacked: 1 over: - { graph: device_processor, text: 'Processor Usage' } - { graph: device_ucd_memory, text: 'Memory Usage' } +discovery: + - sysDescr: + - pfSense diff --git a/includes/definitions/powerwalker.yaml b/includes/definitions/powerwalker.yaml index df47524513..a81842c690 100644 --- a/includes/definitions/powerwalker.yaml +++ b/includes/definitions/powerwalker.yaml @@ -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/' diff --git a/includes/definitions/procera.yaml b/includes/definitions/procera.yaml index 2effbebd84..fdabcb71e3 100644 --- a/includes/definitions/procera.yaml +++ b/includes/definitions/procera.yaml @@ -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 diff --git a/includes/definitions/speedtouch.yaml b/includes/definitions/speedtouch.yaml index d5794f80ea..b3616dc769 100644 --- a/includes/definitions/speedtouch.yaml +++ b/includes/definitions/speedtouch.yaml @@ -4,3 +4,9 @@ ifname: 1 type: network over: - { graph: device_bits, text: Traffic } +discovery: + - sysDescr: + - 'TG585v7' + - 'SpeedTouch ' + - sysDescr_regex: + - '/^ST/' diff --git a/includes/definitions/voswall.yaml b/includes/definitions/voswall.yaml new file mode 100644 index 0000000000..b63106a99f --- /dev/null +++ b/includes/definitions/voswall.yaml @@ -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 diff --git a/includes/discovery/os/cambium.inc.php b/includes/discovery/os/cambium.inc.php deleted file mode 100644 index da3beff0f6..0000000000 --- a/includes/discovery/os/cambium.inc.php +++ /dev/null @@ -1,16 +0,0 @@ - - * 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'; -} diff --git a/includes/discovery/os/speedtouch.inc.php b/includes/discovery/os/speedtouch.inc.php deleted file mode 100644 index 8f137e2302..0000000000 --- a/includes/discovery/os/speedtouch.inc.php +++ /dev/null @@ -1,5 +0,0 @@ -