Exemption Time

Support questions about the Threshold plugin

Moderators: Developers, Moderators

DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

Done : http://bugs.cacti.net/view.php?id=1556

Cleaned the patch a bit to contain only the new exempt code.
b-boy
Posts: 19
Joined: Mon Oct 05, 2009 4:51 am

Post by b-boy »

Hi all

Thanks for this patch its a really cool feature, I just want to request one enhancement.... could we please get the no notifications on weekends function back? I would like to only receive notifications from Mon - Fri (08h00 - 17h00) ... I have just started learning perl and if I had to try and figure out PHP now I will be even more confused :(

Thnaks again for the patch !!
B
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

I removed it from the template because it ends up being a duplicate feature. If you want to be alerted only from mon-fri 8h to 17h then either use the global weekend exempt (you will find this in Cacti console configuration -> Settings -> Alerting/Thold) or set an exemption for Saturday-Sunday 0-23.

While writing this reply I figured something wrong. It's still a work in progress but I have an idea on out to make it work the way you would like.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

Doh!

Tried to be too clever for my own good and caused a bug.

In thold_functions.php change this line :

Code: Select all

if ( $current_time >= $item['exempt_begin_time']) {
to this :

Code: Select all

if ( $current_time == $item['exempt_begin_time']) {
In some case, it can cause an exempt to get back on and stay on. To reset all exempt state run this :

Code: Select all

UPDATE thold_data set exempt_state = 0 WHERE `exempt_state` = '1'
I'm working on some improvment / concept and should have this done in a few day. This could allow me to do a multiple exempt per template.
Attachments
thold-exempt-v1.2.tar.gz
New patch version
(3.66 KiB) Downloaded 242 times
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Will a patch for version 4.2 be released ?
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
b-boy
Posts: 19
Joined: Mon Oct 05, 2009 4:51 am

Post by b-boy »

Excellent DarkMan, thanks again for your work on this
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

mcutting wrote:Will a patch for version 4.2 be released ?
Well, thold 0.4.2 isn't ready as far as I know. I submited a patch upstream but haven't got any feedback yet.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

b-boy wrote:Hi all

Thanks for this patch its a really cool feature, I just want to request one enhancement.... could we please get the no notifications on weekends function back? I would like to only receive notifications from Mon - Fri (08h00 - 17h00) ... I have just started learning perl and if I had to try and figure out PHP now I will be even more confused :(

Thnaks again for the patch !!
B
Come to think of it, to do this, enable the global weekend exemption and then in the template select all the days (Monday through Sunday) with a start time of 17h00 and end time of 8h00. This way, you will only receive an alert between 8h00-17h00 monday through friday.

This gave me an idea. Instead of only being able to choose an exemption period, selecting an alerting period could be simpler for a case like yours. It should be rather easy to do.
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Post by DarkMan »

I have several idea but I'm not sure what is usefull or not depending on what kind of schedule you use. So I'd like some feedback from thold users.

Is my current patch good enough?

Would having an alerting period be better? (with or without a possibility for exemption?).

Always alert 24/7 with one or multiple exemption?

About doing multiple exempt schedule, right now it can work on multiple day but it is the "same schedule". I'll need some help from the dev because I'm not too sure how to do this. I know it can be done (like in the data template you can have multiple data source). However from what I understand the threshold template would need some reworking and this is where I need help.
b-boy
Posts: 19
Joined: Mon Oct 05, 2009 4:51 am

Post by b-boy »

Hi

Sorry for only relying now...
DarkMan wrote: This gave me an idea. Instead of only being able to choose an exemption period, selecting an alerting period could be simpler for a case like yours. It should be rather easy to do.
This would be perfect for my requirements ;)
bacon
Posts: 8
Joined: Sat Feb 26, 2011 12:15 am

Re: Exemption Time

Post by bacon »

patching file thold_functions.php
Hunk #1 FAILED at 434.
Hunk #2 FAILED at 449.
Hunk #3 FAILED at 909.
Hunk #4 FAILED at 1164.
Hunk #5 FAILED at 1223.
Hunk #6 FAILED at 1248.
Hunk #7 FAILED at 1496.
Hunk #8 FAILED at 1526.
Hunk #9 FAILED at 1534.
9 out of 9 hunks FAILED -- saving rejects to file thold_functions.php.rej
patching file thold.php
Hunk #1 FAILED at 283.
Hunk #2 FAILED at 314.
Hunk #3 FAILED at 364.
Hunk #4 FAILED at 387.
Hunk #5 FAILED at 626.
5 out of 5 hunks FAILED -- saving rejects to file thold.php.rej
patching file thold_templates.php
Hunk #1 FAILED at 84.
Hunk #2 FAILED at 264.
Hunk #3 FAILED at 273.
Hunk #4 FAILED at 339.
Hunk #5 FAILED at 395.
Hunk #6 FAILED at 425.
Hunk #7 FAILED at 476.
Hunk #8 FAILED at 499.
8 out of 8 hunks FAILED -- saving rejects to file thold_templates.php.rej


it's faild,help me!
ralf
Posts: 35
Joined: Tue Nov 04, 2008 2:54 pm

Re: Exemption Time

Post by ralf »

Will this patch work with 0.4.3? The bug page lists it at for 0.4.1

Thanks
DarkMan
Posts: 38
Joined: Wed Mar 18, 2009 3:17 pm

Re: Exemption Time

Post by DarkMan »

ralf wrote:Will this patch work with 0.4.3? The bug page lists it at for 0.4.1

Thanks
I applied it to thold 0.4.3 and it worked without any change to the patch. Had to re-import my previous template from database backup since installation of the new version cleared out all previous template.
kb122
Posts: 2
Joined: Thu Jul 24, 2008 3:53 pm

Re: Exemption Time

Post by kb122 »

I've got a Windows installation of Cacti that I would like to add this patch to. Would you be able to post the patched thold PHP files?

Thanks
tonie16
Posts: 4
Joined: Thu Sep 12, 2013 2:53 am

Re: Exemption Time

Post by tonie16 »

Good day,

Is there maybe a exemption time patch for Thold 0.5?

I've tried to install the patch (0.4.1) on Thold 0.5, didn't work.

Thanks,

Cacti running on Freebsd.
(Cacti Version: 0.8.8a, Plugin Architecture Version: 3.1, Thold 0.5)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests