How to trigger the sending of a v2 trap
"liuying" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Dear:
I have a problem about how to trigger the sending of a V2 trap
In the program,Iuse:
$snmpset -v2c -c private localhost snmptrap.0 i 1
Then,it can send a trap to the destination ip.
Or I test like this, In the var_snmp:
case OLTFIRMWAREVER:
*var_len = sizeof(oltfirmwareVer);
write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0); //test sending trap
return (u_char *) oltfirmwareVer;
case CHIPNEWERFIRMWAREVER:
*var_len = sizeof(g_olt_dev.chipNewerFirmwareVer_tmp);
return (u_char *) g_olt_dev.chipNewerFirmwareVer_tmp;
When I use the snmpget commond :snmpget -v2c -c private localhost oltfirmwareVer.0
It can also send a v2 trap.
But all these are not what I need.I want to send a trap when the trapflag=1.
I use this in my main funcation :
if(trapflag==1)
{
write_exampletrap2(COMMIT,NULL,0,0,NULL,NULL,0);
}
There are some errors. It returns:
$ No log handling enabled - turning on stderr logging
send_trap: no v2 trapOID varbind provided
What can I do to solve the problem?
Looking forward for your help!Thanks!
===================================================
刘盈
中国电力科学研究院 通信与用电技术分公司 通信业务部
电话:010-62937070-657
传真:010-62937070-662
地址:北京市海淀区西小口路东升科技园北领地D-3座215室
邮编:100192
===================================================
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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