------------------ Original ------------------
From:  "Dave Shield"<[email protected]>;
Date:  Tue, Jan 26, 2010 05:54 PM
To:  "Alexander King"<[email protected]>; 
Cc:  "net-snmp-users"<[email protected]>; 
Subject:  Re: when snmpwalk query my private trap OID the snmpd routine auto 
termination

Thank you for providing the full code.

Compiling this, it became clear very quickly that the problem
is nothing to do with the handling of notifications.
I tried the following:

-  Commented out all of the code relating to traps;
compiled the agent;
walked your subtree.
This listed the first four scalars (up to systemType)
and then the agent crashed.

- Restarted the agent;
Issued a GET request on 
The agent crashed again.

- Restarted the agent;
Issued a GET request on 
The agent crashed again.
>>>>i had deleted all the code related to the two objects(in mib file,register 
>>>>function,traps),and I re-compiled the source use  

./configure  --with-mib-modules="uit" 
make 
make install

reboot the system,and I can walk all the info use MG-soft,the snmpd didnot auto 
termination ,the walk result are quite right(not systemJBODNumber.0 and 
systemStatus.0) But I didnot reveived one trap!I think it is maybe something 
wrong config or something,so I use 

ps aux |grep snmpd|grep -v grep|awk '{print $2}'|xargs kill
ps aux |grep snmptrapd|grep -v grep|awk '{print $2}'|xargs kill
/usr/local/sbin/snmpd -C -c /usr/local/share/snmp/snmpd.conf -M 
/usr/local/share/snmp/mibs/
/usr/local/sbin/snmptrapd -C  -c /usr/local/share/snmp/snmptrapd.conf

via CLI,but the snmpd daemon down quickly!is it something with my config file?

I checked the handler function on systemJBODNumber and systemStatus,objectively 
speaking,I hadnot found something apparently wrong contrast to the other object 
handler function.I will check it more carefully again later.


Alex




- Commented out the registration of these two objects;
compiled the agent;
walked your subtree.
This complete successfully.

You need to look more closely at the handler routines for
these two MIB objects.

Some more general advice:
Don't try to implement the whole MIB in one go. Build it up piece by piece.

Start with the code for the scalar objects - and check each of these
individually (using "snmpget").  Once your happy that these work in
isolation, run "snmpwalk" on the whole lot to make sure things are OK.
Then move on to the table

Once you're happy that the main management objects are working
properly - *then* (and only then) is it sensible to start thinking about
the notifications.
Trying to do everything in one go - particularly when you are not
very experienced - is simply asking for trouble.

There's also a problem with the implementation of the IP address
and PhysAddress objects.   These are meant to be *binary* strings,
not text strings.   You need something like

unsigned char ipaddress[] = {201, 201, 201, 201};
unsigned char macaddress[] = {0, 0x0c, 0x29, 0xd5, 0xbc, 0xb7 };

and then use "sizeof" rather than "strlen" in the handler routines.

But the basic problem is in the handler routines for the Status and
JBODNumber objects.

Dave

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to