Get detailed info via snmp from Juniper switch stack for monitoring

I try to get the following information out of the switch stack for monitoring purposes. Here is the command and its output executed directly on the switch stack via ssh login:

root@stack> show virtual-chassis                 

Preprovisioned Virtual Chassis
Virtual Chassis ID: cf44.0df5.1234
Virtual Chassis Mode: Enabled
                                           Mstr           Mixed Neighbor List
Member ID  Status   Serial No    Model     prio  Role      Mode ID  Interface
0 (FPC 0)  Prsnt    GAxxxxxxx8 ex3300-48t 129  Master*     NA  2  vcp-255/1/2
                                                                 3  vcp-255/1/3
                                                                 1  vcp-255/1/1
1 (FPC 1)  Prsnt    GAxxxxxxx2 ex3300-48t   0  Linecard    NA  0  vcp-255/1/2
                                                                 5  vcp-255/1/3
                                                                 2  vcp-255/1/1
2 (FPC 2)  Prsnt    GAxxxxxxx3 ex3300-48t   0  Linecard    NA  1  vcp-255/1/2
                                                                 3  vcp-255/1/3
                                                                 0  vcp-255/1/1
3 (FPC 3)  Prsnt    GAxxxxxxx1 ex3300-48t   0  Linecard    NA  4  vcp-255/1/2
                                                                 2  vcp-255/1/3
                                                                 0  vcp-255/1/1
4 (FPC 4)  Prsnt    GAxxxxxxx7 ex3300-48t 129  Backup      NA  5  vcp-255/1/2
                                                                 6  vcp-255/1/3
                                                                 3  vcp-255/1/1
5 (FPC 5)  Prsnt    GAxxxxxxx5 ex3300-48t   0  Linecard    NA  4  vcp-255/1/2
                                                                 6  vcp-255/1/3
                                                                 1  vcp-255/1/1
6 (FPC 6)  Prsnt    GAxxxxxxx3 ex3300-48t   0  Linecard    NA  4  vcp-255/1/0
                                                                 5  vcp-255/1/1

In the end I would like to check for the amount of members and/or for status (Prsnt/NotPrsnt), also if there was a role change (e.g. Backup –> Master).

With snmpwalk I got a huge list of entries, but nothing matches with any values above.

So does it mean there is no possibility to get this info out of the stack?

Answer

Well this is a loaded one…Breaking it down

Number of Members

You’re not going to get that, most likely, given the way the VC is depicted over SNMP. There is no current “member count” value in the OID tree. your best bet would be to walk .1.3.6.1.4.1.2636.3.40.1.4.1.1.1.2 and count the Serial numbers returned (or use the memberID, or MACs, or whatever). It looks like you’re using Icinga, so you’re probably going to want to use a script to grab that OID and count the results, since Icinga won’t do that for you. I do similar things for dozens of other situations in Nagios. (I beat out a quick script based on some of those situations; use it, or use it as an example to do what you want: https://gist.github.com/peelman/ef7b682de3af579c2896585385e18e7c).

Status of Members

I see of no (easy) way to get present/not present statuses. That one you might just have to punt on, or monitor the VCP interfaces themselves one by one.

Role Changes

This would be a good one to use traps for; but if you’re set on using polling and you are statically setting priorities so that you know what your master/backup will be most of the time, then you can look at the values under .1.3.6.1.4.1.2636.3.40.1.4.1.1.1.3; node .0 will be member 0, node .1 will be member 1, and so on.

A value of 1 is Master, 2 is Backup, and 3 is Linecard (that’s available in the MIB itself). The problem is that if you leave all that up to the dynamics of a default virtual chassis set up, without setting mastership priorities static member IDs (based on serial numbers), etc, those values could change.

npeelman@nagios:~$ snmpwalk -v2c -c community ex3300-test.domain.tld .1.3.6.1.4.1.2636.3.40.1.4.1.1.1.3
JUNIPER-VIRTUALCHASSIS-MIB::jnxVirtualChassisMemberRole.0 = INTEGER: master(1)
JUNIPER-VIRTUALCHASSIS-MIB::jnxVirtualChassisMemberRole.1 = INTEGER: backup(2)

References

  • You can find the entire Virtual Chassis MIB tree described here
  • Juniper’s MIBs available here

Attribution
Source : Link , Question Author : Kay , Answer Author : peelman

Leave a Comment