SNMPTT and Nagios Alerting

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
twelsh37
Posts: 2
Joined: Fri Oct 10, 2014 3:33 am

SNMPTT and Nagios Alerting

Post by twelsh37 »

Hi All,

Nagios - 4.0.7
OS - Redhat Enterprise 5.9
SNMPTT - v1.4beta2

I have just installed SNMPTT on my Test Nagios server and wish to use it to reiceve snmptraps and pass them into Nagios. As far as I can see I have set up everything correctly but I am not seeing the alerts coming into Nagios. The Traps do arrive in the Nagios server in the snmptt.log

Here are the log entries in /var/log/snmp/snmptt.log

Code: Select all

[root@PSVUK2LNAC002 snmptt]# cat snmptt.log.2
Wed Oct 15 10:52:49 2014 .1.3.6.1.4.1.24117.1.2.0.99 Normal "Status Events" sqlhost - This is a test message triggered from the Idera SQLdm  product for Microsoft SQL Server. This is a test SNMP Trap from the SQLdm product.
Wed Oct 15 10:56:11 2014 .1.3.6.1.4.1.24117.1.2.0.99 Normal "Status Events" sqlhost - This is a test message triggered from the Idera SQLdm  product for Microsoft SQL Server. This is a test SNMP Trap from the SQLdm product.
Here is the config for /etc/snmp/snmptrapd.conf

Code: Select all

traphandle default /usr/sbin/snmptt
disableAuthorization yes
donotlogtraps  yes
I have set up my host definition as such

db-hosts.cfg

Code: Select all

define host{
		host_name               sqlhost
		use                     sql_hosts
		alias                   sqlhost
		address                 sqlhost
		passive_checks_enabled	1
       }

/usr/local/nagios/etc/objects/services.cfg

Code: Select all

define service{
        name                    SNMP_TRAP
        use                     base-service
        service_description     SNMP_TRAP
        process_perf_data       0
        obsess_over_service     0
        notifications_enabled   0
		flap_detection_enabled	0
        is_volatile             1
        max_check_attempts      1
        normal_check_interval   1
        retry_check_interval    1
        contact_groups          admins
	icon_image              	snmp.png
	icon_image_alt          	SNMP
        register                0
}
/usr/local/nagios/etc/objects/dba/db-services.cfg

Code: Select all

define service{
	use							SNMP_TRAP
	name						TRAP
	service_description		   	TRAP
	host_name					sqlhost
	check_command				check-host-alive
	active_checks_enabled	    0
	passive_checks_enabled	    1
	check_period			  	24x7
	notification_interval	 	31536000
	notification_period		    24x7
	notification_options	    w,u,c
	notifications_enabled	    1
}
My snmptt.ini contains the following

Code: Select all

[General]
snmptt_system_name = nagios
mode = standalone
multiple_event = 1
dns_enable = 1
strip_domain = 1
strip_domain_list = <<END
domain.com
END

resolve_value_ip_addresses = 0
net_snmp_perl_enable = 0
net_snmp_perl_cache_enable = 1
net_snmp_perl_best_guess = 2
translate_log_trap_oid = 0
translate_value_oids = 1
translate_enterprise_oid_format = 1
translate_trap_oid_format = 1
translate_varname_oid_format = 1
translate_integers = 1
mibs_environment = ALL
wildcard_expansion_separator = " "
allow_unsafe_regex = 0
remove_backslash_from_quotes = 0
dynamic_nodes = 0
description_mode = 0
description_clean = 1
threads_enable = 0
threads_max = 10

[DaemonMode]
daemon_fork = 1
daemon_uid = snmptt
pid_file = /var/run/snmptt.pid
spool_directory = /var/spool/snmptt/
sleep = 5
use_trap_time = 1
keep_unlogged_traps = 1
duplicate_trap_window = 0

[Logging]
stdout_enable = 0
log_enable = 1
log_file = /var/log/snmptt/snmptt.log
log_system_enable = 1
log_system_file = /var/log/snmptt/snmpttsystem.log
unknown_trap_log_enable = 0
unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log
statistics_interval = 0
syslog_enable = 0
syslog_facility = local0
syslog_level_debug = <<END
END
syslog_level_info = <<END
END
syslog_level_notice = <<END
END
syslog_level_warning = <<END
END
syslog_level_err = <<END
END
syslog_level_crit = <<END
END
syslog_level_alert = <<END
END
syslog_level = warning
syslog_system_enable = 1
syslog_system_facility = local0
syslog_system_level = warning

[Exec]
exec_enable = 1
pre_exec_enable = 1
unknown_trap_exec =
unknown_trap_exec_format =
exec_escape = 1

[Debugging]
DEBUGGING = 0
DEBUGGING_FILE = /var/log/snmptt/snmptt.debug
DEBUGGING_FILE_HANDLER = /var/log/snmptt/snmptthandler.debug

[TrapFiles]
snmptt_conf_files = <<END
/etc/snmp/snmptt.conf
END
can anyone spot what i have done wrong? im pulling my hair out here.

Cheers

Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMPTT and Nagios Alerting

Post by sreinhardt »

How old is this system? I ask because it might be easier to start fresh for this one. NSTI 1.4 is about 3+ years old and should not be used. 3.0.2 is the current actively developed version, and is what should be used on your system. I would highly suggest removing the snmptt mysql databases, packages, and configs, and finally remove nsti 1.4 fully as there is no direct upgrade path. Once that is completed or you start with a new system, please follow the link below to install 3.0.2. Otherwise most of your configs look pretty good, I have a comment on your trapd config, but let's get you to a current version and work on it from there!

http://nagiosenterprises.github.io/nsti ... ation.html
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
twelsh37
Posts: 2
Joined: Fri Oct 10, 2014 3:33 am

Re: SNMPTT and Nagios Alerting

Post by twelsh37 »

Thanks for the reply Sreinhardt.

The system is a fully patched Redhat enterprise 5.9
Nagios 4.0.7.

I don't use NSTI yet. I use NRPE on all our servers but this is irrelevant as our SQL system sends SNMPTRAPS to the Nagios host system.
MySQL is nowhere in the equation.

As i said I see the alerts getting to the Nagios box but nothing comes from the SNMPTT into nagios itself.

Regards

Tom
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: SNMPTT and Nagios Alerting

Post by sreinhardt »

My mistake, I must have thought this was an nsti post. Regardless, most of your stuff looks pretty good, there are a few changes here and there I would suggest, but the script in the document below covers all of the changes I would have made. I realize the document states for XI specifically, but the snmptt and core integration is identical between both systems, and the script was intentionally made as agnostic as possible.

http://assets.nagios.com/downloads/nagi ... ith_XI.pdf

Aside from things this script will resolve, could we see your snmptt.conf? I have a feeling its an issue between that, and the "donotlogtraps yes" in snmptrapd.conf, of which I am not sure what that will actually do to your system.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked