Skip to content

Commit 609d238

Browse files
alagouttelaf
andauthored
Update Fortios FAZ (FortiAnalyzer) hardware detection (librenms#18327)
* fortios: enhance regex for support also FAZ * FortiOS: remove FortiAnalyzer/FortiManager from shared hardware it is now detected via hardware regex * Add tests with FortiAnalyzer (FAZ): 7.6.4 * fortios: update replace fmg -> FortiManager (FMG) faz -> FortiAnalyzer (FAZ) * Add tests with FortiManager (FMG): 7.6.4 * fortios(faz): update hardware (after update replace) * Update fortios.snmprec * Fix SNMP OID format in fortios.snmprec * Update fortios.json --------- Co-authored-by: Neil Lathwood <gh+n@laf.io>
1 parent c449de1 commit 609d238

File tree

9 files changed

+5809
-44
lines changed

9 files changed

+5809
-44
lines changed

LibreNMS/OS/Fortios.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function discoverOS(Device $device): void
3838
{
3939
parent::discoverOS($device); // yaml
4040

41-
$device->hardware = $device->hardware ?: $this->getHardwareName();
4241
$device->features = snmp_get($this->getDeviceArray(), 'fmDeviceEntMode.1', '-OQv', 'FORTINET-FORTIMANAGER-FORTIANALYZER-MIB') == 'fmg-faz' ? 'with Analyzer features' : null;
4342
}
4443

LibreNMS/OS/Shared/Fortinet.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ class Fortinet extends \LibreNMS\OS
3131
protected function getHardwareName()
3232
{
3333
$rewrite_fortinet_hardware = [
34-
'.1.3.6.1.4.1.12356.102.1.1000' => 'FortiAnalyzer 100',
35-
'.1.3.6.1.4.1.12356.102.1.10002' => 'FortiAnalyzer 1000B',
36-
'.1.3.6.1.4.1.12356.102.1.1001' => 'FortiAnalyzer 100A',
37-
'.1.3.6.1.4.1.12356.102.1.1002' => 'FortiAnalyzer 100B',
38-
'.1.3.6.1.4.1.12356.102.1.20000' => 'FortiAnalyzer 2000',
39-
'.1.3.6.1.4.1.12356.102.1.20001' => 'FortiAnalyzer 2000A',
40-
'.1.3.6.1.4.1.12356.102.1.4000' => 'FortiAnalyzer 400',
41-
'.1.3.6.1.4.1.12356.102.1.40000' => 'FortiAnalyzer 4000',
42-
'.1.3.6.1.4.1.12356.102.1.40001' => 'FortiAnalyzer 4000A',
43-
'.1.3.6.1.4.1.12356.102.1.4002' => 'FortiAnalyzer 400B',
44-
'.1.3.6.1.4.1.12356.102.1.8000' => 'FortiAnalyzer 800',
45-
'.1.3.6.1.4.1.12356.102.1.8002' => 'FortiAnalyzer 800B',
4634
'.1.3.6.1.4.1.12356.101.1.1000' => 'FortiGate 100',
4735
'.1.3.6.1.4.1.12356.101.1.10000' => 'FortiGate 1000',
4836
'.1.3.6.1.4.1.12356.101.1.10001' => 'FortiGate 1000A',
@@ -93,30 +81,6 @@ protected function getHardwareName()
9381
'.1.3.6.1.4.1.12356.101.1.8001' => 'FortiGate 800F',
9482
'.1.3.6.1.4.1.12356.101.1.800' => 'FortiGate 80C',
9583
'.1.3.6.1.4.1.12356.1688' => 'FortiMail 2000A',
96-
'.1.3.6.1.4.1.12356.103.1.1000' => 'FortiManager 100',
97-
'.1.3.6.1.4.1.12356.103.1.1001' => 'FortiManager VM',
98-
'.1.3.6.1.4.1.12356.103.1.1003' => 'FortiManager 100C',
99-
'.1.3.6.1.4.1.12356.103.1.2004' => 'FortiManager 200D',
100-
'.1.3.6.1.4.1.12356.103.1.2005' => 'FortiManager 200E',
101-
'.1.3.6.1.4.1.12356.103.1.3004' => 'FortiManager 300D',
102-
'.1.3.6.1.4.1.12356.103.1.3005' => 'FortiManager 300E',
103-
'.1.3.6.1.4.1.12356.103.1.4000' => 'FortiManager 400',
104-
'.1.3.6.1.4.1.12356.103.1.4001' => 'FortiManager 400A',
105-
'.1.3.6.1.4.1.12356.103.1.4002' => 'FortiManager 400B',
106-
'.1.3.6.1.4.1.12356.103.1.4003' => 'FortiManager 400C',
107-
'.1.3.6.1.4.1.12356.103.1.4005' => 'FortiManager 400E',
108-
'.1.3.6.1.4.1.12356.103.1.10003' => 'FortiManager 1000C',
109-
'.1.3.6.1.4.1.12356.103.1.10004' => 'FortiManager 1000D',
110-
'.1.3.6.1.4.1.12356.103.1.20005' => 'FortiManager 2000E',
111-
'.1.3.6.1.4.1.12356.103.1.20000' => 'FortiManager 2000XL',
112-
'.1.3.6.1.4.1.12356.103.1.30000' => 'FortiManager 3000',
113-
'.1.3.6.1.4.1.12356.103.1.30002' => 'FortiManager 3000B',
114-
'.1.3.6.1.4.1.12356.103.1.30003' => 'FortiManager 3000C',
115-
'.1.3.6.1.4.1.12356.103.1.30006' => 'FortiManager 3000F',
116-
'.1.3.6.1.4.1.12356.103.1.39005' => 'FortiManager 3900E',
117-
'.1.3.6.1.4.1.12356.103.1.40004' => 'FortiManager 4000D',
118-
'.1.3.6.1.4.1.12356.103.1.40005' => 'FortiManager 4000E',
119-
'.1.3.6.1.4.1.12356.103.1.50011' => 'FortiManager 5001A',
12084
'.1.3.6.1.4.1.12356.106.1.50030' => 'FortiSwitch 5003A',
12185
'.1.3.6.1.4.1.12356.101.1.510' => 'FortiWiFi 50B',
12286
'.1.3.6.1.4.1.12356.101.1.610' => 'FortiWiFi 60',

resources/definitions/os_discovery/fortios.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ modules:
1414
hardware:
1515
- ENTITY-MIB::entPhysicalModelName.1
1616
- SNMPv2-MIB::sysObjectID.0
17-
hardware_regex: '/::(?<hardware>fmg[0-9A-Za-z]+)$/i'
17+
hardware_regex: '/::(?<hardware>[fmg|faz][0-9A-Za-z]+)$/i'
1818
hardware_replace:
19-
- ['/^fmg/', 'FMG ']
19+
- ['/^fmg/', 'FortiManager (FMG) ']
20+
- ['/^faz/', 'FortiAnalyzer (FAZ) ']
2021
- ['/vm$/', 'VM']

tests/data/fortios.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"devices": [
55
{
66
"sysName": "<private>",
7-
"sysObjectID": ".1.3.6.1.4.1.12356.103",
8-
"sysDescr": "",
7+
"sysObjectID": ".1.3.6.1.4.1.12356.103.1.64",
8+
"sysDescr": "FortiManager",
99
"sysContact": "<private>",
1010
"version": "v5.6.0-build1557 170727 (GA)",
11-
"hardware": null,
11+
"hardware": "FortiManager (FMG) VM",
1212
"features": "with Analyzer features",
1313
"location": "<private>",
1414
"os": "fortios",

0 commit comments

Comments
 (0)