How to configure snmptrapd to process incoming traps from a Juniper device?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















I have a CentOS server (7.2). I am trying to configure this as a SNMP trap receiver.



In my snmptrapd configuration, I am calling a very basic shell script just to identify if the trap was received:



[root@centos-Main snmp]# cat /etc/snmp/snmptrapd.conf
authCommunity log,execute,net public
traphandle default /etc/snmp/mydummyhandler.sh


This is what mydummyhandler.sh looks like:



[root@centos-Main snmp]# cat mydummyhandler.sh
echo "Trap Received" >> /var/log/snmptraplog.txt


But when traps are sent from the Juniper router, my snmptrapd doesn't process it and does not write anything to /var/log/snmptraplog.txt.



I sent few test traps from localhost itself and it is completely working as expected. Further, to check this, I tried sending a test trap from another CentOS server like below:



snmptrap -v 2c -c public centos-Main .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 
> ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1


and it was processed as expected too:



[root@centos-Main snmp]# cat /var/log/snmptraplog.txt
Trap Received


I ran a tcpdump on port 162 of trap receiver server and found that the traps sent from Juniper switch is reaching the server. But for some reason, it is silently ignoring the incoming traps from the Juniper device without further processing.



Here is what I see when traps are sent from Juniper device:



[root@centos-Main snmp]# tcpdump -i enp0s3 port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
16:54:14.521820 IP 192.168.0.91.58376 > centos-Main.snmptrap: C=VINOD V2Trap(217) system.sysUpTime.0=1768202 S:1.1.4.1.0=E:2636.4.13.0.1 E:2636.3.37.1.1.0="'Event-Trap'" E:2636.3.37.1.2.1.2.1="'event'" E:2636.3.37.1.2.1.3.1="''" E:2636.3.37.1.2.1.2.2="'message'" E:2636.3.37.1.2.1.3.1="''" S:1.1.4.3.0=E:2636.1.1.1.2.1


Also, for comparison I am pasting the tcpdump output of successful trap reception from another server:



[root@centos-Main snmp]# tcpdump -i enp0s3 port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
16:53:23.272673 IP 192.168.0.105.49182 > centos-Main.snmptrap: V2Trap(87) S:1.1.4.1.0=S:1.1.5.3 interfaces.ifTable.ifEntry.ifIndex=2 interfaces.ifTable.ifEntry.ifAdminStatus=1 interfaces.ifTable.ifEntry.ifOperStatus=1


Please help me.










share|improve this question


























    3















    I have a CentOS server (7.2). I am trying to configure this as a SNMP trap receiver.



    In my snmptrapd configuration, I am calling a very basic shell script just to identify if the trap was received:



    [root@centos-Main snmp]# cat /etc/snmp/snmptrapd.conf
    authCommunity log,execute,net public
    traphandle default /etc/snmp/mydummyhandler.sh


    This is what mydummyhandler.sh looks like:



    [root@centos-Main snmp]# cat mydummyhandler.sh
    echo "Trap Received" >> /var/log/snmptraplog.txt


    But when traps are sent from the Juniper router, my snmptrapd doesn't process it and does not write anything to /var/log/snmptraplog.txt.



    I sent few test traps from localhost itself and it is completely working as expected. Further, to check this, I tried sending a test trap from another CentOS server like below:



    snmptrap -v 2c -c public centos-Main .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 
    > ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1


    and it was processed as expected too:



    [root@centos-Main snmp]# cat /var/log/snmptraplog.txt
    Trap Received


    I ran a tcpdump on port 162 of trap receiver server and found that the traps sent from Juniper switch is reaching the server. But for some reason, it is silently ignoring the incoming traps from the Juniper device without further processing.



    Here is what I see when traps are sent from Juniper device:



    [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
    16:54:14.521820 IP 192.168.0.91.58376 > centos-Main.snmptrap: C=VINOD V2Trap(217) system.sysUpTime.0=1768202 S:1.1.4.1.0=E:2636.4.13.0.1 E:2636.3.37.1.1.0="'Event-Trap'" E:2636.3.37.1.2.1.2.1="'event'" E:2636.3.37.1.2.1.3.1="''" E:2636.3.37.1.2.1.2.2="'message'" E:2636.3.37.1.2.1.3.1="''" S:1.1.4.3.0=E:2636.1.1.1.2.1


    Also, for comparison I am pasting the tcpdump output of successful trap reception from another server:



    [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
    16:53:23.272673 IP 192.168.0.105.49182 > centos-Main.snmptrap: V2Trap(87) S:1.1.4.1.0=S:1.1.5.3 interfaces.ifTable.ifEntry.ifIndex=2 interfaces.ifTable.ifEntry.ifAdminStatus=1 interfaces.ifTable.ifEntry.ifOperStatus=1


    Please help me.










    share|improve this question
























      3












      3








      3


      0






      I have a CentOS server (7.2). I am trying to configure this as a SNMP trap receiver.



      In my snmptrapd configuration, I am calling a very basic shell script just to identify if the trap was received:



      [root@centos-Main snmp]# cat /etc/snmp/snmptrapd.conf
      authCommunity log,execute,net public
      traphandle default /etc/snmp/mydummyhandler.sh


      This is what mydummyhandler.sh looks like:



      [root@centos-Main snmp]# cat mydummyhandler.sh
      echo "Trap Received" >> /var/log/snmptraplog.txt


      But when traps are sent from the Juniper router, my snmptrapd doesn't process it and does not write anything to /var/log/snmptraplog.txt.



      I sent few test traps from localhost itself and it is completely working as expected. Further, to check this, I tried sending a test trap from another CentOS server like below:



      snmptrap -v 2c -c public centos-Main .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 
      > ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1


      and it was processed as expected too:



      [root@centos-Main snmp]# cat /var/log/snmptraplog.txt
      Trap Received


      I ran a tcpdump on port 162 of trap receiver server and found that the traps sent from Juniper switch is reaching the server. But for some reason, it is silently ignoring the incoming traps from the Juniper device without further processing.



      Here is what I see when traps are sent from Juniper device:



      [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
      16:54:14.521820 IP 192.168.0.91.58376 > centos-Main.snmptrap: C=VINOD V2Trap(217) system.sysUpTime.0=1768202 S:1.1.4.1.0=E:2636.4.13.0.1 E:2636.3.37.1.1.0="'Event-Trap'" E:2636.3.37.1.2.1.2.1="'event'" E:2636.3.37.1.2.1.3.1="''" E:2636.3.37.1.2.1.2.2="'message'" E:2636.3.37.1.2.1.3.1="''" S:1.1.4.3.0=E:2636.1.1.1.2.1


      Also, for comparison I am pasting the tcpdump output of successful trap reception from another server:



      [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
      16:53:23.272673 IP 192.168.0.105.49182 > centos-Main.snmptrap: V2Trap(87) S:1.1.4.1.0=S:1.1.5.3 interfaces.ifTable.ifEntry.ifIndex=2 interfaces.ifTable.ifEntry.ifAdminStatus=1 interfaces.ifTable.ifEntry.ifOperStatus=1


      Please help me.










      share|improve this question














      I have a CentOS server (7.2). I am trying to configure this as a SNMP trap receiver.



      In my snmptrapd configuration, I am calling a very basic shell script just to identify if the trap was received:



      [root@centos-Main snmp]# cat /etc/snmp/snmptrapd.conf
      authCommunity log,execute,net public
      traphandle default /etc/snmp/mydummyhandler.sh


      This is what mydummyhandler.sh looks like:



      [root@centos-Main snmp]# cat mydummyhandler.sh
      echo "Trap Received" >> /var/log/snmptraplog.txt


      But when traps are sent from the Juniper router, my snmptrapd doesn't process it and does not write anything to /var/log/snmptraplog.txt.



      I sent few test traps from localhost itself and it is completely working as expected. Further, to check this, I tried sending a test trap from another CentOS server like below:



      snmptrap -v 2c -c public centos-Main .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 
      > ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1


      and it was processed as expected too:



      [root@centos-Main snmp]# cat /var/log/snmptraplog.txt
      Trap Received


      I ran a tcpdump on port 162 of trap receiver server and found that the traps sent from Juniper switch is reaching the server. But for some reason, it is silently ignoring the incoming traps from the Juniper device without further processing.



      Here is what I see when traps are sent from Juniper device:



      [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
      16:54:14.521820 IP 192.168.0.91.58376 > centos-Main.snmptrap: C=VINOD V2Trap(217) system.sysUpTime.0=1768202 S:1.1.4.1.0=E:2636.4.13.0.1 E:2636.3.37.1.1.0="'Event-Trap'" E:2636.3.37.1.2.1.2.1="'event'" E:2636.3.37.1.2.1.3.1="''" E:2636.3.37.1.2.1.2.2="'message'" E:2636.3.37.1.2.1.3.1="''" S:1.1.4.3.0=E:2636.1.1.1.2.1


      Also, for comparison I am pasting the tcpdump output of successful trap reception from another server:



      [root@centos-Main snmp]# tcpdump -i enp0s3 port 162
      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
      listening on enp0s3, link-type EN10MB (Ethernet), capture size 65535 bytes
      16:53:23.272673 IP 192.168.0.105.49182 > centos-Main.snmptrap: V2Trap(87) S:1.1.4.1.0=S:1.1.5.3 interfaces.ifTable.ifEntry.ifIndex=2 interfaces.ifTable.ifEntry.ifAdminStatus=1 interfaces.ifTable.ifEntry.ifOperStatus=1


      Please help me.







      centos trap snmp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 18 '17 at 12:46









      VinodVinod

      6929




      6929




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f359671%2fhow-to-configure-snmptrapd-to-process-incoming-traps-from-a-juniper-device%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f359671%2fhow-to-configure-snmptrapd-to-process-incoming-traps-from-a-juniper-device%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay