Check Cisco HSRP State

I got tired of not having an HSRP monitor to check the state of my routers so I went ahead and modified this wonderful VRRP monitor to do HSRP instead.

The only HSRP monitor I’ve found here had some issues and was limited in the way I could check for my router status.

Download the script

Usage: ./check_snmp_hsrp.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) -s <master|backup|num,%> [-p <port>] [-t <timeout>] [-V]

Check if router is the master:
./check_snmp_hsrp.pl -H <hostname> -C <snmpcommunity> -s master

Check if router is the backup:
./check_snmp_hsrp.pl -H <hostname> -C <snmpcommunity> -s backup

  3 comments for “Check Cisco HSRP State

  1. November 6, 2017 at 14:56

    Hi,

    I was getting error:
    Argument “v6.0.1” isn’t numeric in numeric lt (VERSION VERSION lt 4) {

    And all works fine.

    Issues with libexec pass can also happen.

    Thanks for your great work.

  2. July 25, 2018 at 02:08

    hi, thank you for great works. I tried your plugin, I have this error.
    Argument “v6.0.1” isn’t numeric in numeric lt (<) at /usr/lib/nagios/plugins/check_cisco_hsrp.pl line 238.
    Use of uninitialized value $o_state in string eq at /usr/lib/nagios/plugins/check_cisco_hsrp.pl line 293.
    Use of uninitialized value $o_state in string eq at /usr/lib/nagios/plugins/check_cisco_hsrp.pl line 293.
    Use of uninitialized value $o_state in string eq at /usr/lib/nagios/plugins/check_cisco_hsrp.pl line 293.
    Use of uninitialized value $o_state in string eq at /usr/lib/nagios/plugins/check_cisco_hsrp.pl line 293.

    can you help me?
    regards

  3. July 25, 2018 at 03:23

    hi find solution.
    change on line 238
    (Net::SNMP->VERSION VERSION lt 4 )

    but for other problem line 293 I can’t understand

Leave a Reply