[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

SNMP / SNMPD - Manually assign key to interface

Posted on 2010-11-22
7
Medium Priority
?
1,048 Views
Last Modified: 2013-12-16
Hello everyone,

I have an annoying issue that I'm trying to solve. I monitor the total bandwidth usage via zabbix for two gateways on our network. For this to work properly, BOTH snmpd daemons MUST list the eth0 interfaces as 'IfInOctets2' and 'IfOutOctets2' .. now they don't have to use Octets2, but both servers must both use the same for my graphs to work properly.

For some odd reason, one of my gatway boxes changes this value after a reboot ocassionally. I have no idea why or how to force snmp to always use 'Octets2' for eth0.

Any ideas?

I have googled, and can't find any settings to add to snmpd.conf or actually any issues even close to being related to my problem.

Thank you for your help!
Bill
0
Comment
Question by:wpatterson82
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 12

Expert Comment

by:hfraser
ID: 34198869
Is it possible that the gateway's switching interface labeling when rebooting? I've had this happen before; the first interface detected is assigne to eth0, the second to eth1. To guarantee the association stays constant, I needed to include the MAC address in the appropriate network configuration files (like ifcfg.eth0 and ifcfg.eth1).

I'd expect this would cause you some routing issues as well, but it's worth a check.
0
 
LVL 2

Author Comment

by:wpatterson82
ID: 34199197
Thanks for the reply but nope :( .. all of the interfaces are as they should be .. for some reason snmpd moved my eth0 interface to Octets5 .. instead of the Octets2 which I need to be on.

0
 
LVL 4

Expert Comment

by:AbhisekSanyal
ID: 34199563
Hi,
   You can use a tool called "ifrename". You did not say what is running on your gateway, I hope this tool is supported on your gateway (Try compiling from the source)
The following entry in the configuration file /etc/iftab will ensure that the interface with the following mac address always becomes eth0

eth0 mac 00:1B:24:41:AD:41

The tool "ifrename" has to be run before your networking is up. Calling "ifrename -p" should do.

There is a nice writeup here
http://www.enterprisenetworkingplanet.com/netos/article.php/3586546/Nail-Down-Network-Interface-Names-with-ifrename.htm

You should be very careful when testing this tool, you don't want to loose network access to your gateway and get into trouble. Have a console open to test this.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:wpatterson82
ID: 34199887
Thanks for your reply AbhisekSanyal, however that's not the problem. The interfaces always come up as they should .. for example, eth0 is always the correct device.

The issue is that snmpd has switched from listing stats on eth0 as Octets2, to Octets5.

So when I'm monitoring my gateway via SNMP, I have everything set to graph eth0 on Octets2 .. I can't figure out why SNMPD has moved eth0 to Octets5.

It's not an issue with my interfaces, it's how SNMPD is reporting the data/counters for the interfaces.
0
 
LVL 4

Expert Comment

by:AbhisekSanyal
ID: 34200425
Hi,
  So, now the interface index is always Octets5 in that gateway device ? Irrespective of the number of times you reboot the server or restart the snmp service ?
  What are the other network interfaces present on the system ?
  I found a somewhat similar problem in this bug report - https://bugzilla.redhat.com/show_bug.cgi?id=484990

  Basically, Xen setup was changing the interface id as seen by snmp daemon. Perhaps there is some service running on the gateway which has now changed the sequence as seen by the snmp daemon.
0
 
LVL 12

Expert Comment

by:hfraser
ID: 34202336
Could you do an snmpwalk when the indices are correct, and when they're incorrect. The important mibs are:

IF-MIB::ifNumber.0 = INTEGER: 3
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: wlan0

This is the output from my laptop, and I'd like to see what your gateway returns to be sure the ordering of the interfaces changes.
0
 
LVL 5

Accepted Solution

by:
group0 earned 2000 total points
ID: 34219655
This is not an snmpd issue, the ifIndex is assigned by the kernel in the order that the device registers.  The following link shows where in the linux and Net-SNMP code this occurs:

http://efreedom.com/Question/2-167520/Linux-IfIndex-Persistence-SNMP

You might be able to fix this with adjusting udev rules, but this still wouldn't fix cases where you drop the interface, remove the module, and re-run modprobe.  The only reliable way to get the right data is to use dynamic indexes:

http://www.zabbix.com/documentation/1.8/manual/advanced_snmp/dynamic_indexes
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your computer hacked? learn how to detect and delete malware in your PC
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question