How to set different levels for different services of a check?

Hello,

I have been working on a new check to monitor the usage of DHCP scopes in Fortigate firewalls. The check works in general as expected. It uses SNMP to get data from a Fortigate, discovers DHCP scopes and can make use of WATO rules for critical and warning levels. I can set different levels per Fortigate in WATO.

The output of the check is something like

DHCP scope 240       OK - 93% leased out          (leased_IPs=93;95;99;;)
DHCP scope 241       OK - 77% leased out          (leased_IPs=77;95;99;;)

Now, I face situations when I need to have different levels for DHCP scopes of the same Fortigate. How can I do this? Looks like my script is not able to differentiate between services of the same Fortigate. Here is the code for the inventory:

factory_settings["fgt_dhcp_leases_default_levels"] = {
    "dhcp_leases"  : (90, 95),
}
def inventory_fgt_dhcp_leases(info):
  if info:
    inventory = []
    for leasedips, scopeid in info:
        inventory.append( (scopeid, {}) )
    return inventory

Could anyone help me?

Best regards
Hermann Maurer

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.