Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FortiGate DHCP Scope usage percentage sensors #15727

Merged
merged 6 commits into from Jan 11, 2024

Conversation

rudybroersma
Copy link
Contributor

@rudybroersma rudybroersma commented Jan 11, 2024

Here's a pull request to add DHCP usage percentage sensors. It gives a (per Virtual Domain) list of DHCP servers/scopes with their lease percentage. eg, a pool of 100 IPs with 80 active DHCP leases gives a usage percentage of 80%. This can be used for DHCP server utilization monitoring.

Sample output:
poolusage

The name 'root' in this example is the FortiGate Virtual Domain name and is retrieved from the device.

dev:check succeeds. Updated FortiGate 40F test data.

ADDITIONALLY I made a small correction to a PR that was accepted earlier. I corrected the description in the file and removed an unused line of code here:

f6a42d4

NOTE: I believe this cannot be added using YAML, because the fgDhcpTable doesn't end with a single index.

# snmpwalk -v3 -u snmp 192.168.178.164 -M /opt/librenms/mibs:/opt/librenms/mibs/fortinet -m all fgDhcpTables
FORTINET-FORTIGATE-MIB::fgDhcpLeaseUsage.2.1 = INTEGER: 18
FORTINET-FORTIGATE-MIB::fgDhcpLeaseUsage.3.1 = INTEGER: 49

The values 2 and 3 belong to the vDOM, and 1 is the Server ID.
So in this example it's: vDOM 2, server ID 1 has a usage of 18% and vDOM 3, server ID 1 has a usage of 49%

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

Copy link
Member

@electrocret electrocret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks!

@electrocret electrocret merged commit 7292662 into librenms:master Jan 11, 2024
8 checks passed
@rudybroersma rudybroersma deleted the fortigatedhcp branch January 11, 2024 15:35
@electrocret electrocret added the Sensor Device sensors label Jan 11, 2024
laf pushed a commit to laf/librenms that referenced this pull request Jan 12, 2024
* Update fortigate.inc.php

* Add percent sensors for DHCP Pool usage (per vDOM)

* FortiGate 40F JSON Test Data

* FortiGate 40F JSON Test Data for DHCP Usage sensor

* Style-CI Fix

* Style-CI Fix
@murrant murrant added the Device 🖥️ New or added device support label Feb 27, 2024
@librenms-bot
Copy link

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/24-2-0-changelog/23721/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device 🖥️ New or added device support Sensor Device sensors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants