<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">To be completely honest, that script is something like 15 years old, and I don’t think it’s been updated in that time. It’s mostly still there to just provide an example of how to handle snmpd traps, and a case could be made that it doesn’t belong in the docs at this point anyway.<div class=""><br class=""></div><div class="">I would suggest reading the snmpd docs on writing handler scripts.<br class=""><div class=""><br class=""></div><div class="">Quentin</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 14, 2019, at 8:09 AM, Simon Jones <<a href="mailto:batmanustc@gmail.com" class="">batmanustc@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">I'm following this to handle snmp trap: <a href="http://docs.frrouting.org/en/latest/snmp.html" class="">http://docs.frrouting.org/en/latest/snmp.html</a></div><div class=""><br class=""></div><div class="">this is /etc/snmp/snmptrapd.conf:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">traphandle .3.6.1.2.1.15 /etc/snmp/snmptrap_handle.sh </blockquote><div class=""><br class=""></div><div class="">this is snmptrap_handle.sh:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">echo "test" > temp.txt</blockquote><div class=""><br class=""></div><div class="">and snmptrapd got SNMP trap like this:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">root@NX-ZWYC-M1F202-A16-HW6865-A-INT-212:/# snmptrapd -f -Lo<br class="">NET-SNMP version 5.7.3<br class="">2019-08-14 11:53:50 172.18.8.212(via UDP: [127.0.0.1]:34916->[127.0.0.1]:162) TRAP, SNMP v1, community public<br class=""> iso.3.6.1.2.1.15 Enterprise Specific Trap (2) Uptime: 2:11:33.09<br class=""> iso.3.6.1.2.1.15.3.1.14.192.168.10.9 = Hex-STRING: 06 02 iso.3.6.1.2.1.15.3.1.2.192.168.10.9 = INTEGER: 6<br class="">2019-08-14 11:54:04 172.18.8.212(via UDP: [127.0.0.1]:34916->[127.0.0.1]:162) TRAP, SNMP v1, community public<br class=""> iso.3.6.1.2.1.15 Enterprise Specific Trap (1) Uptime: 2:11:47.10<br class=""> iso.3.6.1.2.1.15.3.1.14.192.168.10.9 = Hex-STRING: 06 02 iso.3.6.1.2.1.15.3.1.2.192.168.10.9 = INTEGER: 6<br class="">2019-08-14 11:57:39 172.18.8.212(via UDP: [127.0.0.1]:34916->[127.0.0.1]:162) TRAP, SNMP v1, community public<br class=""> iso.3.6.1.2.1.15 Enterprise Specific Trap (2) Uptime: 2:15:22.90<br class="">iso.3.6.1.2.1.15.3.1.14.192.168.10.9 = Hex-STRING: 06 02 iso.3.6.1.2.1.15.3.1.2.192.168.10.9 = INTEGER: 6 </blockquote><div class=""><br class=""></div><div class="">But snmptrap_handle.sh does not work, as there is no temp.txt.</div><div class=""><br class=""></div><div class="">So why ?</div><div class=""><br class=""></div><div class="">BTW, this is also not work<br class=""></div><div class=""><div class="">/etc/snmp/snmptrapd.conf:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">traphandle <span class="gmail-o" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(102,102,102)">.</span><span class="gmail-mf" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(32,128,80)">1.3</span><span class="gmail-o" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(102,102,102)">.</span><span class="gmail-mf" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(32,128,80)">6.1</span><span class="gmail-o" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(102,102,102)">.</span><span class="gmail-mf" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(32,128,80)">4.1</span><span class="gmail-o" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(102,102,102)">.</span><span class="gmail-mf" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(32,128,80)">3317.1</span><span class="gmail-o" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(102,102,102)">.</span><span class="gmail-mf" style="font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px;box-sizing:border-box;color:rgb(32,128,80)">2.2</span> /etc/snmp/snmptrap_handle.sh <br class=""></blockquote></div><br clear="all" class=""><div class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">----</div>Simon Jones</div></div></div></div></div></div>
_______________________________________________<br class="">frog mailing list<br class=""><a href="mailto:frog@lists.frrouting.org" class="">frog@lists.frrouting.org</a><br class="">https://lists.frrouting.org/listinfo/frog<br class=""></div></blockquote></div><br class=""></div></div></body></html>