Nagios Plugin DHCP Check

Hi there!

Im using LibreNMS with the Nagios Plugin to check if certain processes are running on my servers.

I have built a DHCP server cluster, two servers running ICS DHCP Server.
These servers are in a separate subnet with a firewall relaying DHCP DISCOVERS from certain subnets to the DHCP Cluster.

I run into the following issue, running a DHCP Check to both servers works;
I do this using this command:
./check_dhcp -s dhcp-server-1 -i ens18 -u

And receive this answer:
OK: Received 1 DHCPOFFER(s), 1 of 1 requested servers responded, max lease time = 1800 sec.

If I run this in Verbose mode I indeed see that the correct server is being reached, also, a tcpdump on the DHCP Server sees the Discover coming in.
-u stands for unicast, since the DHCP Server is not in the same subnet as the LibreNMS Server.

If I create the service in the web UI though, It sees the DHCP Service as down.
I created the service under:
services - add service
name: DHCP Test
check type: dhcp
Description left blank
Remote host: dhcp-server-1 (the dhcp server)
Parameters: -s dhcp-server-1 -i ens18 -u

In LibreNMS however, I get: CRITICAL: No DHCPOFFERs were received.

The second DHCP Server that I run works fine with the same settings.

Both servers are Ubuntu servers, fully updated, librenms also fully updated.

Did anyone run into this problem before?

Librenms is very powerful and I’m glad it’s here, but I don’t think this aspect is always obvious. Those services added on the librenms server must be able to see a port on the client server. So typically they are used to check TCP ports that are known to be up. E.g.80/443 on a web server.

There is no nrpe agent on the client.

I get round this by doing this

1 Like

Thanks for the suggestion!

The DHCP Server is definitely listening on udp 67. I also created a scope just to make the check work. the dhcp_check from CLI does work, just not from the Web UI. I wonder whats going wrong, but cant find something out of the ordinary from the logging.

SNMP is also set up and working for this server already. Lets see how this SNMP Extend script works. thanks!

Just to try to clarify ds-04’s point…

When you build a service in the Web UI, regardless of what host you assign that service to in the Device drop down, the actual Nagios plugin command is still run on the LibreNMS poller. Not on the device you selected. All the Device field does it determine which device the graphs will be displayed on in the Web UI.

So you are actually running the command…

check_dhcp -H dhcp-server-1 -s dhcp-server-1 -i ens18 -u

…on your LibreNMS poller (-H is inserted from the Remote Host field). Which isn’t really valid.

ds-04’s suggestion would let you run your check_dhcp script locally on the DHCP server via SNMP extend in snmpd and LibreNMS would collect its output as a service with check_snmp_extend.

If you happen to be running the check_mk agent on your DHCP server, check_mrpe could be another option.

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