Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up two interfaces as bonding slaves (eth0 and eth1 bonded as bond0). How are people monitoring the status of the slaves?

How are you notified if the link fails on one interface? Do you poll something in /sys/class/net/bond0 or /proc/net/bonding/bond0 ? Is there a daemon I can configure to get notifications?

Some context: I'm running SUSE 11 server SP1 and I'm not interested in any graphical tool as this server is not running X11.

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

There are some ways to do this:

  1. As you mentioned, query status from /proc/net/bonding/bond0:

    if [ `grep -c down /proc/net/bonding/bond0` -eq 1 ]; then
        echo "`date +%c`" | \
        mail -s "$(grep -B1 down /proc/net/bonding/bond0 | head -1 | \
        awk -F': ' '{ print $2 }') is down" your@email.address 
    fi
    
  2. Nagios's check_linux_bonding plugin.

  3. SNMP.

share|improve this answer
add comment

I haven't any Suse here to test the command. In fedora/redhat I use "ethtool slave_device_name" http://en.wikipedia.org/wiki/Ethtool and i see "Link detected:" parameter.

share|improve this answer
add comment

If you are doing bonding, check /proc/net/bonding/bond0.

You should see something like this

Ethernet Channel Bonding Driver: v3.7.0 (June 2, 2010)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0d:60:d4:a3:00
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0d:60:d4:a3:01
Slave queue ID: 0

I just check to see if the Currently Active slave has changed or not.

Also if you are just looking to see if link is lost on one of your NIC's, you can still do that though SNMP or other standard forms of monitoring.

share|improve this answer
add comment

Under Nagios I used check_ifoperstatus on each of the slave interfaces which performs an SNMP query to 1.3.6.1.2.1.2.2.1.8 in the IF-MIB.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.