Re: 回复: Help using net-snmp
David A <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi good to see you are progressing. Q1: you can shorten the timeout. That will help move stuff along. Or instead of looking for agents, you can maybe incorporate a protocol like bonjour or mdns? Google those and see. I forgot details on them Q2: did you create an init_<module> and in there call the init function created by mib2c ? You also might want to make that one a set request, instead of get. Good luck David On Nov 20, 2010 1:44 AM, "徐滕" <[email protected]> wrote: > Thanks David, and I still have to bother you with two questions. > > By now ,my practice is : > > I wrote my own mib which has two oids ,a vendorId (.1.3.6.1.4.1.8888.1, a string type ,read-only ,for detecting device) ,a commandId ((.1.3.6.1.4.1.8888.2, a string type, read-only ,for execute command on the agent) , add this mib to the agent > > question 1 : in detecting phase: > I send the get-request for oid vendorID to the lan subnet , once anyone return the vendorId I wanted , the manager recognise the responser . In my test case, polling 60 IPs cost 6 minutes, it's a little slow, is anyother more effective way to detecte devices I wanted? > > question 2: in execute phase > I want the agent to execute a command such as shutdown when the manager send a get-request for commandId, so ,I used the mib2c to generate .h and .c from the mib I defined myself , in the get-request-handler for commandId, I added a function system("shutdown -h now") , then compile these files to a dynamic library mylib.so , loaded it in the snmpd.conf on the agent ,restart snmpd service . but it doesn't work ,why ? How should I do ? > > Thanks > > Best Regards > > wade > > ------------------ 原始邮件 ------------------ > 发件人: "David A"<[email protected]>; > 发送时间: 2010年11月20日(星期六) 凌晨0:43 > 收件人: "徐滕"<[email protected]>; > 抄送: "net-snmp-users"<[email protected]>; > 主题: Re: Help using net-snmp > > > > Yes you would have to send requests to a range of IP addresses and see who answers back. Or maybe you can use some bonjour like protocol. > > The manager can send requests to an agent that can trigger a command to be executed yes. > On Nov 18, 2010 6:48 PM, "徐滕" <[email protected]> wrote: >> Hi,all: >> >> I'm a fresh man to snmp, and now participating a project which has a manger on the console server,and a agent on several >> >> terminals such as pc or tc via lan . I cannot get my head arount how the manger detect the agent via lan ,should it brodcast a get-request to the lan ? >> >> and next question is ,could the manger send data to the agent or excute a remote command on the agent via net-snmp ? >> >> Could anyone help me? >> >> Regards! >> >> wade >> >> 2010-11-19 ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-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