Saving a thold template reactivates disabled tholds

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
rosskus
Posts: 8
Joined: Tue Mar 09, 2010 3:12 pm

Saving a thold template reactivates disabled tholds

Post by rosskus »

Running 0.8.7i with Thold 0.4.9.

When we want to temporarily disable (not delete) certain thresholds, we disable them by clicking on the red button on the 'thold' tab.
When someone modifies the threshold template (perhaps changing an upper or lower limit), all of the disabled thresholds
become enabled again.

Is this the intended behavior?

Thank you,
Ross Kusler
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Saving a thold template reactivates disabled tholds

Post by noname »

It seems so.
When saving a threshold template, its values (including "Enabled" field) will apply to all thresholds using the template.

If you want to avoid this behavior, try to modify 'thold/thold_functions.php'.

Code: Select all

function thold_template_update_thresholds ($id) {
        db_execute("UPDATE thold_data, thold_template
                SET thold_data.thold_hi = thold_template.thold_hi,
                ...
                thold_data.thold_enabled = thold_template.thold_enabled,    <=== delete this line
                ...
                WHERE thold_data.template=$id AND thold_data.template_enabled='on' AND thold_template.id=$id");
        ...
}
Please at your own risks.
Wizzer
Posts: 13
Joined: Wed Aug 18, 2010 4:38 pm

Re: Saving a thold template reactivates disabled tholds

Post by Wizzer »

Threshold Enabled is part of the template so everything is either enabled or disabled when the templated is changed. Edit the Threshold you disabled and uncheck the Template Propogation Enabled box. Changes to the template no longer affect the Threshold.

Wizzer
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests