Re: several sub agents on the same machine with lowest possible influence on the system
"Sebastian Fabig" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Wes,
thank you for your answer. Sorry, if I might not answer correctly, this is the first time I'm using a mailinglist.
I integrated the following lines (I simplified it a bit) into my source code:
static const oid s_my_registration_oid[] = { 1, 3, 6, 1, 4, 1, 1454, 3, 6, 1};
static int s_examplevalue = 3;
void initAgent()
{
//this is a master agent
netsnmp_ds_set_boolean( NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_ROLE, 0);
SOCK_STARTUP;
debug_register_tokens("read-config");
snmp_set_do_debugging(1);
snmp_enable_stderrlog();
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_OPTIONALCONFIG, "C:\snmpd.conf");
init_agent("myapp");
netsnmp_register_read_only_int_instance("nstAgentSubagentObject",
s_my_registration_oid,
OID_LENGTH(s_my_registration_oid),
&s_examplevalue, &callbackHandler);
init_mib_modules();
init_snmp("pl");
init_master_agent();
while(true) {
agent_check_and_process(1);
}
snmp_shutdown("pl");
SOCK_CLEANUP;
}
My snmpd.conf looks like this:
rocommunity public
syscontact "anonym"
It is working right now, I can request the syscontact - oid and all other standard things.
But what do I have to do to get my new oid working? I think I have to tell net-snmp to load my MIB-File, but how? Is there any function for this?
My second question is, if there is any possibility to register the rocommunity "public" without using a conf-file. Is there any function I can use for this or is it only possible to use it via the conf-file?
I hope anybody can help me with this, as I badly need it.
--
GRATIS: Spider-Man 1-3 sowie 300 weitere Videos!
Jetzt freischalten! http://portal.gmx.net/de/go/maxdome
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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