Forum Discussion

chris_connell_1's avatar
chris_connell_1
Icon for Nimbostratus rankNimbostratus
Dec 08, 2010

Custom alert < n number of available nodes in pool

Hello

 

I need to send a trap if the members available (health up) of a specific pool is less than 5. How would I do this? would I have to write a custom script to check available members and if < 5 log to syslog which would be picked up by the alertd process?

 

Thanks

 

 

 

  • Hi Chris,

     

     

    Yes, you could use tmsh with something like this to get a count of active members:

     

     

    tmsh show ltm pool POOL_NAME detail | grep -c "Pool member is available"

     

     

    Or using bigpipe:

     

     

    b pool POOL_NAME show | grep -c "active,up"

     

     

    Maybe someone has a cleaner way of getting this?

     

     

    You could then use that in a script which calls logger:

     

     

    logger -p local0.warning "Pool POOL_NAME has less than 5 members up"

     

     

    Add that script to cron and run it however often you want to check the pool(s).

     

     

    You could save the output from the pool count command and use that in the logger message.

     

     

    You could then define a custom SNMP trap based on the message text:

     

     

    SOL3727: Configuring custom SNMP traps

     

    http://support.f5.com/kb/en-us/solutions/public/3000/700/sol3727.html

     

     

    Aaron