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.
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.
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!
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.