Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-14-2007, 06:15 AM   #1
LQ Newbie
Registered: Dec 2007
Posts: 1

Rep: Reputation: 0
snmpdtrapd configuration process

Dear All
I am noive in configuring snmp.I have managed the configuration process but now i am working in snmpdtrap. I am not getting idea about the snmpd configuration process.Can anybody suggest me
Old 12-14-2007, 08:48 AM   #2
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,494
Blog Entries: 2

Rep: Reputation: 68
What about a simple (yet functional) example ?

[root@agente86 ~]# more /etc/snmp/snmpdtrapd.conf 
authCommunity log,execute LiebertEM 
authCommunity log pfSense
traphandle default /bin/bash /usr/local/sbin/
In my network I have two sources of SNMP traps: a firewall and a no-break. The firewall is configured to send SNMP traps to this machine (agente86) using the community string "pfSense". The same with no-break, but using the community string "LiebertEM".

For both I want to log the traps.
For SNMP traps from no-break I want to analyze the SNMP trap and if it is just info messages (battery tests, for instances) I discard those messages. Otherwise I want to receive those messages by e-mail. To do that, I use the line "authCommunity log,execute LiebertEM" and traphandle line specifies the script which will decide if the received trap (in standart input) is test related or not. In the last case, it will basically send the msg by e-mail using the helper program traptoemail:
(I'm hiding the dirty details)

# if the community is not LiebertEM, exit.

#create a temporary file to store the input from snmptrap handler.
TMPFILE=$(mktemp /tmp/snmptraphandle.XXXXXXXXXX) || exit 1
# the output of snmptrap handler
cat > $TMPFILE

# if the message is test related, exit.
# (process/analyze the msg in $TMPFILE)
# else
# send the output to traptoemail
cat $TMPFILE | traphandle default /usr/bin/perl /usr/bin/traptoemail -s -f
You need to start the snmptrapd daemon and open the firewall ports to be able to receive the SNMP trap messages.
On the sources you need to specify the IP of the machine which is running the snmpttrapd.

I hope this can help you to start with snmptrap.

good luck !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
Need to install process at end of boot process ch485de Linux - Newbie 5 12-07-2006 05:47 PM
child process usses same amount of ram as parent process socialjazz Programming 7 10-19-2006 05:48 PM
SLACKWARE10.1-full process from (HardDisk)installation to configuration! zhy2111314 Slackware - Installation 2 08-07-2005 09:54 PM
Bash Scripting - child process affecting parent process mthaddon Linux - General 1 05-02-2004 01:19 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration