Re: Need help with snmptrapd command
Hemanth Kumar <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CAJx9mc45tz05rbDe9fko2eCQU2LRLwSTYiX-cvHC-_R8q1sgtA@mail.gmail.com> |
Alan, I did think about it but the issue with that approach is that it is MIB-version dependent. For SNMP-v1, you would have to send the command as "snmptrap -v 1 -c ......." and for SNMP-v2, it would be like "snmptrap -v 2c -c ...." ... I am interested in a generic solution -Hemanth On Tue, Jul 19, 2016 at 8:19 PM, Robson, Alan <[email protected]> wrote: > Maybe you could wrap the snmptrap executable in a shell script. > > > > ie. Make a shell script called snmptrap that reads in the commandline > variables and then calls the “real” snmptrap with the additional port > information added. Put the snmptrap shell script somewhere in the path > ahead of the real net-snmp executable. > > > > Alan > > > > *From:* Hemanth Kumar [mailto:[email protected]] > *Sent:* Tuesday, July 19, 2016 5:20 AM > *To:* [email protected] > *Subject:* Need help with snmptrapd command > > > > HI, > > I am trying to figure out a way by which I can send following trap command > without adding/mentioning the port number. The receiver is receiving the > trap when the custom port number is mentioned > snmptrap -v 2c -c rscommunity <DEST-IP-ADDRESS>:166 "" > TRAP-TEST-MIB::demotraps SNMPv2-MIB::sysLocation.0 s "some message" > > By default, the following command does not require the port number to be > mentioned when the snmptrapd is using the default port-161. > > snmptrap -v 2c -c rscommunity <DEST-IP-ADDRESS> "" > TRAP-TEST-MIB::demotraps SNMPv2-MIB::sysLocation.0 s "some message" > > Additional info: > > firewall opened for the above mentioned custom port > > SELINUX > > /etc/sysconfig/selinux has the following edit "SELINUX=disabled" > (essentially SELINUX is off) > > > > So far, I have been following the > http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.net-2Dsnmp.org_tutorial_tutorial-2D5_commands_snmptrap.html&d=CwMFaQ&c=jcv3orpCsv7C4ly8-ubDob57ycZ4jvhoYZNDBA06fPk&r=xN9AnMDZvO_QvUZQZcoply6WFqSJuNcpv-dDu2fA4Ac&m=syhCJx6f_QiHrEJ_3yynUp8lWw1ZVzUv30Y88ft2daM&s=TzXSUtOIyBeBB7JwGqpM1HwKyI5SA6cYhZ5As2wG8kc&e=> > to understand/test > > > > Test Bed > > 2xservers with NET-SNMP version: 5.7.2 on CentOS 7.2 > > Thanks in advance > > -Hemanth > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ 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