Hi Dave: sorry for no clear description! I just compiled the samples on the web of "Sub-Agent Demon tutorial.htm", Everything compiles fine, and I can hook up the subagent to the master agent, but when I try to do any snmpget commands I get: "No Such Object available on this agent at this OID" . and the subagent will crash as: "./nstAgentSubagentObject: symbol lookup error: /usr/lib/libnetsnmpagent.so.5: undefined symbol: hosts_ctl". why? would you please help me to solve this problem? thanks in advance!!
Another example at net-snmp-5.1.2/agent/mibgroup/examples/example.c . when I compile and run it , the output is following: [EMAIL PROTECTED] examples]# ./example-demon Warning: no access control information configured. It's unlikely this agent can serve any useful purpose in this state. Run "snmpconf -g basic_setup" to help you configure the example-demon.conf file for this agent. example-demon is up and running. But I have a correct snmpd.conf at /usr/local/etc/snmp/ directory, and the snmpd daemon can run normally. Does every subagent need a configuration file named as their own name? The main() wrapper like this: int main (int argc, char **argv) { int agentx_subagent=0;//1; /* change this if you want to be a SNMP master agent */ int background = 0; /* change this if you want to run in the background */ int syslog = 0; /* change this if you want to use syslog */ /* print log errors to syslog or stderr */ if (syslog) snmp_enable_calllog(); else snmp_enable_stderrlog(); /* we're an agentx subagent? */ if (agentx_subagent) { /* make us a agentx client. */ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1); } /* run in background, if requested */ if (background && netsnmp_daemonize(1, !syslog)) exit(1); /* initialize tcpip, if necessary */ SOCK_STARTUP; /* initialize the agent library */ init_agent("example-demon"); /* initialize mib code here */ /* mib code: init_nstAgentSubagentObject from nstAgentSubagentObject.C */ init_example(); /* initialize vacm/usm access control */ if (!agentx_subagent) { init_vacm_vars(); init_usmUser(); } /* example-demon will be used to read example-demon.conf files. */ init_snmp("example-demon"); /* If we're going to be a snmp master agent, initial the ports */ if (!agentx_subagent) init_master_agent(); /* open the port to listen on (defaults to udp:161) */ /* In case we recevie a request to stop (kill -TERM or kill -INT) */ keep_running = 1; signal(SIGTERM, stop_server); signal(SIGINT, stop_server); snmp_log(LOG_INFO,"example-demon is up and running.\n"); /* your main loop here... */ while(keep_running) { /* if you use select(), see snmp_select_info() in snmp_api(3) */ /* --- OR --- */ agent_check_and_process(1); /* 0 == don't block */ snmp_log(LOG_INFO,"\nexample-demon is processing the request from manager!\n"); } /* at shutdown time */ snmp_shutdown("example-demon"); SOCK_CLEANUP; return 0; } -----原始邮件----- 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Dave Shield 发送时间: 2006年8月23日 16:46 收件人: MCG PENG Mingxing 抄送: net-snmp-users@lists.sourceforge.net 主题: Re: Regarding subagent of snmpd! On 23/08/06, MCG PENG Mingxing <[EMAIL PROTECTED]> wrote: > Is there any paper about subagent of snmpd daemon? No. > I have run a samples for the subagent, but there is no output What exactly have you tried? "run a sample" is not very informative. > just log as following: > who can tell me the reason? With the details you have provided so far, the only person who could tell you the reason is a mind-reader! For the rest of us mere mortals, you'll need to be much clearer about exactly what you're doing. Dave ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users