Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Wed Nov 26, 2014 6:53 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Host Down E-mails Repeated
PostPosted: Thu Jul 21, 2011 1:13 am 
Offline

Joined: Thu Jan 13, 2011 7:29 am
Posts: 26
Hello All!

I configured the ability of my Cacti to send e-mails a pair of days ago and I received multiple e-mails today that the same host is down. The messages were sent with various pauses between messages. I see no threashold templates that do this. I think the monitor plugin causes that thold sends those messages. Can you help me make Cacti send such messages only once for a host if it stays down?

Thank you if you answer.

The information about my Cacti is below.

Quote:
Cacti Version - 0.8.7c
Plugin Architecture - 2.2
Poller Type - Cactid v
Server Info - Linux 2.6.32-4-pve
Web Server - Apache/2.0.63 (CentOS)
PHP - 5.1.6
PHP Extensions - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, gd, ldap, mysql, mysqli, PDO, pdo_mysql, pdo_sqlite, snmp, eAccelerator
MySQL - 5.0.82sp1
RRDTool - 1.2.23
SNMP - 5.1.2
Plugins
    Global Plugin Settings (settings - v0.5)
    Large Site Performane Booster for Cacti (boost - v2.2)
    Device Monitoring (monitor - v0.8.2)
    Network Discovery (discovery - v0.8.5)
    Network Tools (tools - v0.3)
    Syslog Monitoring (syslog - v0.5.2)
    Device Tracking (mactrack - v2.6)
    Login Page Mod (loginmod - v1.0)
    Update Checker (update - v0.4)
    FlowView (flowview - v0.6)
    Host Info (hostinfo - v0.2)
    Error Images (errorimage - v0.1)
    PHP Network Weathermap (weathermap - v0.95b)
    docs
    Cacti-ReportIt (reportit - v0.6.1)
    Router Configs (routerconfigs - v0.1)
    WMI Query (wmi - v0.1)
    Realtime for Cacti (realtime - v0.35)


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Mon Jul 25, 2011 8:03 am 
Offline

Joined: Mon Jul 25, 2011 7:49 am
Posts: 3
the same thing is happening in my cacti enviorment too.
havent found a way to solve it yet.
anyone got any idea on why does is send several e-mail about the same host ?


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Mon Jul 25, 2011 9:19 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2064
Location: Kressbronn, Germany
hm ... how many data sources does this host have, and how many mails do you get from it ?

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Mon Jul 25, 2011 9:26 am 
Offline

Joined: Mon Jul 25, 2011 7:49 am
Posts: 3
i got 1 data source for this host and i get 5 emails from it before it stop sending.
the time between each mail is 1 minute.


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Mon Jul 25, 2011 9:34 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2064
Location: Kressbronn, Germany
Do you have 1 minute polling enabled ?

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Tue Jul 26, 2011 2:23 am 
Offline

Joined: Mon Jul 25, 2011 7:49 am
Posts: 3
Thanks phalek for the lead,
I've re-configured the data template "Associated RRA's" to include the 1 minute template and changed the "Step" field to 60.
This seems to solve the problem. I'm not familiar with why its working or why it didn't worked from the first place and I'll be happy to be pointed to a document to explain me that.
Now it stoped sending multiple e-mails.


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Tue Jul 26, 2011 3:09 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2064
Location: Kressbronn, Germany
Well, the only thing I can tell you is that Thold is running a function called "thold_update_host_status" after each polling cycle (includes/poller.php).

Within that function it sends out an email alert for all hosts that match the following SQL statement:

Code:
SELECT * FROM host WHERE disabled="" AND status=' . HOST_DOWN . ' AND status_event_count=' . $ping_failure_count


Now the "ping_failure_count" is set on the settings page and should be the "Failure Count".

Based on what you say, the settings on the RRAs does have an influence on the mentioned SQL statement.

I assume that due to the RRA the poller simply skips that host until the 5 minutes have passed again, therefore not updating the failure count field.

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Fri Sep 23, 2011 1:36 am 
Offline

Joined: Fri Apr 28, 2006 4:02 am
Posts: 28
I have faced the same issue since a while and couldn't find a solution. Even checking the code did not show any obvious bugs. Finally I checked the database entry.
There was the recommendation to clear the thold_failed_hosts content in the settings table. I did it a couple of times and it seems to improve. However after a couple of days the down alerts continue.

Then I realized that the field thold_failed_hosts is only 512 characters long. The field is just too short for keeping all the host id's (including comma) which are down. Extending this field to 1024 or even more characters can solve the issue. See the SQL commmand below.

Code:
ALTER TABLE `settings` CHANGE `value` `value` VARCHAR( 1024 ) NOT NULL DEFAULT ''


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sun Sep 25, 2011 8:34 am 
Offline
Cacti User
User avatar

Joined: Tue May 15, 2007 5:24 am
Posts: 82
Location: Romania
good to know, i don't monitor so many host,and for me not happen this issue

_________________
Cacti - 0.8.7h
Plugin Architecture - 3.0
Poller Type - SPINE 0.8.7g
Server Info - Linux 2.6.35.10 - Slackware 13.1
Web Server - Apache/2.2.17 (Unix) DAV/2 PHP 5.3.5
MySQL - 5.1.53 ;RRDTool - 1.4.5 ;SNMP - 5.6.1
Plugins
    (tools - v0.3) (Thold - v0.4.6) (Ntop - v0.2) (Discovery - v1.2a) (Monitor - v1.2)


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Wed Sep 28, 2011 5:53 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
That whole use of the settings table is wrong. I'll have to discuss this with Cigamit and determine the proper resolution in the code. Making the settings table too large, or even 'text' presents huge scalability problems for Cacti, so I don't want to have to set it too large.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sat Oct 08, 2011 6:15 am 
Offline
Cacti User

Joined: Fri Oct 09, 2009 8:59 am
Posts: 121
Location: Germany
we did have the same problem this weekend, cause of many down devices for a test.
so i worked on a solution and here is my result:

1. new table in db --> plugin_thold_host_failed
2. change polling.php in thold/includes/polling.php

The only point, i dont know where the column thold_failed_hosts in table settings come from.
The diff's are based on files of thold v0.4.6

greetings


Attachments:
File comment: thold/includes/polling.php
polling.php.diff.txt [1.74 KiB]
Downloaded 77 times
File comment: thold/thold.sql
thold.sql.diff.txt [539 Bytes]
Downloaded 89 times

_________________
System: Ubuntu 10.04lts@64bit, 2*X5650, 12GB, Cacti 0.8.7g, Spine 0.8.7g, PA2.9, Weathermap 0.97a, CAMM 1.6.75, monitor 1.3.1, realtime 0.43, thold 0.4.9.3, manage 0.6.2, mactrack 2.9(.1) ---- 508 devices, 6741 items, 4263 ds, time 7.01s, intervall 60, proc. 12, threads 14, php server 8


Last edited by uhtred on Sat Oct 08, 2011 11:56 am, edited 2 times in total.
Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sat Oct 08, 2011 7:46 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Crap. If forgot all about this for 0.4.6. Let me prepare 0.4.7 today.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sat Oct 08, 2011 11:57 am 
Offline
Cacti User

Joined: Fri Oct 09, 2009 8:59 am
Posts: 121
Location: Germany
sry, there was a mistake in my polling.diff. :o
so i did upload the correct one.

_________________
System: Ubuntu 10.04lts@64bit, 2*X5650, 12GB, Cacti 0.8.7g, Spine 0.8.7g, PA2.9, Weathermap 0.97a, CAMM 1.6.75, monitor 1.3.1, realtime 0.43, thold 0.4.9.3, manage 0.6.2, mactrack 2.9(.1) ---- 508 devices, 6741 items, 4263 ds, time 7.01s, intervall 60, proc. 12, threads 14, php server 8


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sat Oct 08, 2011 12:02 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Ok, doing the merge now.

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Host Down E-mails Repeated
PostPosted: Sat Oct 08, 2011 12:27 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Test SVN 1809 when it becomes available on the public facing SVN. It'll take a few minutes. I did things a bit differently as you will note.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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:  

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