Ever have to update/merge a PR on BitBucket with Mercurial? I couldn’t find documentation anywhere, so doing so here:
- hg up BOOKMARK_NAME
- hg merge [–preview] -r REV
- If EDITOR is not set:
- hg resolve –all
- hg commit -m “Merge with default”
- hg push –allow-anon
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:
# Cooper Lees <email@example.com>
# Dirty Cluster RG0 checker
# Lasted Updated: 20120818
if [ "$HOST" == "" ] || [ "$COMMUNITY" == "" ]; then
echo "ERROR: No host or SNMP community specified"
SNMPOUTPUT=$(snmpwalk -v 2c -c $COMMUNITY $HOST 188.8.131.52.4.1.26184.108.40.206.1.7)
echo $SNMPOUTPUT | grep "INTEGER: 2" > /dev/null
if [ $? == 0 ]; then
echo "Host $HOST is the Chassis cluster ACTIVE RE"
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"
echo "WTF – Something is not right …"
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.).
Here is a table of the ports that are used for chassis cluster control link and management ports on Branch SRX devices.
The quoted ports are the ‘stand alone’ non clustered port names (not node1’s port names once clustered). In a SRX cluster the PIM slots on node1 start at the last PIM slot of node0 + 1. For example, a SRX240 cluster’s node1 starts at PIM 5. It’s control link port is effectively ge-5/0/1).
||FXP1 (Control Link)
||ge-0/0/6 (> 11.0)
*fab0 and fab1 interfaces (Data Link) are always configurable, e.g.:
- set interfaces fab0 fabric-options member-interfaces ge-0/0/2
- set interfaces fab1 fabric-options member-interfaces ge-5/0/2