
On 22 May 2001 18:23:09 +0200, Frank Strauss wrote:
Hi!
Diego> i'm trying to do a program takes the oid of a trap and shows the Diego> information of that trap, name, description. how could i do this?
The general problem is to get a module&identifier out of an OID. Libsmi can solve this query only for the modules that have been loaded. If you know the set of MIB modules that contain all the required information, then smiLoadModule() all those modules, then smiGetNodeByOID() the SmiNode of each notification OID you receive, and walk through the varbinds.
Diego> i have don't the smiGetNodeByOID, when i print node->name, the only Diego> thing that i get is iso., i only get the first piece of the OID. What
How did you retrieve this `node'?
Diego> should i use to walk through?, i tried smiGetNextNode(node, Diego> node-> nodekind), but all i get is a seg fault.
Traversing the nodes is done by smiGetFirstNode()/smiGetNextNode().
If you get seg faults, your libsmi installation is probably not ok. Libsmi does not work smoothly, if you use non-correct modules or if required (including imported) modules are missing. Ensure to get this fixed by using smilint. As long as smilint signals severe errors, do not expect your own program to work correctly.
ok, i used smilint, and it gave some errros, now it works smoothly, but i have another question.
do i have to specify that i want to load a config file smi.conf or is it parsed upon initializacion (calling smiInit(NULL); would serve), i say this because if i put the mibs into the config file and comment the smiLoadModule lines the program fails to retrieve the nodes.
thanks again
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.