0

I am trying to monitor keepalived VIP with snmp. I got keepalived running on two servers. We had the situation that suddenly the VIP was on both servers which was a big problem, since these servers are virtual gateways. My aim is to monitor keepalived on both servers with a python script through check_mk plugin. Now I can get the master and backup servers, but I want to know to which server the VIP assigned to.

I can get all the keepalived OIDs:

snmpwalk -v 2c -c public keepalived.server KEEPALIVED
snmpwalk -v 2c -c public keepalived.server KEEPALIVED-MIB::keepalived
snmpwalk -v 2c -c public keepalived.server KEEPALIVED-MIB::vrrp
snmpwalk -v 2c -c public keepalived.server VRRP-MIB::vrrpMIB
snmpwalk -v 2c -c public keepalived.server VRRPV3-MIB::vrrpv3MIB

Bute when When I run the following I get an error:

# snmpwalk -v2c -c public keepalived.server KEEPALIVED-MIB::virtualServerAddress
KEEPALIVED-MIB::virtualServerAddress = No Such Object available on this agent at this OID

I am not experienced with snmp and keepalived. How can I get it to work, since obviously it works like here.

Furthermore I have a questions:

should snmp-mibs-downloader be installed on the keepalived servers as well or is it enough to install it on the monitoring server, because I get the following log on keepalived servers when it is not installed on them:

# less /var/log/syslog 
Sep 18 10:41:11 snmpd[16695]: MIB search path: /usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/
mibs/site:/usr/s/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp 
Sep 18 10:41:11 snmpd[16695]: Cannot find module (SNMPv2-MIB): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (IF-MIB): At line 0 in (none) 
Sep 18 10:41:11 snmpd[16695]: Cannot find module (IP-MIB): At line 0 in (none) 
Sep 18 10:41:11 snmpd[16695]: Cannot find module (TCP-MIB): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (UDP-MIB): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none) 
Sep 18 10:41:11 snmpd[16695]: Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none) 
Sep 18 10:41:11 snmpd[16695]: Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Sep 18 10:41:11 snmpd[16695]: Cannot find module (MTA-MIB): At line 0 in (none)
................
................
................

simlint doesn't have any out put on the monitoring server:

# smilint /usr/share/snmp/mibs/KEEPALIVED-MIB.txt
# 

but running it against the directory:

# smilint /usr/share/snmp/mibs/*
/usr/share/snmp/mibs/GNOME-SMI.txt:88: warning: module name `GNOME-SMI' should match `*-MIB'
/usr/share/snmp/mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt:151: enumeration name `mplsTpPseudowireEndpointIdentifier' longer than 32 characters
/usr/share/snmp/mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt:62: warning: current type `AddressFamilyNumbers' is not referenced in this module
/usr/share/snmp/mibs/IANAifType-MIB.txt:462: warning: named number `if-gsn' must not include a hyphen in SMIv2
/usr/share/snmp/mibs/IANAifType-MIB.txt:279: warning: identifier `IANAifType' differs from `ianaifType' only in case
/usr/share/snmp/mibs/IANAifType-MIB.txt:7: info: previous definition of `ianaifType'
/usr/share/snmp/mibs/IANAifType-MIB.txt:279: warning: current type `IANAifType' is not referenced in this module
/usr/share/snmp/mibs/IANAifType-MIB.txt:600: warning: current type `IANAtunnelType' is not referenced in this module
/usr/share/snmp/mibs/IANA-RTPROTO-MIB.txt:42: warning: current type `IANAipRouteProtocol' is not referenced in this module
/usr/share/snmp/mibs/IANA-RTPROTO-MIB.txt:74: warning: current type `IANAipMRouteProtocol' is not referenced in this module
/usr/share/snmp/mibs/LM-SENSORS-MIB.txt:17: failed to locate MIB module `UCD-SNMP-MIB'`
...............
...............
...............

I have no clue if it is a snmp issue or keepalived or there are missing MIBs I need to install.

Thanks for your help.

Max
  • 143
  • 1
  • 6

1 Answers1

0

pqarmitage from acassen/keepalived answred the question here:

Running snmpwalk -v2c -c public keepalived.server KEEPALIVED-MIB::virtualServerAddress I get exactly the same as you using your configuration above, but that is correct since that are no virtual servers configured (virtual servers are part of IPVS/healthchecker configuration, and do not relate to vrrp_instances).

If I add a couple of virtual servers to the configuration, with addresses 10.0.1.4 and 10.0.2.4, then snmpwalk -v2c -c public keepalived.server KEEPALIVED-MIB::virtualServerAddress produces:

KEEPALIVED-MIB::virtualServerAddress.1 = Hex-STRING: 0A 00 01 04
KEEPALIVED-MIB::virtualServerAddress.2 = Hex-STRING: 0A 00 02 04

Thanks

Max
  • 143
  • 1
  • 6