Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently implemented ISC DHCP Failover and it's working beautifully, but I'd like to monitor the current status of the failover using Nagios.

Ultimately, I would like my Nagios check to:

  • report a WARNING when the Secondary DHCP server kicks in (starts serving addresses due to an issue with the Primary)
  • report a CRITICAL when both the Primary and Secondary aren't active.
  • Monitoring the dhcpd process to see if it is running or not is unfortunately not the true solution -- a failover state can activate even when dhcpd is still running.

    From what I've researched, it appears dhcpd cannot be queried for a current status. Aside from parsing log files, does anyone know of a clean way to determine whether a dhcpd server is currently in a failover state or not?

    share|improve this question

    Did you consider simply checking on the protocol and just try to obtain a lease without configuring an interface using dhclient -n?

    You would be able to distinguish between the primary and secondary server by checking on the IP address of the server providing the lease which is printed to stderr by dhclient.

    share|improve this answer

    From what I could establish, you would have to use omshell. This is a wrapper for OMAPI calls, an API that can be used to communicate with a running DHCP server. The omshell is usually included in the dhcp server package (at least it was on my Debian linux box).

    However, it doesn't look like omshell easily accepts an input file. You might have to experiment a little.

    Once you have the omshell going, you will need to execute a remote shell command within nagios to run omshell and return the results to the nagios server.

    share|improve this answer

    It sounds like you need the Nagios Business Process Intelligence (BPI) add-on. This allows you to monitor a group of services and set alerts thresholds based on how many are up.

    Shinken has this functionality built-in, too.

    You can use the check_dhcp from Nagios Plugins to monitor DHCP -- it tries to get a lease from a specific server, and alerts if it doesn't. Together with BPI you should be able to achieve what you described.

    share|improve this answer
    I considered check_dhcp, but check_dhcp still will only provide circumstantial evidence toward the case of a failover state being active. In other words, it's possible a server will/will not lease to check_dhcp for reasons other than a failover state. I'm looking for more direct evidence of the failover state. Thank you for the links to BPI and Shinken, however. – stuntmachine May 17 '11 at 13:34

    Your Answer


    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.