Page MenuHomeVyOS Platform

SNMP ifAlias Description missing
Closed, ResolvedPublicBUG

Description

Dear VyOS Team,

there is no ifAlias information trough SNMP available.
Would it be possible to use the interface description field and parse those information trough SNMP?

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.2.0-rolling+201805140337
Why the issue appeared?
Will be filled on close

Event Timeline

Are you sure?

snmpwalk -v2c -c public 10.1.1.100 1.3.6.1.2.1.2.2.1.2
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "lo"
iso.3.6.1.2.1.2.2.1.2.2 = STRING: "Intel Corporation 82540EM Gigabit Ethernet Controller"
iso.3.6.1.2.1.2.2.1.2.3 = STRING: "Intel Corporation 82540EM Gigabit Ethernet Controller"
iso.3.6.1.2.1.2.2.1.2.4 = STRING: "Intel Corporation 82540EM Gigabit Ethernet Controller"
iso.3.6.1.2.1.2.2.1.2.5 = STRING: "Intel Corporation 82540EM Gigabit Ethernet Controller"

Tested on:
Version: VyOS 1.2.0-rolling+201806251824
Built by: [email protected]
Built on: Mon 25 Jun 2018 18:24 UTC
Build ID: 044d664f-55a8-49f3-afa7-c6ce97a29bbf

Validated OID 1.3.6.1.2.1.2.2.1.2 (ifDescr), I think the task here can be closed as invalid request.

Hi,

"Intel Corporation 82540EM Gigabit Ethernet Controller" is not that description that you configure with following cli command:

set interfaces ethernet eth0 description 'UPLINK'

cpo@LR1:~$ show snmp mib ifmib ifAlias eth0
eth0: ifAlias = NET-MYBLL-MUCI-BACKBONE

cpo@LR1:~$ show snmp mib ifmib ifAlias lo
lo: ifAlias = LOOPBACK

ifAlias is not showing up when monitored e.g. via libreNMS. Cisco devices on the other hand show the interface description.

+1

OID .1.3.6.1.2.1.2.2.1.2 is interface description, here we see content like 'eth0', 'eth1'.
For interface alias it's OID .1.3.6.1.2.1.31.1.1.1.18 from SNMP table ifXTable, this one is empty in VyOS 1.2.0-rolling+201806251824.

I see, yes .1.3.6.1.2.1.31.1.1.1.18 is empty and would have to be updated/set when the interface description is set. I believe it is not set in any Linux distribution, I also checked RHEL and the such, they leave it all empty. So, I would think it's a feature request than, rather than a bug, isn't it?

I just set alias on another linux system 'ip link set dev eth0 alias TEST', now I can see the alias with 'ip link show eth0', but nothing in the SNMP OID. Here an old discussion in net-snmp project:
https://sourceforge.net/p/net-snmp/feature-requests/185/

Did you do that on vyos? I tried and it doesn't work. That alias is usually set under /sys/class/net/<device>/ifalias, but the ip command didn't do it, nor was I successful setting it manually.

ip link set dev eth0 alias FNORD

snmpwalk -v2c -c public 10.1.1.100 1.3.6.1.2.1.31.1.1.1.18
IF-MIB::ifAlias.1 = STRING:
IF-MIB::ifAlias.2 = STRING:
IF-MIB::ifAlias.3 = STRING:
IF-MIB::ifAlias.4 = STRING:
IF-MIB::ifAlias.5 = STRING:

The only thing I can think about is, to read ifAlias from /sys and insert it into the snmp table. @c-po what do you think about this?

@hagbard :
Sorry for the misunderstanding. I checked on an old openSUSE box. but after that the SNMP OID was still empty.
On latest VyOS rolling release I get with 'cat /sys/class/net/eth0/ifalias' the description from 'set interfaces ethernet eth0 description TEST'.
I also saw on EdgeOS (Ubiquiti) the OID is working, I get the interface descriptions. Maybe that helps.

@Line2 I tested a RHEL7 (currently at work) and a debian 9. I can only imagine that their either used the patch you mentioned, or do it a similar way like observium does it with their perl script. it looks like the patch never made it into upstream in net-snmp, I haven't checked the source yet.

In general I like the idea.

Comparing EdgeOS and VyOS we have htis configuration:

EdgeOS

sysDescr EdgeOS v1.9.7+hotfix.4.5024279.171006.0255
sysObjectID 1.3.6.1.4.1.41112.1.5
sysServices 14
agentaddress unix:/var/run/snmpd.socket,udp:172.16.254.30:161
pass .1.3.6.1.2.1.31.1.1.1.18 /opt/vyatta/sbin/if-mib-alias
smuxpeer .1.3.6.1.4.1.3317.1.2.2
smuxpeer .1.3.6.1.4.1.3317.1.2.5
smuxpeer .1.3.6.1.4.1.3317.1.2.3
smuxpeer .1.3.6.1.4.1.3317.1.2.4
smuxpeer .1.3.6.1.4.1.3317.1.2.6
smuxpeer .1.3.6.1.4.1.3317.1.2.9
smuxpeer .1.3.6.1.4.1.3317.1.2.10
smuxpeer .1.3.6.1.4.1.3317.1.2.11
smuxpeer .1.3.6.1.4.1.3317.1.2.28
smuxsocket localhost
iquerySecName vyatta2e0ead5674e57551
notificationEvent  linkUpTrap    linkUp   ifIndex ifDescr ifType ifAdminStatus ifOperStatus
notificationEvent  linkDownTrap  linkDown ifIndex ifDescr ifType ifAdminStatus ifOperStatus
monitor  -r 10 -e linkUpTrap   "Generate linkUp" ifOperStatus != 2
monitor  -r 10 -e linkDownTrap "Generate linkDown" ifOperStatus == 2

VyOS

sysObjectID 1.3.6.1.4.1.44641
sysServices 14
master agentx
agentXPerms 0755 0755
pass .1.3.6.1.2.1.31.1.1.1.18 /opt/vyatta/sbin/if-mib-alias
smuxpeer .1.3.6.1.2.1.83
smuxpeer .1.3.6.1.2.1.157
smuxpeer .1.3.6.1.4.1.3317.1.2.2
smuxpeer .1.3.6.1.4.1.3317.1.2.3
smuxpeer .1.3.6.1.4.1.3317.1.2.5
smuxpeer .1.3.6.1.4.1.3317.1.2.8
smuxpeer .1.3.6.1.4.1.3317.1.2.9
smuxsocket localhost

# linkUp/Down configure the Event MIB tables to monitor
# the ifTable for network interfaces being taken up or down
# for making internal queries to retrieve any necessary information
iquerySecName vyatta3ace3f788d8ed7f2

# Modified from the default linkUpDownNotification
# to include more OIDs and poll more frequently
notificationEvent  linkUpTrap    linkUp   ifIndex ifDescr ifType ifAdminStatus ifOperStatus
notificationEvent  linkDownTrap  linkDown ifIndex ifDescr ifType ifAdminStatus ifOperStatus
monitor  -r 10 -e linkUpTrap   "Generate linkUp" ifOperStatus != 2
monitor  -r 10 -e linkDownTrap "Generate linkDown" ifOperStatus == 2

Maybe it's b/c we have fewer SMUX peers configured at https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/snmp.py#L97-L105.

In addition VyOS reports PERL warnings when running /opt/vyatta/sbin/if-mib-alias EdgeOS doesn't.

Anyone can confirm this working with VyOS 1.1.8?

Just spawn a VyOS 1.1.8 VM and the ifAlias appears on my libreNMS instance.

@c-po . I just tested on VyOS-1.2.0-rolling+201807010337. And it's fixed! My network monitoring can read the ifalias over SNMP. Thanks for fixing!

I can confirm that this is now fixed. Tested again VyOS 1.2.0-rolling+201807020337.

Thank you very much :-)