- 论坛徽章:
- 0
|
本帖最后由 wadext 于 2010-11-20 19:36 编辑
好吧,就当汇报进度了。
以下是net-snmp 邮件列表里一个朋友的回复:
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, <xuteng@huaihuacity.com> 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
他的意思好像是说:
1 关于发现设备 可以使用额外的bonjour 或者 mdns 协议来发现设备
2 关于manager远程执行agent上的命令,要是用set-request 而不是get-request
刚查了一下bonjour,好像是mac上的一种技术,不知道它的跨平台性能如何,哪位大侠了解麻烦给解释一下。 |
|