Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Sep 22, 2018 1:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: thold v1.0.3 not sending snmp traps
PostPosted: Fri Feb 23, 2018 5:25 pm 
Offline

Joined: Fri Jan 06, 2012 1:52 pm
Posts: 15
Hello,
We're on Cacti version 1.1.33 and trying to get thold to send out SNMP traps when thresholds are breached.
Out thresholds are being triggered and sending emails but the traps don't reach our SNMP Notification Receiver.

From the Cacti server can send out other traps (not Cacti) successfully.
Our thold version came from the master branch in git, version 1.0.3.

Can anyone advise how to troubleshoot this problem or suggest what might be missing from our configuration?

Cacti 1.x is great - especially automation of graphs and trees.
Any suggestions or insight would be appreciated.
Thanks.


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Tue Mar 13, 2018 8:48 pm 
Offline
Cacti Pro User
User avatar

Joined: Mon Jan 05, 2015 10:10 am
Posts: 583
Likely a pm to browniebraun on this one. Have you setup the snmp agent receivers? Have you tested them? Is your snmptrap path correct?

_________________
Before history, there was a paradise, now dust.


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Wed Mar 14, 2018 7:17 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1439
thold expects you have thold_alert_snmp turned on, thold_alert_snmp_warning set to false (blank) and thold_alert_snmp_normal set to false (blank). The descriptive names for these are:

SNMP Notifications
Disable Warning Notifications
Disable Restoration Notifications

If these are set correctly, I'll dig deeper into what may be preventing them which may be something to do with snmpagent_notification() in lib/snmpagent.php. Things like whether you have the notification in the ignore list, whether there are any managers defined to receive that specific MIB event.

Double check the snmpagent_notifications_log table to see if there have been any entries.

_________________
Cacti Resources:
Cacti Website
Cacti Issues
Cacti Releases

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Thu Mar 22, 2018 4:08 pm 
Offline

Joined: Fri Jan 06, 2012 1:52 pm
Posts: 15
Thanks for getting back to me about this!

Under Configuration > Settings > SNMP Notification Presets I have a check in "SNMP Notifications"
"Disable Warning Notifications" is blank/unchecked.
"Disable Restoration Notifications" is blank/unchecked.

Utilities > SNMP Notification Receivers > I have my PC (which has a MIB browser/Trap Receiver application) set up. I can see traps in the Trap receiver on my PC, originating from this Cacti server if I send traps from a script.

I set up a threshold on Local Linux Machine - Logged in Users [users] [users], it's triggered if more than one user logs into the Cacti server.
I've got an Alert Email - extra email set up in the Threshold.

But when the threshold is triggered, I only get an email - no SNMP trap.
Utilities > SNMPAgent Notification Log is empty - no entries.
The Cacti server OS is Centos 7.

There are entries from THOLD in the cacti log : Alerting is necessary, Preparing to send email, etc.

Please let me know what else I can check.
Thanks again


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Mon May 07, 2018 6:49 pm 
Offline

Joined: Mon May 07, 2018 6:22 pm
Posts: 3
Hi all,
I have exactly the same problem described by clela2. Thold triggered, emails sent, thold logs posted to cacti.log. But no log in my SNMP Notification Receiver's log tab. I have enabled all 7 notifications/MIBS.
I am on Cacti 1.1.38 and thold 1.0.5 running on centos 6.9. Any suggestions?


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Thu May 10, 2018 8:02 am 
Offline

Joined: Fri Jan 06, 2012 1:52 pm
Posts: 15
I upgraded to see if that would help, so I'm also on Cacti 1.1.38, thold 1.0.5.

There is no sign that Cacti even attempts to send an SNMP trap, even if logging it set to DEBUG.
Anyway thought it might be worth mentioning that when selecting 'View SNMPAgent Notification Log', the drop down box for "Receiver" doesn't show any of the SNMP Notification Receivers - two are set up in my configuration.

So perhaps that's the issue.

If anyone can provide some troubleshooting advice or a workaround, that'd be great.
Thanks,
Imogen


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Wed Aug 01, 2018 2:54 pm 
Offline

Joined: Mon May 07, 2018 6:22 pm
Posts: 3
found it and fixed it. Cacti is now sending and logging traps...
there are 2 places that I have to modify in lib/snmpagent.php:

Code:
function snmpagent_notification($notification, $mib, $varbinds, $severity = SNMPAGENT_EVENT_SEVERITY_MEDIUM, $overwrite = false){
        global $config;

        if (isset($config['snmpagent']['notifications']['ignore'][$notification])) {
                return false;
        }

        $path_snmptrap = read_config_option('path_snmptrap'); /* old name was snmpagent_path_snmptrap */

….

        if (sizeof($notification_managers) == 0) { /* we want to test if no notification_managers is found */
                /* To bad! Nobody wants to hear our message. :( */
                if (in_array($severity, array(SNMPAGENT_EVENT_SEVERITY_HIGH, SNMPAGENT_EVENT_SEVERITY_CRITICAL))) {




Can Cacti support team inform the developers to look at lib/snmpagent.php? :wink:



PS: is there a way to extend the page/session timeout? I had to copy and paste the message in order to submit successfully


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Wed Aug 01, 2018 4:01 pm 
Offline

Joined: Fri Jan 06, 2012 1:52 pm
Posts: 15
Thank you stuong!
Good work, this fixed my problem also.

I believe you should post this on git as an issue: https://github.com/Cacti/cacti/issues

ciela2


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Thu Aug 02, 2018 6:55 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1439
Yes, if you could post an issue so that we can track this on the repo (see link above). If you can also post a diff of the changes you made, we can try to match the lines to make sure it's applied correctly.

_________________
Cacti Resources:
Cacti Website
Cacti Issues
Cacti Releases

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: thold v1.0.3 not sending snmp traps
PostPosted: Fri Aug 31, 2018 6:26 pm 
Offline

Joined: Mon May 07, 2018 6:22 pm
Posts: 3
reported the bug and it has been included for future release
https://github.com/Cacti/cacti/issues/1849

I think you can close this thread as resolved :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group