Skip to content

Commit 0814287

Browse files
authored
Fortigate - Improve hardware discovery (librenms#18358)
* fortigate: remove shared fortinet * fortigate: add sysObjectID for hardware * fortigate: fix tests (wrong sysobjectid) * fortigate(discovery): add hardware replace For enhance display of hardware * fortigate(100e): fix hardware * fortigate (1500d-sensors): add hardware * fortigate(1500d): fix tests * fortigate(500D): fix tests about hardware * fortigate(60F): fix tests about hardware * fortigate: add more case on hardware_replace * fortigate (60f3g4g): fix hardware tests * fortigate(cluster-60f): fix hardware tests * fortiwifi: Add back fwf60d (remove in 2020) also update regex for support fw or fwf ref... * fortigate(link-monitor): fix tests (hardware) it is 100F for .1.1000 OID * fortigate_sdwan: fix tests but using strange .15 OID... * fortigate(vm): fix tests There is multiple VM format... * fortigate(webfilter): fix tests with hardware * fortigate: reverse back sysObjectID * fortinet(280): update mib 280... * fortigate: when FORTINET-CORE-MIB::fortinet.15 replace by null it is the oid of old Forti Bridge ?! * fortigate: keep only sysObjectID for hardware * fortigate: reuse entPhysicalModelName.1 but add hardware_replace for enhance name * fortigate: update tests and replace value
1 parent 34019e3 commit 0814287

16 files changed

+53
-17
lines changed

LibreNMS/OS/Fortigate.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@
3333
use LibreNMS\Interfaces\Discovery\Sensors\WirelessApCountDiscovery;
3434
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
3535
use LibreNMS\Interfaces\Polling\OSPolling;
36-
use LibreNMS\OS\Shared\Fortinet;
36+
use LibreNMS\OS;
3737
use LibreNMS\RRD\RrdDefinition;
3838

39-
class Fortigate extends Fortinet implements
39+
class Fortigate extends OS implements
4040
OSPolling,
4141
WirelessClientsDiscovery,
4242
WirelessApCountDiscovery
4343
{
4444
public function discoverOS(Device $device): void
4545
{
4646
parent::discoverOS($device); // yaml
47-
48-
$device->hardware = $device->hardware ?: $this->getHardwareName();
4947
}
5048

5149
public function pollOS(DataStorageInterface $datastore): void

mibs/fortinet/FORTINET-FORTIGATE-MIB

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ fwf41F OBJECT IDENTIFIER ::= { fgModel 446 }
802802
fwf50G OBJECT IDENTIFIER ::= { fgModel 455 }
803803
fwf50GD OBJECT IDENTIFIER ::= { fgModel 457 }
804804
fwf51G OBJECT IDENTIFIER ::= { fgModel 456 }
805+
fwf60D OBJECT IDENTIFIER ::= { fgModel 626 }
805806
fwf60E OBJECT IDENTIFIER ::= { fgModel 639 }
806807
fwf60EJ OBJECT IDENTIFIER ::= { fgModel 662 }
807808
fwf60EV OBJECT IDENTIFIER ::= { fgModel 664 }

mibs/fortinet/FORTINET-MIB-280

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FORTINET-MIB-280 DEFINITIONS ::= BEGIN
1313
DisplayString
1414
FROM SNMPv2-TC
1515
MODULE-IDENTITY, OBJECT-TYPE, Integer32, Gauge32,
16-
enterprises, IpAddress
16+
Counter32, enterprises, IpAddress
1717
FROM SNMPv2-SMI;
1818

1919
--

resources/definitions/os_discovery/fortigate.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ modules:
1111
version: FORTINET-FORTIGATE-MIB::fgSysVersion.0
1212
serial: ENTITY-MIB::entPhysicalSerialNum.1
1313
hardware: ENTITY-MIB::entPhysicalModelName.1
14+
hardware_replace:
15+
- ['/FGR_/', 'FortiGate Rugged ']
16+
- ['/FGT_VM64/', 'FortiGate VM']
17+
- ['/FGT_/', 'FortiGate ']
18+
- ['/FWF_/', 'FortiWiFi ']
19+
1420
processors:
1521
data:
1622
-

tests/data/fortigate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"sysDescr": "",
2727
"sysContact": "<private>",
2828
"version": "v5.6.4,build1575,180425 (GA)",
29-
"hardware": "FGT_501E",
29+
"hardware": "FortiGate 501E",
3030
"features": null,
3131
"location": "<private>",
3232
"os": "fortigate",

tests/data/fortigate_100e.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sysDescr": "Gecom",
99
"sysContact": "<private>",
1010
"version": "v5.4.4,build7650,170529 (GA)",
11-
"hardware": "FGT_100E",
11+
"hardware": "FortiGate 100E",
1212
"features": null,
1313
"location": "<private>",
1414
"os": "fortigate",

tests/data/fortigate_1500d.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sysDescr": "our firewall",
99
"sysContact": "<private>",
1010
"version": "v6.4.8,build1914,211117 (GA)",
11-
"hardware": "FGT_1500D",
11+
"hardware": "FortiGate 1500D",
1212
"features": null,
1313
"location": "<private>",
1414
"os": "fortigate",

tests/data/fortigate_500d.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sysDescr": "",
99
"sysContact": "<private>",
1010
"version": "v5.6.6,build1630,180913 (GA)",
11-
"hardware": "FGT_500D",
11+
"hardware": "FortiGate 500D",
1212
"features": null,
1313
"location": "<private>",
1414
"os": "fortigate",
@@ -7237,5 +7237,36 @@
72377237
}
72387238
]
72397239
}
7240+
},
7241+
"ports-stack": {
7242+
"discovery": {
7243+
"ports_stack": [
7244+
{
7245+
"high_ifIndex": 11,
7246+
"low_ifIndex": 25,
7247+
"ifStackStatus": "active"
7248+
},
7249+
{
7250+
"high_ifIndex": 12,
7251+
"low_ifIndex": 25,
7252+
"ifStackStatus": "active"
7253+
},
7254+
{
7255+
"high_ifIndex": 14,
7256+
"low_ifIndex": 26,
7257+
"ifStackStatus": "active"
7258+
},
7259+
{
7260+
"high_ifIndex": 15,
7261+
"low_ifIndex": 28,
7262+
"ifStackStatus": "active"
7263+
},
7264+
{
7265+
"high_ifIndex": 16,
7266+
"low_ifIndex": 28,
7267+
"ifStackStatus": "active"
7268+
}
7269+
]
7270+
}
72407271
}
72417272
}

tests/data/fortigate_60f.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sysDescr": "",
99
"sysContact": "<private>",
1010
"version": "v7.2.6,build1575,230926 (GA.F)",
11-
"hardware": "FGT_60F",
11+
"hardware": "FortiGate 60F",
1212
"features": null,
1313
"location": "<private>",
1414
"os": "fortigate",

tests/data/fortigate_60f3g4g.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"sysDescr": "",
99
"sysContact": "<private>",
1010
"version": "v6.4.8,build1914,211117 (GA)",
11-
"hardware": "FGR_60F_3G4G",
11+
"hardware": "FortiGate Rugged 60F_3G4G",
1212
"features": null,
1313
"location": "<private>",
1414
"os": "fortigate",

0 commit comments

Comments
 (0)