Re: FW: calling init_mib() to reload SNMP MIBs

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/6/24 Samer Vazdekis <[email protected]>:
> I am simply calling init_mib() from my signal handler. This is not working for
> me!. .... Am I missing somthing?.

init_mib is designed to be called *once*.
If called a second time, it will simply return immediately.



>  I managed to reload MIB file. But instead calling init_mib(), I'm calling
> the following functions,
>
> add_mibdir("/usr/local/share/snmp/mibs/");
> init_mib_internals();

Again, init_mib_internals is also designed to be called *once*,
and if called a second time, will simply return immediately.
You can safely omit this.


> read_all_mibs();
>
>
> I'm afraid however that I might get a memory leak!

Well test it, then!
Monitor the memory usage of a quiescent agent,
while repeatedly signalling it to re-load the MIBs.

It should be fairly clear whether this leaks memory or not.



>. Should I call unload_all_mibs() before?.

Again - suck it and see.

If you've got a question like this ("what happens if...."),
it's best to actually try it out for yourself, and see what happens.

Dave

------------------------------------------------------------------------------
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.