Forum Discussion

mega_kas_60204's avatar
mega_kas_60204
Icon for Nimbostratus rankNimbostratus
Feb 25, 2009

snmpget test in iRule

Hiya

 

First off thanks to the dev's for contributing to this forum. Can anyone help us out here?

 

 

We have a VS with an iRule that stops ping responses being routed back to an external server if too many of our slave nodes are down. This works well to stop the external server sending us too much load if we have failures.

 

 

However, we now need to incorporate another test into our iRule to check if both the master and N number of slave nodes are available.

 

 

So the test we want is:

 

master server available and N number of slave servers

 

then route pings

 

else reject pings

 

 

The only way we can test the master server is with an snmpget like this:

 

request: /opt/bmi/bin/snmpget -v1 -c public 10.65.201.131 1.3.6.1.4.1.8521.4.10.2.0

 

response: SNMPv2-SMI::enterprises.8521.4.10.2.0 = INTEGER: 1

 

 

Does anyone know how to incoporate this snmpget into our iRule?

 

Cheers, Kas

 

 

 

when CLIENT_ACCEPTED {

 

if {([IP::protocol] == 1) && ([IP::local_addr] == "10.222.333.44")} {

 

if {[active_members slave_pool] < 1} {

 

reject

 

log local0. "External ping failed"

 

}

 

}

 

}

 

2 Replies

  • iRules don't allow you to look at SNMPGETS, atleast from what I read :-)

     

    Specific health monitor CAN allow you to run external scripts THAT can perform an snmpget. Not sure if this would help you in anyway but I thought of throwing it out there.

     

    I hope this helps

     

    CB
  • Thanks very much for the reply

     

     

    The master server isn't actually configured as a node on our F5 yet as it doesn't carry traffic - it just manages the traffic carrying nodes.

     

     

     

    So if I understand - we could:

     

    -add the master server as a node in a pool on F5

     

    -run a health monitor to run an external script to check the master server via SNMP get

     

    -modify the iRule to include something like

     

    if {[active_members slave_pool] < 1} and {[active_members master_pool]{

     

    reject

     

     

    Does that sound a good plan?

     

     

    by the way my next question will be how to build this health monitor to do an snmpget (;

     

     

    cheers, Kas