8 Replies Latest reply on Feb 23, 2010 5:35 PM by Peter Johnson

    SNMP Adaptor on Linux

    Marcelo Leite Newbie

      Hello there...

       

      I am using the SNMP Adaptor to send some traps to a external SNMP Server. Based on some business rules i create a trap and send it to the configured server (managers.xml).

       

      From my dev machine (MAC OSX) it works and i can see the trap being received in SNMP Server. But from my test server (RHEL) it does not work. The trap is not received by SNMP server.

       

      Is there any special config related to Linux OS? The firewall is configured to accept all INPUT/OUTPUT.

       

      Any tips?

       

      Best regards.

      MLeite

        • 1. Re: SNMP Adaptor on Linux
          Peter Johnson Master
          Is SELinux running on the RHEL box? If so, disable it and try again. You might also try stopping the firewall, sometimes even when you allow all traffic things can be blocked.
          • 2. Re: SNMP Adaptor on Linux
            Marcelo Leite Newbie

            Hi Peter, thanks for your reply.

             

            I did what you have suggested, but it still does not work.

             

            Any more ideas?

             

            Cheers, ML

            • 3. Re: SNMP Adaptor on Linux
              Peter Johnson Master

              Do you know which port is used by SNMP? If so, ssh to the RHEL box and run (assuming port 161):

               

              telnet snmp-host-name 161

               

              If the connection is refused, then there is a network issue (possibly with a switch) and you will have to talk with the network admin.

               

              If the above telnet doesn't work, thry pinginmg and telnetting from the RHEL box to other locations, that might give a clue as to the cause.

               

              Finally, is there some kind of configuration in the SNMP server that allows/blocks network access?

              • 4. Re: SNMP Adaptor on Linux
                David Lloyd Master
                SNMP generally uses UDP, not TCP, so telnet won't do the job.  Netcat might do better, though there's no guarantee that you'll get an ICMP refusal message if communications fail - more likely the packets will just disappear.
                • 5. Re: SNMP Adaptor on Linux
                  Marcelo Leite Newbie

                  Hello men...

                   

                  Thanks you both ...

                   

                  Peter, the SNMP Server Port is 162

                   

                  Running the Telnet command you suggested, i really get the message "connection refused", but this same message is showed if i run the command from my dev machine, the one where i am able to send TRAPs do the SNMP server.

                   

                  Ping commands run properly from RHEL Box, even to the SNMP Server.

                   

                  This SNMP Server is a simple test server, that is, a simple Win machine running the Net-SNMP Trap Handler.

                   

                  Regarding to allows/blocks network access, this server is completely opened.

                   

                   

                  David, i am using the WireShark to watch the messages arriving in server. Using the tool you suggested, i tried:
                  nc <ip_address> <port>. This command has no answer, but i can see the request arriving in server through Wireshark and a response (like a connection refused) being sent back to the RHEL Box.

                  But if i use the parameter -u (UDP), i can connect no the SNMP server and send messages, it appears in Wireshark.

                   

                  As i am still working on the module development, i configured the managers.xml to send the TRAPs to 2 servers. One is that one i said and the other is the TrapdService. The TRAP is seen in logs generated by TrapdService, but does not appear in SNMP Server.

                   


                  If you have any other ideas!
                  Thanks in advance, ML

                  • 6. Re: SNMP Adaptor on Linux
                    Dimitris Andreadis Master

                    I suppose you have changed the default ports? AFAIR it sends the traps to 1162 (not 162)

                     


                      <manager>
                        <address>localhost</address>
                        <port>1162</port>
                        <local-address></local-address>
                        <local-port></local-port>
                        <version>1</version>
                      </manager>
                    
                    • 7. Re: SNMP Adaptor on Linux
                      Marcelo Leite Newbie

                      Hello men...

                       

                      Solution: It was not related to firewall, ports or something like that. Because JBoss by default starts binding the services to 127.0.0.1, i was starting it using 0.0.0.0 to bind to all interfaces and allow remote access. This idea works for MacOSx and Win, but does not work for RHEL Box.

                       

                      To put the SNMP TRAP sending to work i have started JBoss binding services to RHEL Box ip address.

                       

                      Now it is working fine.

                       

                      Thanks, cheers.

                      ML

                      • 8. Re: SNMP Adaptor on Linux
                        Peter Johnson Master
                        In that case you might want to check that your /etc/hosts file is properly configured. I have found this page to be helpful:

                        http://jblevins.org/computing/linux/hostname