Cacti / plugin_thold

Thold Plugin for Cacti
GNU General Public License v2.0
68 stars 63 forks source link

QA: Problem with non-templated tholds #635

Closed xmacan closed 9 months ago

xmacan commented 11 months ago

Thold 1.8 - it seems that non-templated tholds doesn't work. These tholds should be restored: thold_tri2

From normal -> triggered-> breached is the same problem: thold2

Templated tholds works fine.

xmacan commented 11 months ago

without thold daemon

TheWitness commented 10 months ago

I did not see your sentence about the non-templated not clearing their state. Any errors in the log?

TheWitness commented 10 months ago

You will have to re-upgrade your database. I've added another column to the notification_queue table and ran a sql query to fix the non-templated tholds.

xmacan commented 10 months ago

Still not working

xmacan commented 10 months ago

It seems that problem is in include/polling.php in thold_check_all_thresholds() function. My problematic thold:

select thold_enabled, thold_per_enabled, template_enabled,tcheck, thold_template_id from thold_data where id=11886; +---------------+-------------------+------------------+--------+-------------------+-----------------------+ | thold_enabled | thold_per_enabled | template_enabled | tcheck | thold_template_id | +---------------+-------------------+------------------+--------+-------------------+-----------------------+ | on | on | off | 0 | 2 | +---------------+-------------------+------------------+--------+-------------------+-----------------------+

ID 11886 will never been processed because SQL condition for tholds is: WHERE td.thold_enabled = 'on' AND td.thold_per_enabled = 'on' AND ((thold_template_id > 0 AND td.template_enabled = 'on') OR thold_template_id = 0) AND td.tcheck = 1 AND h.status = 3

My non-templated thold are created from templated, only disable Template Propagation Enabled and change hi/lo values.

I don't know how right sql for non-templated thold looks like. @TheWitness Could you help me?

xmacan commented 10 months ago

works great.