Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

net-snmp mib files

Altera_Forum
Honored Contributor II
3,129 Views

Hello guys...... 

 

i using snmp in uClinux .....it works with the default mibs but i need to do my own mib file ....... 

 

anybody knows how can i do that???............ one exemple how can i monitore a peripherial..... 

 

thanks 

 

Franz Wagner
0 Kudos
15 Replies
Altera_Forum
Honored Contributor II
1,411 Views

where the uclinux jedis for help me !!!!!

0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

I understand that the MIB file is part of the snmp standard and not spcific for NIOS or uClinux. So you should find in the internet what needs to be written there.  

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

ok..... 

 

i post the result when i did work....... 

 

 

Franz Wagner
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

hi all!!!! 

 

i did a simple mib that read a one memory address......and i have success creating a skeleton of mib ( .c and .h) 

 

i run ./configure --with-mib-modules=mymod and it add mymod ok 

 

but when i did make in kernel i had many errors with doesnt appears when i make in my system pc........the problem is in cross compile......:( 

 

someone, sometime , already implement a own mib????? 

 

 

can someone help me did that ??????? 

 

thanks 

 

Franz Wagner
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

nz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -O2 -g -fno-builtin -Dlinux -c ../../../net-snmp-5.2.1/agent/mibgroup/snmpv3/usmUser.c -o snmpv3/usmUser.o In file included from ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:22: /home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp/net-snmp-5.2.1/include/ucd-snmp/ucd-snmp-includes.h:7:2:# error "Please update your headers or configure using --enable-ucd-snmp-compatibility" ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:23:139: /home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp/net-snmp-5.2.1/include/ucd-snmp/agent/ucd-snmp-agent-includes.h: No such file or directory In file included from ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:29: ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.h:19: error: syntax error before "var_ladProject" ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:59: error: extra brace group at end of initializer ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:59: error: (near initialization for `ladProject_variables') ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:60: error: ` ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:298: error: 'write_ladAlarmLatching' redeclared as different kind of symbol ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.h:24: error: previous declaration of 'write_ladAlarmLatching' was here ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: In function `write_ladAlarmLatching': ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:303: error: `action' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:304: error: `RESERVE1' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:305: error: `var_val_type' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:306: error: `stderr' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:307: error: `SNMP_ERR_WRONGTYPE' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:309: error: `var_val_len' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:311: error: `SNMP_ERR_WRONGLENGTH' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:316: error: `RESERVE2' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:318: error: `var_val' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:324: error: `FREE' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:329: error: `ACTION' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:336: error: `UNDO' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:341: error: `COMMIT' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:346: error: `SNMP_ERR_NOERROR' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: At top level: ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:354: error: syntax error before "u_char" ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:360: error: 'write_ladAlarmState' redeclared as different kind of symbol ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.h:25: error: previous declaration of 'write_ladAlarmState' was here ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: In function `write_ladAlarmState': ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:365: error: `action' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:391: error: `ACTION' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:398: error: `UNDO' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:403: error: `COMMIT' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:408: error: `SNMP_ERR_NOERROR' undeclared (first use in this function) ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: In function `var_ladProject': ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:113: error: storage size of `string' isn't known ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:115: error: storage size of `c64' isn't known ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: In function `var_ladAlarmTable': ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:166: error: storage size of `string' isn't known ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:168: error: storage size of `c64' isn't known ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c: At top level: ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:57: warning: array 'ladProject_variables' assumed to have one element ../../../net-snmp-5.2.1/agent/mibgroup/ladProject.c:57: error: storage size of `ladProject_variables' isn't known nios2-linux-uclibc-gcc -O2 -g -fno-builtin -I../../include -I../../../net-snmp-5.2.1/include -I. -I../../agent -I../../../net-snmp-5.2.1/agent -I../../agent/mibgroup -I../../../net-snmp-5.2.1/agent/mibgroup -I../../snmplib -I../../../net-snmp-5.2.1/snmplib -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -O2 -g -fno-builtin -Dlinux -c ../../../net-snmp-5.2.1/agent/mibgroup/snmpv3/snmpMPDStats.c -o snmpv3/snmpMPDStats.o echo timestamp > snmpv3/usmStats.lo /bin/sh ../../libtool --mode=compile nios2-linux-uclibc-gcc -O2 -g -fno-builtin -I../../include -I../../../net-snmp-5.2.1/include -I. -I../../agent -I../../../net-snmp-5.2.1/agent -I../../agent/mibgroup -I../../../net-snmp-5.2.1/agent/mibgroup -I../../snmplib -I../../../net-snmp-5.2.1/snmplib -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -O2 -g -fno-builtin -Dlinux -c -o util_funcs.lo ../../../net-snmp-5.2.1/agent/mibgroup/util_funcs.c make: ** Erro 1 make: ** Esperando que outros processos terminem. echo timestamp > snmpv3/snmpMPDStats.lo echo timestamp > snmpv3/usmUser.lo nios2-linux-uclibc-gcc -O2 -g -fno-builtin -I../../include -I../../../net-snmp-5.2.1/include -I. -I../../agent -I../../../net-snmp-5.2.1/agent -I../../agent/mibgroup -I../../../net-snmp-5.2.1/agent/mibgroup -I../../snmplib -I../../../net-snmp-5.2.1/snmplib -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -I/home/franz/altera/linux/nios2-linux/uClinux-dist -I/home/franz/altera/linux/nios2-linux/uClinux-dist/linux-2.6.x/include -I/home/franz/altera/linux/nios2-linux/uClinux-dist/staging/usr/include -D__adjtimex=adjtimex -O2 -g -fno-builtin -Dlinux -c ../../../net-snmp-5.2.1/agent/mibgroup/util_funcs.c -o util_funcs.o echo timestamp > util_funcs.lo make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp/build/agent/mibgroup' make: ** Erro 1 make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp/build/agent' make: ** Erro 1 make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp/build' make: ** Erro 2 make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user/net-snmp' make: ** Erro 2 make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user' make: ** Erro 2 make: Saindo do diretório `/home/franz/altera/linux/nios2-linux/uClinux-dist/user' make: ** Erro 1 franz@franz-desktop:~/altera/linux/nios2-linux/uClinux-dist$ here an error what i did ........ i already add --enable-ucd-snmp-compatibility but doent work i guess.............. 

 

help.... :(
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Hi guys !!!!!!!!  

 

i have success compiling my own mib !!!!!! :) 

 

the problem was a simple header error............. 

 

now its working  

 

franz@franz-desktop:~$ snmpwalk -c public 192.168.100.137 enterprises enterprises.23528.1.1.1.1.1.0 = Hex: 00 00 00 00 enterprises.23528.1.1.1.1.2.0 = 0 enterprises.23528.1.1.1.2.1.1.2.1 = Hex: 00 00 00 00 enterprises.23528.1.1.1.2.1.1.2.2 = Hex: 00 00 00 00 enterprises.23528.1.1.1.2.1.1.2.3 = Hex: 00 00 00 00 enterprises.23528.1.1.1.2.1.1.2.4 = Hex: 00 00 00 00 enterprises.23528.1.1.1.2.1.1.3.1 = 192 enterprises.23528.1.1.1.2.1.1.3.2 = 192 enterprises.23528.1.1.1.2.1.1.3.3 = 192 enterprises.23528.1.1.1.2.1.1.3.4 = 192 enterprises.23528.1.1.1.2.1.1.4.1 = 0 enterprises.23528.1.1.1.2.1.1.4.2 = 0 enterprises.23528.1.1.1.2.1.1.4.3 = 0 enterprises.23528.1.1.1.2.1.1.4.4 = 0 enterprises.23528.1.1.1.2.1.1.5.1 = 0 enterprises.23528.1.1.1.2.1.1.5.2 = 0 enterprises.23528.1.1.1.2.1.1.5.3 = 0 enterprises.23528.1.1.1.2.1.1.5.4 = 0 enterprises.23528.1.1.1.2.1.1.6.1 = Counter32: 0 enterprises.23528.1.1.1.2.1.1.6.2 = Counter32: 0 enterprises.23528.1.1.1.2.1.1.6.3 = Counter32: 0 enterprises.23528.1.1.1.2.1.1.6.4 = Counter32: 0
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Hi, 

 

Great job. 

I'm interested to make snmp work on my uClinux too. 

 

How do you manage to make it work? Do you do the following ? 

 

  • You select snmpd 

  • You select also net-snmp with "additional mibs options" 

  • You put your modules in the additional mibs 

  • Then when compiled you run snmpd on your target (snmpd -c <IPAddr of the target> -c public) 

 

Is that's all ? Or do you provide additional configuration/mib files ? 

 

On my side, I don't put additional mibs but I think that there is default mibs provided by snmpd. However I don't know if it need configuration files because my snmpd runs but it does not replies to a walk (timeout).  

I activate the debug in snmdp (#define DEBUG in debug.h) and I see request but snmpd does not replies to it : 

 

--- Quote Start ---  

 

snmpd -h 192.168.254.133 -c public 

NILRecvfrom: 40 

30 26 02 01 00 04 06 70 75 62 6C 69 63 A1 19 02 04 1E C3 D5 B6 02 01 00 02 01 00 30 0B 30 09 06 05 2B 06 01 02 01 05 00  

smpInputEvent 2 

Recvfrom: 40 

30 26 02 01 00 04 06 70 75 62 6C 69 63 A1 19 02 04 1E C3 D5 B6 02 01 00 02 01 00 30 0B 30 09 06 05 2B 06 01 02 01 05 00  

smpInputEvent 2 

Recvfrom: 40 

30 26 02 01 00 04 06 70 75 62 6C 69 63 A1 19 02 04 1E C3 D5 B6 02 01 00 02 01 00 30 0B 30 09 06 05 2B 06 01 02 01 05 00  

smpInputEvent 2 

Recvfrom: 40 

30 26 02 01 00 04 06 70 75 62 6C 69 63 A1 19 02 04 1E C3 D5 B6 02 01 00 02 01 00 30 0B 30 09 06 05 2B 06 01 02 01 05 00  

smpInputEvent 2 

Recvfrom: 40 

30 26 02 01 00 04 06 70 75 62 6C 69 63 A1 19 02 04 1E C3 D5 B6 02 01 00 02 01 00 30 0B 30 09 06 05 2B 06 01 02 01 05 00  

smpInputEvent 2 

 

--- Quote End ---  

Do I do something wrong ? 

 

Best regards
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

hi zben 

 

 

follow me!!! 

 

at menuconfig select custumize Applications..... 

 

select net-snmp , build mini agent, build static, install mibs. 

 

make  

 

in your uclinux terminal do mkdir /etc/snmp 

 

in this directory you do a snmpd.conf and put  

 

rwcommunity public  

 

save 

 

 

at your desktop  

 

snmpwalk -c public 192.168.100.137 -> put your uclinux ip 

 

........... 

 

 

if you want to do your own mib need other steps........ 

 

 

 

try it and report........ 

 

 

good luck 

 

 

Franz Wagner
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Wow great !! 

 

My error was to select in menuconfig the "package" snmpd that provide also a snmpd application that override the snmpd provided by net-snmp. 

 

So it works great (V1, V2c and V3). 

 

Thank you very much, maybe I will come back with issue with custom MIBs 

 

Best regards
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

:cool: 

 

good job
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Hi 

i'm interested in compiling my own MIB in uclinux.. my snmp works fine but im not able to add my own MIB .. i followed the net-snmp tutorial but no avail ...  

 

regards  

Khushboo
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

hello Mr khushboo_q, 

 

I'm sorry for the delay in reply........ 

 

 

to do you ow mib first you need to write your FILE-MIB.txt 

 

this file is used to generate a c skeleton... 

 

and look like this 

 

LINEAR-MIB DEFINITIONS ::= BEGIN IMPORTS NOTIFICATION-TYPE, MODULE-IDENTITY, enterprises, OBJECT-TYPE, Counter32, Integer32, Gauge32 FROM SNMPv2-SMI DisplayString, TruthValue FROM SNMPv2-TC ; tsoipProject MODULE-IDENTITY LAST-UPDATED "201105130000Z" ORGANIZATION "LINEAR Equipamentos Eletronicos S/A." CONTACT-INFO "Contact: Franz Wagner Postal: LINEAR Equipamentos Eletronicos S/A, Praca Linear sn, Santa Rita do Sapucai, MG, Brasil, Web: www.linear-tv.com Email: fwagner@linear.com.br" DESCRIPTION "Rev. 1.33" ::= { linear 8 } linear OBJECT IDENTIFIER ::= { enterprises 25026 } -- top level MIB headings of the LAD MIB tsoipTraps OBJECT IDENTIFIER ::= { tsoipProject 0 } tsoipSystem OBJECT IDENTIFIER ::= { tsoipProject 1 } tsoipTrapInfo OBJECT IDENTIFIER ::= { tsoipProject 2 } -- LAD System Information tsoipTables OBJECT IDENTIFIER ::= { tsoipSystem 1 } -- ----------------------------------------- -- TX Table -- ----------------------------------------- txTable OBJECT-TYPE SYNTAX SEQUENCE OF LinearTxEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Tabelas com informacoes de Transmissao e Recepcao." ::= { tsoipTables 1 } linearTxEntry OBJECT-TYPE SYNTAX LinearTxEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Tabela de Transmissao." INDEX { linearTxId } ::= { txTable 1 } LinearTxEntry ::= SEQUENCE { linearTxId Integer32, linearTxIp1 Integer32, linearTxIp2 Integer32, linearTxIp3 Integer32, linearTxIp4 Integer32, linearTxPort Integer32, linearTxencap DisplayString, linearTxpacket Integer32, linearTxFec DisplayString, linearTxFecV DisplayString, linearTxEthBps Integer32 } linearTxId OBJECT-TYPE SYNTAX Integer32 (1..10) MAX-ACCESS not-accessible STATUS current DESCRIPTION "Index da Tabela." ::= { linearTxEntry 1 } linearTxIp1 OBJECT-TYPE SYNTAX Integer32 (1..255) MAX-ACCESS read-write STATUS current DESCRIPTION "1 octeto do IP de Destino" ::= { linearTxEntry 2 } linearTxIp2 OBJECT-TYPE SYNTAX Integer32 (1..255) MAX-ACCESS read-write STATUS current DESCRIPTION "2 octeto do IP de Destino." ::= { linearTxEntry 3 } linearTxIp3 OBJECT-TYPE SYNTAX Integer32 (1..255) MAX-ACCESS read-write STATUS current DESCRIPTION "3 octeto do IP de Destino" ::= { linearTxEntry 4 } linearTxIp4 OBJECT-TYPE SYNTAX Integer32 (1..255) MAX-ACCESS read-write STATUS current DESCRIPTION "4 octeto do IP de Destino" ::= { linearTxEntry 5 } linearTxPort OBJECT-TYPE SYNTAX Integer32 (1..65525) MAX-ACCESS read-write STATUS current DESCRIPTION "Porta de Destino" ::= { linearTxEntry 6 } linearTxencap OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-write STATUS current DESCRIPTION "Encapsulamento RTP ou UDP" ::= { linearTxEntry 7 } linearTxpacket OBJECT-TYPE SYNTAX Integer32 (1..7) MAX-ACCESS read-write STATUS current DESCRIPTION "N de pacotes ts em cada pacote IP" ::= { linearTxEntry 8 } linearTxFec OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-write STATUS current DESCRIPTION "FEC habilitado ou desabilitado" ::= { linearTxEntry 9 } linearTxFecV OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-write STATUS current DESCRIPTION "Valor do Fec" ::= { linearTxEntry 10 } linearTxEthBps OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current DESCRIPTION "Taxa de transmissao na saida ETH" ::= { linearTxEntry 11 } -- ----------------------------------------- -- LAD traps -- ----------------------------------------- tsoipRefreshAlarm NOTIFICATION-TYPE OBJECTS {refreshTrap} STATUS current DESCRIPTION " Trap issued when an alarm is triggered. " ::= { tsoipTraps 1 } -- ----------------------------------------- -- LAD Trap Info: varbinds sent with traps -- ----------------------------------------- refreshTrap OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS accessible-for-notify STATUS current DESCRIPTION "This is the Id (row number in the ladAlarmTable) of the zone generating the alarm." ::= { tsoipTrapInfo 1 } END  

 

now you need a linux machine to walk away...... 

 

install net-snmp .... and put your mib at mibs directory /opt/net-snmp/mibs 

 

and run mib2c 

 

$mib2c LINEAR-MIB.txt:linearProject 

 

 

 

this generate two files : linearProject.h and linearProject.c ...... 

 

you need modify the .c file to do what you need....... 

 

and put this file at nios2-linux/uClinux-dist/user/net-snmp/net-snmp-5.2.1/agent/mibgroup 

 

add your mib at menuconfig and voila..... 

 

 

good luck  

 

 

Franz Wagner
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Hi all, 

 

I have a system with a nios2 and a network interface (Altera Triple speed Ethernet MAC). 

I use 2.6.30 kernel on my board and net-snmp 5.2.1. 

 

I can see my network interfaces using ifconfig : 

 

--- Quote Start ---  

 

/# ifconfig  

eth0 Link encap:Ethernet HWaddr 00:15:12:00:15:88  

inet addr:192.168.0.110 Bcast:192.168.0.255 Mask:255.255.255.0 

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 

RX packets:1400 errors:0 dropped:681 overruns:0 frame:0 

TX packets:400 errors:0 dropped:0 overruns:0 carrier:0 

collisions:0 txqueuelen:1000  

RX bytes:205531 (200.7 KiB) TX bytes:33239 (32.4 KiB) 

Base address:0x400  

 

lo Link encap:Local Loopback  

inet addr:127.0.0.1 Mask:255.0.0.0 

UP LOOPBACK RUNNING MTU:16436 Metric:1 

RX packets:0 errors:0 dropped:0 overruns:0 frame:0 

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 

collisions:0 txqueuelen:0  

RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 

 

--- Quote End ---  

So the systems know interface statistics. 

But I wonder why net-snmp is not able to handle these statistics automatically.  

I have the following : 

 

 

--- Quote Start ---  

 

/# snmpwalk -v 1 -c public 192.168.0.110 1 

iso.3.6.1.2.1.1.1.0 = STRING: "XXX" 

iso.3.6.1.2.1.1.2.0 = OID: ccitt.1 

iso.3.6.1.2.1.1.3.0 = Timeticks: (115) 0:00:01.15 

iso.3.6.1.2.1.1.4.0 = STRING: "System Contact (configurable)" 

iso.3.6.1.2.1.1.5.0 = STRING: "System Name (configurable)" 

iso.3.6.1.2.1.1.6.0 = STRING: "System Location (configurable)" 

iso.3.6.1.2.1.1.7.0 = INTEGER: 2 

iso.3.6.1.2.1.1.8.0 = Timeticks: (7) 0:00:00.07 

iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.6.3.1 

iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.16.2.2.1 

iso.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.6.3.10.3.1.1 

iso.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.6.3.11.3.1.1 

iso.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.6.3.15.2.1.1 

iso.3.6.1.2.1.1.9.1.3.1 = STRING: "The MIB module for SNMPv2 entities" 

iso.3.6.1.2.1.1.9.1.3.2 = STRING: "View-based Access Control Model for SNMP." 

iso.3.6.1.2.1.1.9.1.3.3 = STRING: "The SNMP Management Architecture MIB." 

iso.3.6.1.2.1.1.9.1.3.4 = STRING: "The MIB for Message Processing and Dispatching." 

iso.3.6.1.2.1.1.9.1.3.5 = STRING: "The management information definitions for the SNMP User-based Security Model." 

iso.3.6.1.2.1.1.9.1.4.1 = Timeticks: (5) 0:00:00.05 

iso.3.6.1.2.1.1.9.1.4.2 = Timeticks: (6) 0:00:00.06 

iso.3.6.1.2.1.1.9.1.4.3 = Timeticks: (6) 0:00:00.06 

iso.3.6.1.2.1.1.9.1.4.4 = Timeticks: (6) 0:00:00.06 

iso.3.6.1.2.1.1.9.1.4.5 = Timeticks: (7) 0:00:00.07 

iso.3.6.1.2.1.11.1.0 = Counter32: 24 

iso.3.6.1.2.1.11.2.0 = Counter32: 25 

iso.3.6.1.2.1.11.3.0 = Counter32: 0 

iso.3.6.1.2.1.11.4.0 = Counter32: 0 

iso.3.6.1.2.1.11.5.0 = Counter32: 0 

iso.3.6.1.2.1.11.6.0 = Counter32: 0 

iso.3.6.1.2.1.11.8.0 = Counter32: 0 

iso.3.6.1.2.1.11.9.0 = Counter32: 0 

iso.3.6.1.2.1.11.10.0 = Counter32: 0 

iso.3.6.1.2.1.11.11.0 = Counter32: 0 

iso.3.6.1.2.1.11.12.0 = Counter32: 0 

iso.3.6.1.2.1.11.13.0 = Counter32: 34 

iso.3.6.1.2.1.11.14.0 = Counter32: 0 

iso.3.6.1.2.1.11.15.0 = Counter32: 0 

iso.3.6.1.2.1.11.16.0 = Counter32: 38 

iso.3.6.1.2.1.11.17.0 = Counter32: 0 

iso.3.6.1.2.1.11.18.0 = Counter32: 0 

iso.3.6.1.2.1.11.19.0 = Counter32: 0 

iso.3.6.1.2.1.11.20.0 = Counter32: 0 

iso.3.6.1.2.1.11.21.0 = Counter32: 0 

iso.3.6.1.2.1.11.22.0 = Counter32: 0 

iso.3.6.1.2.1.11.24.0 = Counter32: 0 

iso.3.6.1.2.1.11.25.0 = Counter32: 0 

iso.3.6.1.2.1.11.26.0 = Counter32: 0 

iso.3.6.1.2.1.11.27.0 = Counter32: 0 

iso.3.6.1.2.1.11.28.0 = Counter32: 48 

iso.3.6.1.2.1.11.29.0 = Counter32: 1 

iso.3.6.1.2.1.11.30.0 = INTEGER: 2 

iso.3.6.1.2.1.11.31.0 = Counter32: 0 

iso.3.6.1.2.1.11.32.0 = Counter32: 0 

iso.3.6.1.4.1.8072.2.1.1.0 = INTEGER: 43 

iso.3.6.1.6.3.10.2.1.1.0 = Hex-STRING: 80 00 1F 88 80 28 B8 EF 53 96 13 43 38  

iso.3.6.1.6.3.10.2.1.2.0 = INTEGER: 6 

iso.3.6.1.6.3.10.2.1.3.0 = INTEGER: 1 

iso.3.6.1.6.3.10.2.1.4.0 = INTEGER: 1500 

iso.3.6.1.6.3.11.2.1.1.0 = Counter32: 0 

iso.3.6.1.6.3.11.2.1.2.0 = Counter32: 0 

iso.3.6.1.6.3.11.2.1.3.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.1.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.2.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.3.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.4.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.5.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.1.6.0 = Counter32: 0 

iso.3.6.1.6.3.15.1.2.1.0 = INTEGER: 0 

iso.3.6.1.6.3.16.1.1.1.1.0 = "" 

[...] 

 

--- Quote End ---  

So it is ok for the system mibs and some other infos, but nothing about my network interface (eth0)... 

 

My (simple) config : 

 

--- Quote Start ---  

 

rwcommunity private 

rocommunity public 

sysServices 2 

sysDescr XXX 

 

interface eth0 6 100000000 

 

--- Quote End ---  

As you can see I tried to add "interface eth0 6 100000000" to my conf file but it is not recognized by this version of net-snmp 

 

I can't figure out if net-snmp is able to "automatically" retrieve network interface, or if my issue is related to the nios2 linux environment I use. I googled a lot for nothing. 

Do I need to add a MIB in menuconfig (I tried mibII/ifTable mibII/interface mibII Rmon if-mib...) ? 

Do you have any idea ? 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

I think that I need succeed to add modules in menuconfig : mibII/ifTable mibII/interface mibII Rmon if-mib 

 

But there is compilation errors, and if I let only mibII/interface snmpd hangs the system ...
0 Kudos
Altera_Forum
Honored Contributor II
1,411 Views

Hello mr zben 

 

try add your mib at computar that you do snmpwalk (i dont remenber what directory but look like Mibs) and add that mib at /user/net-snmp/.../mibs 

 

good luck  

 

Franz Wagner
0 Kudos
Reply