Comments

Juniper SRX Chassis Cluster RG0 Nagios Check

Posted by cooper on Aug 18, 2012 in g33k, juniper

I was required to check (as this customer did not have a trap collector) which node was active for redundancy group 0 on a SRX cluster. So I thought I would check for a SNMP OID that is only presented by the active RG0 node. This script uses snmpwalk and is configured to use SNMP v2c (this can be easily changed). It has been tested on:

  • CentOS 5
  • Junos 11.4R2
  • SNMP v2c

Here is the little hacky shell script:

#!/bin/bash

# Cooper Lees <me@cooperlees.com>
# Dirty Cluster RG0 checker
# Lasted Updated: 20120818

HOST=$1
COMMUNITY=$2

if [ "$HOST" == "" ] || [ "$COMMUNITY" == "" ]; then
        echo "ERROR: No host or SNMP community specified"
        exit 2
fi

SNMPOUTPUT=$(snmpwalk -v 2c -c $COMMUNITY $HOST 1.3.6.1.4.1.2636.3.1.14.1.7)

echo $SNMPOUTPUT | grep "INTEGER: 2" > /dev/null
if [ $? == 0 ]; then
        echo "Host $HOST is the Chassis cluster ACTIVE RE"
        exit 0
fi

echo $SNMPOUTPUT | grep "No Such Object available on this agent at this OID" > /dev/null
if [ $? == 0 ]; then
        echo "Host $HOST is the INACTIVE RE"
        exit 2
fi

echo "WTF - Something is not right ..."
exit 3

It checks for the “jnxRedundancyState” OID – this OID reports on RE states and is only accurate on Junos routers (e.g. M and MX series etc.).

Enjoy …

Tags: , , , , , , , , , , , , , , ,

 
Comments

System Administrator vs. Programmer Quote

Posted by cooper on Sep 30, 2010 in g33k

A great quote, that is so true …

“A programmer is much like a virtuoso musician. They know their instrument extremely well. They may know, and occasionally play other instruments, but tend to focus almost exclusively on one. A sysadmin is more like the conductor. They have to know about all the instruments, the characteristics of each, how they play and sound together and in contrast with others. Then [they] need to understand the timing, the sound characteristics of the hall, etc. and make everything work together.”

– System administrator

Tags: , , , , , , ,

Copyright © 2017 I-R-Coops Blog All rights reserved. Theme by Laptop Geek.