FortiGate license expiration

I’ve made a change to the discovery and poller code to add support to retrieve FortiGate license expiration days. It would show up in the GUI as following:

fg-lic-expire

The OID returns a date string, eg ‘Mon 11 November 2030’, I translate this into days left. So this number would decrease every day until the license is renewed. For this I used a couple of lines of code in includes/plling/sensors/count/fortigate.inc.php

Is this something that LibreNMS would accept as a PR?

4 Likes

Yes, LibreNMS would accept this PR.

This is working for some of my Fortigates, but only the virtual ones. I can’t work out why it’s not triggering on discovery for the physical ones I have.

I tested this on physical appliances only, version 7.0.x and 7.2.x. Works on all of them.
What version are you running?

500E running 7.2.6 and 60F running 7.0.12

I don’t have a 500E so I can’t check it out, but I checked various other E-gen FortiGate’s. As long as they are running v7.x they seem to support lease expiration information from SNMP. Also checked a 1200D running 7.0.13, also works.

I only found v6.x devices not to work.

Could you run a SNMP walk?

snmpwalk <credentials> <ip> -M /opt/librenms/mibs:/opt/librenms/mibs/fortinet -m FORTINET-FORTIGATE-MIB fgLicContractExpiry

The OIDs are there:

FORTINET-FORTIGATE-MIB::fgLicContractExpiry.1 = STRING: Thu Dec 7 08:00:00 2023
FORTINET-FORTIGATE-MIB::fgLicContractExpiry.2 = STRING: Thu Dec 7 08:00:00 2023
FORTINET-FORTIGATE-MIB::fgLicContractExpiry.3 = STRING: Thu Dec 7 08:00:00 2023

I tried a manual discovery but don’t see any attempt to query them

The odd thing is I don’t see fgSysSesRate# sensors either in the discovery, but they do exist for the device. But I think the issue is includes/discovery/sensors/count/fortigate.inc.php isn’t being called for the physical devices for some reason.

SNMPv2-MIB::sysObjectID.0 = OID: FORTINET-FORTIGATE-MIB::fgt500E
SNMPv2-MIB::sysObjectID.0 = OID: FORTINET-FORTIGATE-MIB::fgt61E

Could you give me SNMP access to one of those?

Issue opened, it’s something to do with device discovery

Oddly I have a 600F cluster that is reporting expiry correctly.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.