Forum Discussion

DeVon_Jarvis's avatar
DeVon_Jarvis
Icon for Altostratus rankAltostratus
Oct 16, 2009

DHCP Health Monitor??

We are setting up LTM to load balance Windows DHCP (Unicast only, forwarded from Cisco Routers via BOOTP Helper address). I need to health check the two DHCP servers in the pool. I did a search and found Kirk Bauer's perl based DHCP monitor, but it won't run on 10.0.1. Looks like a package is missing.

 

 

Anyway, resorted to udp monitor, and I know it has to be paired with another monitor to work properly.

 

 

The question is, can I add an ICMP monitor to the node instead of using GATEWAY_ICMP on the pool? Just wondering if LTM will associate the node and the pool monitor together or not.

 

 

Also, if there is a better way to health check DHCP, let me know. It would be ideal to send a DHCP Discover message with the GIAddr populated (so that I get a unicast response), but short of writing a bunch of code, I don't see a way to do that using any of the command-line tools in a script.

 

 

Thanks in advance!

9 Replies

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    What library is needed? Which article/link did you find the example from Kirk in?

     

     

    Thanks,

     

    Aaron
  • Here is where I found the monitor:

     

    http://devcentral.f5.com/Wiki/default.aspx/AdvDesignConfig/DHCPMonitor.html

     

    Here is what I get when I try and run:

     

    [root@bipzp1:Active] monitors ./dhcp.eav 10.5.66.98 67 10.5.7.11

     

    Global symbol "$Ether" requires explicit package name at ./dhcp.eav line 298.

     

    Execution of ./dhcp.eav aborted due to compilation errors.

     

    I have not done much perl...
  • I get the same issue. The Perl script errors out with the following:

     

     

    Global symbol "$Ether" requires explicit package name at ./dhcp-checker.pl line 298.

     

    Execution of ./dhcp-checker.pl aborted due to compilation errors.

     

     

    I am also weak in perl. Anyone got an idea?
  • As an alternative, you can also set $Ether dynamically:

    my $Ether = $1
    if ( (qx"/sbin/ip route get $Server" =~ /dev\s+([^\s]+)/)
    && (qx"/usr/bin/b vlan $1 " =~ /(([0-9a-f]{2}[:\s]){6})/i) );

    Add it after $Server is set (eg. line 266), example:

     Read arguments
    my $Server = $ARGV[0];
    $Server =~ s/::ffff://; Add here
    my $Ether = $1
    if ( (qx"/sbin/ip route get $Server" =~ /dev\s+([^\s]+)/)
    && (qx"/usr/bin/b vlan $1 " =~ /(([0-9a-f]{2}[:\s]){6})/i) );
     Port not used
    my $port = $ARGV[1];
  • Does anybody know how to fix the missing library ?

     

     

    I am using version 10.2.1 and would like to use this nice EAV.

     

     

    Clim told to fix macaddress instead of a variable, if this is a go I could use it, please just confirm it.

     

     

     

    Thanx,

     

    Nicola.

     

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Nicola,

     

     

    Christopher's workaround should be fine.

     

     

    Aaron
  • Thanx a lot Hoolio, it works, just have to init the mac address.

     

     

    ./perlscript dest_dhcp_ip port* sourceip_bigip_phys_self

     

     

    3 parameters are needed but the port actually is not used

     

     

    Nicola

     

  • Sometimes the script returns me this error, and no up or down is returned in this situation:

     

     

    ./dhcp_monitor 172.xx.yy.9 67 172.xx.yy.11

     

    Can not watch: Address already in use at ./dhcp_monitor line 305

     

    Can not watch: Address already in use at ./dhcp_monitor line 307

     

     

     

     

     

    Timeout is about 9 seconds, then the script returns "down", I have set the poll every 30 seconds and timeout to 91...

     

     

     

    Another strange behaviour is after a bigstart restart the pool is set to red (down), after a reboot the pool is set to green, monitor succeeds.

     

     

    Any tips ?

     

     

    Thanx again,

     

    Nicola.

     

     

     

  • Hi again

     

    after making the monitor working in V10 last year, I am now here after a V11.2.1 hf1 upgrade.

     

     

    The monitor does not work anymore. When run manually this is the output of the perl script:

     

     

     

     

    [root@bigip:Active:Standalone] monitors ./dhcp_monitor 172.xx.yy.66 67 172.xx.yy.11

     

    Not watching yet! at ./dhcp_monitor line 314

     

     

    What is the meaning of the message the Bigip sends back ? Not watching what ?

     

     

    Perl version is 5.8.8 as it is on V10, but in V10 this monitor works just fine...

     

     

    Nicola.