Exemption Time

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Richter
Posts: 7
Joined: Thu Dec 21, 2006 9:55 am

Exemption Time

Post by Richter »

Thold is a great Plug-in, it is working perfectly for me!

One thing I would like to try and figure out is if there is a way to create an exception time, similiar to the weekend exemption, where from 8pm - 5am it would ignore triggers. We do backups accross the WAN overnight and are getting several alerts overnight, which we could do without.
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

I have a Maintenance Period / Schedule on my list of things to do, but its not there yet.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

I sure would love to have this feature in thold too. Wouldn't mind giving a hand if I can help.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Patches are always welcomed.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

Has any progress been done on this? If not, then I'm going to scratch this itch of mine and submit a patch back to you guys.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Work it over and send it upstream. If it's good, it in.

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

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

I've been toying with this (and learning how cacti/thold code works). It's working but need some clean up. Currently only one exemption can be set per template, you can toggle it on/off, select one or many day of the week and choose a start/stop hour.

Things I'd like to add :
More precise time support (ie minutes not just hour). Rather easy to do, I just kept it simple for now.

Multiple exemption per template. Can this be done? I'm thinking something along the line of multiple Data Source in the Data Templates.

Adding a thold Exemption State. Right now, when an exemption is in effect there is no obvious way to know this. What would be better, adding an exempt state? Or just flag it disabled?

What's the best way to send it to you and get some feedback on the code?
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

It's getting in good shape, tested different scenario on my cacti server. Works rather well.
tinalee
Posts: 3
Joined: Mon Oct 05, 2009 5:55 pm

Post by tinalee »

Hi, I really need this. We have tons of backups running in the evening casuing a lot of alerts. All I can do for now is to try to remember to manually disable/enable alerts every day. Is this patch any closer?
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

Hi, I'm still testing/debuging this. So far so good. Since SVN is in flux lately I did my patch with thold 0.4.1 (including a few other patches here and there that have been included in SVN).

I can upload a proper patch today if you want to test it.
Last edited by DarkMan on Tue Oct 06, 2009 3:40 pm, edited 1 time in total.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

Here is the patch.

First you have to upgrade the database with exemption.sql. Then run the patch (I made it against a clean 0.4.1). Do a dry-run first. If everything works, you will see that the Weekend exempt is gone on the threshold and templates (but not the Global one, this one still works the same...in fact it is the same). You now have a checkbox to enable the exemption, a multiple choice dropbox and a start/stop time. You can modify it at the template level and at threshold level. Beware when an exemption works overnight.

Example : you have a backup running from 8PM to 2AM starting on monday. You must select monday and tuesday, start at 20h and stop at 2h.

Comments? Questions? Idea on how to improve?
Attachments
thold-exempt-v1.1.tar.gz
Oops, found a little logic issue with the global weekend exception. This is the new full patch.
(3.8 KiB) Downloaded 492 times
Last edited by DarkMan on Tue Oct 06, 2009 3:53 pm, edited 2 times in total.
tinalee
Posts: 3
Joined: Mon Oct 05, 2009 5:55 pm

Post by tinalee »

Darkman,
Thanks for the quick reply.
The patch went well, I can see the changes, but I can not figure out how I would set it to exempt Mon to Friday, 8pm to 8am the next day, but then exepmt the weekend from Friday 8pm to Monday morning 8am. In other words, only alert mon to fri 8am to 8pm.

...hope I am not missing the point here. :-?
tinalee
Posts: 3
Joined: Mon Oct 05, 2009 5:55 pm

Post by tinalee »

Ah, I think I was missing the point...
So, in the threshold template I select Monday to Saturday then select the start at 20 and end at 08, which will apply to each day following through to the next, then use the weekend exemption on the global setting.

Excellent work, thank you, Just got this on a test VB at the moment. I will give it a couple of days then wack on the live box.
Last edited by tinalee on Tue Oct 06, 2009 1:51 pm, edited 1 time in total.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

tinalee wrote:Ah, I think I was missing the point...
So, in the threshold template I select Monday to Saturday then select the start at 20 and end at 08, which will apply to each day following through to the next, then use the weekend exemption on the global setting.
Yep, that should work the way you want.

Oops, found a possible logic issue. It's the same code but reordered the global check. Made a quick patch for you, just patch over your current test with this one. Also uploaded a new version.
Attachments
exempt-oops.patch
(1.48 KiB) Downloaded 411 times
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please open a bug report here: http://bugs.cacti.net and attache your patch and some information on design to cut down the time that the Dev's have to spend reviewing the patch.

Thanks,

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

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests