Re: Need information to retrieve etherStatsTable parameters from the linux kernel.
On Fri, Nov 20, 2009 at 8:22 AM, srivardhan hebbar ruinlovewit...@gmail.com wrote: I am trying to implement etherStatsTable of the Rmon mib. I am using Net-SNMP 5.4.2.1. I am implementing it on linux kernel. I can get the values of some parameters from /proc/net/dev. The following are the parameters for which I could not find from where to get the values from the system. Hello Srivardhan, Please have a look at the source files under agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable* first. Is there any functionality missing in these files that you need ? $ ls agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable* agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h Bart. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: net-snmp-5.4.2.1 snmpd cpu usage 100%
Hello Wes Hardaker, I have answers to some your questions again: WH: 2) make sure the code is supporting caching. With 4000 entries in the WH: /proc/net/dev file you *don't* want to re-read it frequently. As earlier said with strace out put as well while attaching snmpd to gdb to do frequent back tracing i found that cache_load was being called frequently. One sample backtrace goes like this: -- #0 0x00b74d60 in write () from /lib64/libc.so.6 #1 0x00b1d9dc in _IO_new_file_write () from /lib64/libc.so.6 #2 0x00b1d570 in new_do_write () from /lib64/libc.so.6 #3 0x00b1d970 in _IO_new_do_write () from /lib64/libc.so.6 #4 0x00b1d724 in _IO_new_file_xsputn () from /lib64/libc.so.6 #5 0x00af83f0 in vfprintf () from /lib64/libc.so.6 #6 0x00afe1f4 in fprintf () from /lib64/libc.so.6 #7 0x00835948 in log_handler_file () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #8 0x00835bb4 in snmp_log_string () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #9 0x00835ccc in snmp_vlog () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #10 0x00830b84 in debugmsg () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #11 0x00867bc0 in netsnmp_compare_netsnmp_index () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #12 0x008682fc in array_qsort () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #13 0x008684c0 in array_qsort () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #14 0x008684c0 in array_qsort () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #15 0x0086861c in Sort_Array () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #16 0x00869094 in netsnmp_binary_array_get () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #17 0x0086925c in netsnmp_binary_array_insert () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #18 0x008691d0 in _ba_insert () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #19 0x007374bc in CONTAINER_INSERT_HELPER () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #20 0x007373fc in CONTAINER_INSERT () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #21 0x00737238 in _netsnmp_ioctl_ipaddress_container_load_v4 () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #22 0x00732e60 in netsnmp_arch_ipaddress_container_load () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #23 0x00731bc8 in netsnmp_access_ipaddress_container_load () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #24 0x0070bb88 in ipAddressTable_container_load () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #25 0x0070a49c in _cache_load () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmpmibs.so.15 #26 0x005eb948 in _cache_load () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmphelpers.so.15 #27 0x005ea574 in _timer_reload () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmphelpers.so.15 #28 0x00843ae8 in run_alarms () from /opt/nokiasiemens/SS_NetSnmp//lib/libnetsnmp.so.15 #29 0x000120005498 in receive () #30 0x0001200049f0 in main () -- WH: 3) Is it possible that parsing is failing? IE, is it possible there is WH: a bug in the code that is preventing the function from ever quitting? WH: Does the CPU stay at 100% forever or does it eventually drop back down? YES, CPU stays 100% for ever, i think your guess might be right. But as an observation when i had less than 2000 VLAN's this was not the case it is used to fluctuate between 10-40-100 but predominently 100%. WH: If it takes too long to fill the cache because of that many entries, you WH: may want to increase the caching time for that particular code. But from the grpofile output i attached it does not look like that, ofcourse i woudl like to introduce cache-timeout in ipAddressTable_initialise(). Let me know. Thanks very much. Best Regards, Bheemesh On Fri, Nov 20, 2009 at 12:52 PM, bheemesh v bheem...@gmail.com wrote: Hello Wes Hardaker, Thanks very much for your valuable inputs here. We are starting the snmpd with -f option, so i guess i am going right there. I am attaching a sample gpofile output file to your refrence generated from my HW environnment. May be this can give better data for investigations. I will get back on the remaining questions. But as an observation for cache-timeout, it is being used for ifTable_initialization, but not for ipAddressTable_initialization. So cache- flags are only being used commonly. Let me know. Thanks very much. BR, Bheemesh On Thu, Nov 19, 2009 at 7:10 AM, Wes Hardaker harda...@users.sourceforge.net wrote: bv Has anybody done so far profiling with gprof or any
回复: About Dynamically Load my MIB
r...@ubuntu:/usr/share/snmp/mibs# snmpd -f -Le -Duit,dlmod 6161 registered debug token uit, 1 registered debug token dlmod, 1 dlmod: register mib dlmod: dlmod_path: /usr/lib/snmp/dlmod dlmod: dlmod_create_module dlmod: dlmod_load_module uit: /usr/share/snmp/mibs/uit.so NET-SNMP version 5.4.1 command stop there,and what should I do next? -- 原始邮件 -- 发件人: Dave Shieldd.t.shi...@liverpool.ac.uk; 发送时间: 2009年11月16日(星期一) 下午4:39 收件人: 飞飞chenyapu1...@qq.com; 抄送: net-snmp-usersnet-snmp-users@lists.sourceforge.net; 主题: Re: About Dynamically Load my MIB [ First - *please* don't mail me privately, without copying any responses to the mailing list. I don't have the time or inclination to offer private, unpaid, SNMP consultancy. Keep discussions to the list, where others can both learn and offer advice. Thanks. ] 2009/11/16 飞飞 chenyapu1...@qq.com: r...@ubuntu:/usr/share/snmp/mibs# snmpd -f -L -Duit,dlmod registered debug token uit, 1 registered debug token dlmod, 1 dlmod: register mib dlmod: dlmod_path: /usr/lib/snmp/dlmod /* I really have no idea what its meaning */ This is the default directory where the agent will look for .so modules to load. But you specify a full path below, so don't need to worry about this. dlmod: dlmod_create_module dlmod: dlmod_load_module uit: /usr/share/snmp/mibs/uit.so No is error displayed here, so it looks as if the module is being loaded successfully. /etc/snmp/snmpd.conf: line 430: Warning: Unknown token: mibs. The mibs directive is typically aimed at client applications, and belongs in the file snmp.conf, not the agent-specific file. Error opening specified endpoint Server Exiting with code 1 Typically that would indicate that you're running the agent as a non-root user, and trying to open the standard (privileged) port. Which fails. But given that you seem to be running this as root, my suspicion is that you're already running an SNMP agent, listening on this port. Either stop this standard agent before running your new one, or run your testing on a different port e,g: snmpd -f -Le -Duit,dlmod 6161 /* /etc/snmp/snmpd.conf: line 430 is: mibs +ALL is anything wrong? */ This directive belongs in snmp.conf Dave I modified a Makefile file for my own use,as follows: CC=gcc OBJS1=snmpdemoapp.o OBJS2=example-demon.o uit.o OBJS3=asyncapp.o TARGETS=example-demon snmpdemoapp asyncapp CFLAGS=-I. `net-snmp-config --cflags` BUILDLIBS=`net-snmp-config --libs` BUILDAGENTLIBS=`net-snmp-config --agent-libs` # shared library flags (assumes gcc) DLFLAGS=-fPIC -shared all: $(TARGETS) snmpdemoapp: $(OBJS1 $(CC) -o snmpdemoapp $(OBJS1) $(BUILDLIBS) asyncapp: $(OBJS3) $(CC) -o asyncapp $(OBJS3) $(BUILDLIBS) example-demon: $(OBJS2) $(CC) -o example-demon $(OBJS2) $(BUILDAGENTLIBS) clean: rm $(OBJS2) $(OBJS2) $(TARGETS) uit.so: uit.c Makefile $(CC) $(CFLAGS) $(DLFLAGS) -c -o uit.o uit.c $(CC) $(CFLAGS) $(DLFLAGS) -o uit.so uit.o Is anything wrong here? Alex -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users-- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re:RE: 回复:RE: 回复:RE: The problem about the net-snmp in stallation
I had been read them all,but,I got nothing useful to me. I just want to know one thing ,how the steps i need to do so I can install the net-snmp in my OS?I test several OSs,Ubuntu,SuSE,Redhat,I cannot install net-snmp use source code download from the offical site. All my job now need I compile net-snmp source code so install it to my OS,so I can static load my subagent(re-compile source code added my .c,.h files). If you donot believe it,just test it and tell me why. Thank you very much. -- Original -- From: mike_ayers-net-snmp-mike_ay...@tvworks.com; Date: Thu, Nov 19, 2009 02:13 AM To: chenyapu1982chenyapu1...@qq.com; net-snmp-usersnet-snmp-users@lists.sourceforge.net; Subject: RE: 回复:RE: 回复:RE: The problem about the net-snmp installation From: chenyapu1...@qq.com [mailto:chenyapu1...@qq.com] Sent: Tuesday, November 17, 2009 5:46 PM I run the command /usr/local/sbin/snmpd start,I got NOTHING. That wasn't the command I asked you to run. Slow down and start reading up - `man snmpd` and man `snmpd.conf` are good starting places. Mind the details - they're important. HTH, Mike -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users-- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
/usr/local/sbin/./snmpd cannot find 'libnetsnmpagent.so.20'---------what is wrong with it?
sys-man sbin # ./snmpd ./snmpd: error while loading shared libraries: libnetsnmpagent.so.20: cannot open shared object file: No such file or directory libnetsnmpagent.so.20-- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
RE: /usr/local/sbin/./snmpd cannot find'libnetsnmpagent.so.20'---------what is wrong with it?
From: 飞飞 [mailto:chenyapu1...@qq.com] Sent: Thursday, November 19, 2009 6:25 PM sys-man sbin # ./snmpd ./snmpd: error while loading shared libraries: libnetsnmpagent.so.20: cannot open shared object file: No such file or directory Do you have /usr/local/lib in your LD_LIBRARY_PATH? HTH, Mike -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
RE: net-snmp-5.4.2.1 snmpd cpu usage 100%
From: bheemesh v [mailto:bheem...@gmail.com] Sent: Friday, November 20, 2009 12:12 AM YES, CPU stays 100% for ever, i think your guess might be right. But as an observation when i had less than 2000 VLAN's this was not the case it is used to fluctuate between 10-40-100 but predominently 100%. H... I once did some testing on performance of directories in the ext2 filesystem. I found that directory operations - list, add a file, remove a file, etc. were frisky up until about 1000 entries. By 2000 entries there was a perceptible slowdown. With 4000 entries in a directory, it took over a day just to remove all the files. My conclusion was that the directory operations were iterating the entire directory list for each operation, leading to exponential performance degradation. I saw the same problem adding routes, with the same thresholds. If this is your issue, you will have problems no matter what, but heavy caching should help matters a little. To test this, do an ls in the directory that holds all the vlans. HTH, Mike -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
snmpwalk and specific interface
is it possible to use specific local interface(or better specific local ip address) for snmp requests ? somesing like -I in ping , or -b for telnet -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users