Hello,
How can I  change the COMMUNITY's string without using the config file?

With the information I get, there is a command for this:
netsnmp_ds_set_string (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_COMMUNITY,
"public");

But that does not work! in fact, this does not make a difference

My code:
init_agent("SnmpD");
init_my_mib_code();
init_snmp("SnmpD");
init_master_agent();

netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,NETSNMP_DS_AGENT_ROLE, 0);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,NETSNMP_DS_LIB_DUMP_PACKET,true);
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,NETSNMP_DS_AGENT_VERBOSE,true);
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,NETSNMP_DS_LIB_DONT_READ_CONFIGS,true);
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,NETSNMP_DS_LIB_COMMUNITY,"public");

while (whatever) {
      agent_check_and_process(0);
}
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to