bashclub / checkmk-opnsense-agent

65 stars 14 forks source link

patch: avoid error if no dhcp plugin is present (FailedPythonPlugins: dhcp) #15

Closed sibelle-labs closed 1 year ago

sibelle-labs commented 1 year ago

avoid error if no dhcp plugin is present from debug ...

line 583, in check_dhcp
    _dhcpconf = open("/var/dhcpd/etc/dhcpd.conf","r").read()
FileNotFoundError: [Errno 2] No such file or directory: '/var/dhcpd/etc/dhcpd.conf'
<<<check_mk>>>
FailedPythonPlugins: dhcp

patch:

<         if not os.path.exists("/var/dhcpd/var/db/dhcpd.leases"):
---
>         if not os.path.exists("/var/dhcpd/var/db/dhcpd.leases") or not os.path.exists("/var/dhcpd/etc/dhcpd.conf"):
sibelle-labs commented 1 year ago

now at pull request