LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-22-2014, 10:34 PM   #1
dd-linux
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Rep: Reputation: Disabled
Problem in understanding and configuring SNMPTT in CentOS


Hi,

I am monitoring a linux server using Nagios and I am trying to receive SNMP Traps from the monitored linux server to the monitoring server. So the details are as follows:

monitored server : CentOS 5, where NRPE agent is configured
monitoring server : CentOS 6, where Nagios is configured

I am using SNMPTT and my question is, where should the SNMPTT be configured? Is it in my monitored server or in my monitoring server where my Nagios is configured?

Please pardon me for my stupid question. I am trying to understand and learn. So any help will be appreciated.

Thanks.
-D

Last edited by dd-linux; 10-23-2014 at 05:11 AM.
 
Old 10-22-2014, 11:23 PM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
SNMPTT will help you to handle traps and format it in human readable format
http://www.snmptt.org/about.shtml
read this link for more information.

you need to configure your Server snmpd to generate snmptraps..
 
Old 10-22-2014, 11:55 PM   #3
dd-linux
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Unhappy

Hi kirukan,

Thanks for your reply.

To be more specific on your comment, do I need to have snmpd and SNMPTT both installed in my monitored server (CentOS 5) where the SNMP Trap will be generated and passed on to SNMPTT which will then send the trap to my monitoring server(CentOS 6 with Nagios configured in it) ?

Or, only snmpd is required to be configured in my monitored server (CentOS 5) to generate and send the SNMP traps which will be received by SNMPTT configured in the monitoring server(CentOS 6 with Nagios configured in it)?

To put it more simply, Should it be

(managed device with agent, snmpd, snmptt) =======> ( management server, nagios)

or,

(managed device with agent,snmpd) =======> (management server, snmptt, nagios)

where, '=======>' indicates SNMP Trap

Can you please elaborate a bit and be more specific in terms of monitoring or monitored server in context to my post to help me understand?


I have been going through all possible documents but I cannot seem to just get it.

Thanks for your help.

-D

Last edited by dd-linux; 10-23-2014 at 12:03 AM.
 
Old 10-23-2014, 02:12 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
(managed device with agent,snmpd) =======> (management server, snmptt, nagios)

if you receive snmptraps its only contains OID's/text_format and corresponding values for that OID's, so you can use the snmptt to format those traps in some human understandable format and send it to different sources.


No matter where you run the daemon's but if you say the other side is your NMS then you can run snmptt there and collect all the snmptraps from different sources.
 
Old 10-24-2014, 04:22 AM   #5
dd-linux
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you kirukan for your reply.

So I have snmpd running in my monitored server and I am trying to send a SNMP TRAP to my NMS where snmptrapd and SNMPTT is running but I am not receiving any traps.
I followed this link http://askaralikhan.blogspot.hk/2010...48941610174595 to set my NMS up. Do you reckon what could be the reason?

Thanks so much for your help.

-D
 
Old 10-26-2014, 09:24 AM   #6
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
Not sure how you configured the snmpd, post your snmpd.conf, snmptrapd.conf and snmptt.conf
 
Old 10-30-2014, 01:18 AM   #7
dd-linux
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi kirukan,

Now I have been able to receive SNMP traps in my monitoring host. I can view the received traps in /var/log/messages as well as in /var/log/snmptt/snmptt.log. But the service TRAP is not turning to the WARNING state as it should be after receiving a trap in Nagios neither am I getting any trap alerts. Though I can receive other service alerts.

I am in dire need of some help.

My services.cfg looks like this:

define service {
use generic-service
register 0
check_period 24x7
max_check_attempts 1
normal_check_interval 15
retry_check_interval 5
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 315360000
notification_period 24x7
notification_options w,u,c,r
notifications_enabled 1
event_handler_enabled 1
is_volatile 1
}


define service {
use generic-service
name snmptrap-service1
register 0
service_description TRAP
is_volatile 1
check_command check-host-alive
flap_detection_enabled 0
process_perf_data 0
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
retry_check_interval 1
passive_checks_enabled 1
check_period 24x7
notification_interval 315360000
}

define service{
use snmptrap-service1
host_name XYZ
service_description TRAP
contact_groups admins
}

My hosts.cfg :

## Default Linux Host Template ##
define host{
name linux-box1 ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}

## Default
define host{
use linux-box1 ; Inherit default values
host_name XYZ ; The name we are giving to this server
alias xyz
address xxx.xxx.xxx.xxx
passive_checks_enabled 1
}

snmptt.conf

#
EVENT psAlarmNoDirectoryRequesterProtocolSpecified .1.3.6.1.4.1.23372.1.1.0.1000 "Status Events" Normal
FORMAT A psAlarmNoDirectoryRequesterProtocolSpecified trap $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" " A device has failed"
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "A psAlarmNoDirectoryRequesterProtocolSpecified trap $*"
SDESC
A psAlarmNoDirectoryRequesterProtocolSpecified trap
signifies that no proper directory access protocol,
e.g. ldap, specified which result in unable to request
directory server
EDESC
#
#
#
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "A psAlarmNoInitialContextFactorySpecified trap signifies $*"
SDESC
A psAlarmNoInitialContextFactorySpecified trap signifies
that no directory factory class specified, e.g.
com.sun.jndi.ldap.LdapCtxFactory
EDESC
#
#
#
EVENT psAlarmMalformedDirectoryURL .1.3.6.1.4.1.23372.1.1.0.1002 "Status Events" Normal
FORMAT A psAlarmMalformedDirectoryURL trap signifies that the $*
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "A psAlarmMalformedDirectoryURL trap signifies that the $*"
SDESC
A psAlarmMalformedDirectoryURL trap signifies that the
directory access universal resource location is not
constructed properly
EDESC

........ etc.

snmptrapd.conf

traphandle default /usr/sbin/snmptt
disableAuthorization yes
donotlogtraps yes

~
/var/log/snmp/snmptt.log

hu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
Thu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
Thu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
Thu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
Thu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
Thu Oct 30 11:17:57 2014 .1.3.6.1.4.1.23372.1.1.1000 Normal "Status Events" XYZ - A notifyNoDirectoryRequesterProtocolSpecified trap test is on
~
~
~
~
~
"snmptt.log" 6L, 91

Please any help to fix this would be appreciated. I cannot figure out where I am going wrong.
Thanks so much.
-D
 
Old 10-30-2014, 04:48 AM   #8
dd-linux
LQ Newbie
 
Registered: Oct 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Unhappy

I think this is where my problem lies in, I cannot execute the following submit_check_result command in my CLI

/usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "A psAlarmNoDirectoryRequesterProtocolSpecified trap $*"

It says, bash: /usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1 "A psAlarmNoDirectoryRequesterProtocolSpecified trap $*" : Permission denied

Last edited by dd-linux; 10-30-2014 at 04:55 AM.
 
  


Reply


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
Need Help with SNMPTT and NAGIOS config - working, but not quite ;) kcleveland Linux - Software 10 05-30-2015 03:30 AM
Nagios with SNMPTT MPIvan Linux - General 0 12-04-2013 04:45 PM
help understanding ln dr_zayus69 Linux - General 3 01-14-2005 09:33 PM
A better understanding! nny0000 Slackware 1 04-14-2004 01:01 PM
Understanding X?? ++ bdp Linux - General 2 02-25-2004 06:47 PM


All times are GMT -5. The time now is 08:17 AM.

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