[2013/05/14 06:06:04] #net-snmp <SonicYouth> there're only 2 parts left in my diploma project, exactly: trap and mib agent... I'd like to solve the easy one first, "trap".
[2013/05/14 06:06:04] #net-snmp <SonicYouth> I want to send trap to all sinks, so I write trapcommunity and snmp2sink(to localhost) into snmpd.conf & write snmphandle into snmptrapd.conf,
[2013/05/14 06:06:04] #net-snmp <SonicYouth> then I tried send_v2trap with "linkDown", but it tells me that's not a valid v2 trap oid - but snmptrap works. weird.
[2013/05/14 06:08:27] #net-snmp <SonicYouth> I found snmptrap cmd can work, but cannot send to all sinks; and from the doc I see send_v2trap can send trap to all, but I cannot use it. feel sad...
[2013/05/14 06:15:02] #net-snmp <SonicYouth> ah, rearrange the question:
[2013/05/14 06:18:31] #net-snmp <SonicYouth> if I want to use send_v2trap to send traps to the host list, then what should I do?
[2013/05/14 06:18:32] #net-snmp <SonicYouth> I've set trap2sink, trapcommunity in snmpd.conf, and authcommunity and default traphandle in snmptrapd.conf,
[2013/05/14 06:18:32] #net-snmp <SonicYouth> but after running send_easy_trap and send_v2trap, the handler doesn't execute... and cmd "snmptrap" works, what else should I do?
[2013/05/14 06:53:42] #net-snmp <SonicYouth> by the way, the fault in net-snmp doc still exists...
[2013/05/14 06:54:12] #net-snmp <rstory-work> SonicYouth: use agentxtrap to send traps to sinks from the command line..
[2013/05/14 06:55:39] #net-snmp <rstory-work> if you are trying to send traps from an app and want to got to sinks, you can either use agentx to connect to the master agent to send them for you, or you'd have to parse snmpd.conf yourself and build each trap to send in your code..
[2013/05/14 06:55:42] #net-snmp <SonicYouth> in the "snmp_session struct reference" it said "long timeout:  Number of uS until first timeout, then exponential backoff. ", but the unit of timeout should be ms
[2013/05/14 06:56:32] #net-snmp <SonicYouth> rstory-work: thanks again :) and I want to send traps to sink from C code
[2013/05/14 06:57:20] #net-snmp <SonicYouth> but I'll use agentxtraps to check... thanks in advance :)
[2013/05/14 07:04:10] #net-snmp <SonicYouth> rstory-work: carefully read reply again, so it means, if I don't use agentx, then the only way is to manually build trap pdu and send to sinks list?
[2013/05/14 07:04:10] #net-snmp <SonicYouth> if that's a more direct way, I'd like to do it :)
[2013/05/14 07:12:58] #net-snmp <rstory-work> SonicYouth: yes, the library code doesn't read sinks list, so yes, it's agentx or do it yourself..
[2013/05/14 07:22:19] #net-snmp <SonicYouth> ok, thank you :) then I'll do that on my own :P
[2013/05/14 08:30:35] #net-snmp <SonicYouth> rstory-work: what does "netsnmp_transport_open_client()" do? I think I can send trap pdu in a way like get pdu. but seems there're lots of differences
[2013/05/14 09:19:57] #net-snmp <rstory-work> have you looked at snmptrap.c to see how it's done there? netsnmp_transport_open_client sets up the sockets for communication..
[2013/05/14 17:55:46] #net-snmp <jesusaponte> hola
<-- jesusaponte has left #net-snmp
[2013/05/14 19:42:03] #net-snmp <SonicYouth> me again... :) hope you didn't bother. I think I can handle C trap now, but I have a question about agent design.
[2013/05/14 19:42:04] #net-snmp <SonicYouth> this time I just want to ask, if there's any timer in net-snmp for polling use, like updating values every 10 seconds.
[2013/05/14 19:42:34] #net-snmp <SonicYouth> (sorry, "you were not bothered" :(
[2013/05/14 19:54:54] #net-snmp <SonicYouth> I just find one - snmp_alarm, is that so?
[2013/05/14 20:20:10] #net-snmp <rstory-work> SonicYouth: i missed the context.. what are you asking?
[2013/05/14 20:21:10] #net-snmp <SonicYouth> rstory-work: is there any timer-like function in net-snmp :) if there's one, I'd like to use it in agent
[2013/05/14 20:23:47] #net-snmp <SonicYouth> rstory-work: I found snmp_alarm, but don't know if it could work in agent, hmm
[2013/05/14 20:24:36] #net-snmp <SonicYouth> (and the update method I use is using snmp_async_send for relay to retrieve clients datas
[2013/05/14 20:25:57] #net-snmp <rstory-work> yes, snmp_alarm is used a lot in snmpd
[2013/05/14 20:32:45] #net-snmp <SonicYouth> rstory-work: get it :) and, can I create another alarm in alarm cb function?
[2013/05/14 20:34:46] #net-snmp <SonicYouth> async send won't return immediately, so could mess up my timing, so I want to use 2-layer callback -
[2013/05/14 20:34:46] #net-snmp <SonicYouth> cb1(run in every 10s): register cb2 and return immediately;
[2013/05/14 20:35:06] #net-snmp <SonicYouth> cb2: real async send handler
[2013/05/14 20:36:07] #net-snmp <rstory-work> hmm.. that's a good question.. i'm not sure if that will work or not..
[2013/05/14 20:37:59] #net-snmp <SonicYouth> it worths trying I think :) I'll test it later, just after I finished writing trap handler :)