Page 1 of 3

SNMP Traps

Posted: Wed Jan 25, 2017 12:12 pm
by orani
Can anybody help configuring the SNMP traps at nagios core?

Re: SNMP Traps

Posted: Wed Jan 25, 2017 1:29 pm
by dwhitfield
Have you looked at https://assets.nagios.com/downloads/nag ... ptrap.html ? If so, where are you getting hung up?

Re: SNMP Traps

Posted: Wed Jan 25, 2017 1:37 pm
by orani
i tried using SNMPTT but with no success.

these are my definitions

Code: Select all

  GNU nano 2.0.9                                                                     File: test.cfg                                                                                                                                                

define host{
        host_name       testcoreapp2
        address         10.0.5.12
        contacts        nagiosadmin,systemadmin
        check_command check-host-alive
        max_check_attempts      5
        check_interval          1
        retry_interval          1
        parents SMCSW
        check_period            24x7
        hostgroups KDS PHYSICAL SERVERS
        statusmap_image rack-server.gd2
        notification_interval   0
        notification_options    d,u,r,s
        notification_period     24x7
}



define service{
        name                    trap-service
        use                     generic-service
        register                0
        is_volatile             1
        check_command           check-host-alive     ;Used to reset the status to OK when 'Schedule an immediate check of this service' is selected
        flap_detection_enabled  0                    ; Flap detection is disabled
        process_perf_data       0                    ; Do not Process performance data
        max_check_attempts      1
        normal_check_interval   1
        retry_check_interval    1
        passive_checks_enabled  1
        active_checks_enabled   0                    ; Prevent active checks from occuring as we are only using passive checks
        check_period            none
        notification_interval   31536000
        notification_options    w,u,c                ; Notify on warning, unknown and critical
        contact_groups          admins
}

define service{
        use                     trap-service
        service_description     Trap1
        host_name          testcoreapp2
}


but what shoyld be the configuration for snmp conf files?

Re: SNMP Traps

Posted: Wed Jan 25, 2017 5:47 pm
by avandemore
What do you mean no success? Do you see traps in the logs? If so, please post them and any other errors you see. Otherwise we have very little information to go on.

Re: SNMP Traps

Posted: Wed Jan 25, 2017 6:35 pm
by orani
Ok. i need help giving you the proper and more information.

Where are the logs stored? What logs do you mean?

Re: SNMP Traps

Posted: Thu Jan 26, 2017 2:21 pm
by dwhitfield
/usr/local/nagios/var/nagios.log is one log that could shed some light.

Also

Code: Select all

/var/log/snmptt/
/var/spool/snmptt
Please post your snmptt.ini and snmptt.conf (probably in /etc/snmp/)

What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.

Re: SNMP Traps

Posted: Thu Jan 26, 2017 5:15 pm
by orani
See attachments

Re: SNMP Traps

Posted: Thu Jan 26, 2017 5:16 pm
by orani
See attachments

Re: SNMP Traps

Posted: Thu Jan 26, 2017 5:38 pm
by dwhitfield
I can only find reference to the error message you are getting from 2005 and 2006, so just for a sanity check, I am going to re-ask a couple of questions. What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.

It's possible the device is just old, but I just want to be sure.

I'm seeing errors associated with DataBS2. It looks like a lot of things are working. Are any of your SNMP traps working? Is SNMP in general working?

Re: SNMP Traps

Posted: Thu Jan 26, 2017 6:05 pm
by orani
Centos 6.8 and Nagios Core 4.2.0 compiled form source.

Device is not too old.

I can poll anything with snmp from any device in my network. But when i try to set snmp traps i cant. I use the scripts i posted before and my snmp conf is that i attached to you but when i send a test trap nothing appears at nagios web interface.