Wrong interface speed from snmpd running as snmp user

Bug #250549 reported by Bjorn Ruud
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

snmpd reports wrong interface speed when it is run as the snmp user. Running snmpd as root gives the correct result. Debug output suggests a permission problem. The gigabit network interface speed is correctly determined at startup, but fails when the owner of the process switches from root to the snmp user (or so I assume). After failure snmpwalk reports a speed of 10 Mbit/s for all interfaces.

Using snmp user:

# snmpd -f -Le -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -DmibII/interfaces
registered debug token mibII/interfaces, 1
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
mibII/interfaces: ETHTOOL_GSET on eth0 speed = 1000
mibII/interfaces: ETHTOOL_GSET on eth0 speed = 1000
NET-SNMP version 5.4.1.2
mibII/interfaces: ETHTOOL_GSET on eth0 failed
mibII/interfaces: SIOCGMIIPHY on eth0 failed

Using root user:

# snmpd -f -Le -Lf /dev/null -I -smux -p /var/run/snmpd.pid -DmibII/interfaces
registered debug token mibII/interfaces, 1
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
mibII/interfaces: ETHTOOL_GSET on eth0 speed = 1000
mibII/interfaces: ETHTOOL_GSET on eth0 speed = 1000
NET-SNMP version 5.4.1.2
mibII/interfaces: ETHTOOL_GSET on eth0 speed = 1000

Note: The output is from version 5.4.1.2 which I packaged for testing purposes, but the problem is the same with version 5.4.1.

Bjorn Ruud (bjorn-ruud)
description: updated
Revision history for this message
Chuck Short (zulcss) wrote :

The reason is that the user you were running the command does not have permissions to set the speed of the device.

Regards
chuck

Changed in net-snmp:
status: New → Won't Fix
Revision history for this message
Bjorn Ruud (bjorn-ruud) wrote :

That's what I'm saying. The snmp user, which is the default user for the snmpd service, doesn't have permission. Reading interface speed fails with the standard package installation. Isn't that a bug? Is there a way to give the snmp user the permissions it needs without giving it too much access?

Revision history for this message
Le_PoUnT (lepount) wrote :

For over a year since the bug was reported, no correction has been made?

Who knows ... the next LTS?

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

Also confirming this problem.

This is really ANNOYING with a full network of Ubuntu machines, there is no proper way of monitoring the network interface information, screwing up about every NMS you can find in the book.

Any further input, help, or attention would be much appreciated.

Revision history for this message
Zebra-Rake (faheyd) wrote :

Now I know why my MRTG and OpenNMS do not correctly report the interface speed. It is this BUG. A real bug that needs to be fixed.

Someone, needs to inform Chuck Short that this needs to be moved to high priority fix, since every NMS system depends on snmpd answering the 'speed' correctly. My OpenNMS is filled up with errors do to exceeding interface speed. Because this bug reports all the interfaces at 10mbs.

Revision history for this message
Otto Berger (otto-bergerdata) wrote :

anything new on this? this is really serious...

Revision history for this message
Otto Berger (otto-bergerdata) wrote :

Dear Chuck,

"The reason is that the user you were running the command does not have permissions to set the speed of the device."

right, but should'nt the package take care of this? i wonder why the status is still "won't fix"?

Otto

Revision history for this message
David Tomaschik (matir) wrote :

This is a real bug that poses a problem to any enterprise deployment of Ubuntu Server. RHEL gets around it by running snmpd as root, which is not ideal. Will the new POSIX capabilities allow access to SIOCGMIIPHY for snmpd user?

Changed in net-snmp (Ubuntu):
status: Won't Fix → New
Revision history for this message
Chuck Short (zulcss) wrote :

Ill try to see if this is fixed on lucid.

Regards
chuck

Changed in net-snmp (Ubuntu):
status: New → Triaged
Revision history for this message
Chuck Short (zulcss) wrote :

This looks like its fixed in lucid. Please re-open if it is not.

Regards
chuck

Changed in net-snmp (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Tyler Wagner (tyler) wrote :

This bug is definitely not fixed in lucid:

root@cacti:~# snmpwalk -v 3 10.0.0.1 | grep Speed
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 10000000

root@10.0.0.1:~# cat /etc/issue
Ubuntu 10.04.1 LTS \n \l

Tyler Wagner (tyler)
Changed in net-snmp (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :
affects: net-snmp (Ubuntu) → linux (Ubuntu)
Revision history for this message
Sergey Svishchev (svs) wrote :

So, do we need to file a separate bug in "linux" package to get this fixed?

Revision history for this message
Sergey Svishchev (svs) wrote :

The bug is fixed in linux-image-2.6.38-10-server package, version 2.6.38-10.44 (a backport to Lucid)

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.