Anyway, if I apply a threshold template to a host, then uncheck the "Propagate Template Changes" checkbox, the host_id for that template changes to some other host:
Code: Select all
mysql> select thold_data.host_id, data_local.host_id, rra_id, data_id, thold_alert from thold_data, data_local where thold_data.rra_id=data_local.id;
+---------+---------+--------+---------+-------------+
| host_id | host_id | rra_id | data_id | thold_alert |
+---------+---------+--------+---------+-------------+
| 3 | 1 | 17 | 106 | 0 |
| 1 | 1 | 18 | 108 | 0 |
| 3 | 3 | 48 | 264 | 0 |
+---------+---------+--------+---------+-------------+
Is this an error in my understanding of what the host_id field does, or is it actually an error? I recognise that I'm kind of rummaging in the guts of another plugin here for data...
Looking at the code for save_thold, it picks host_id up from a global variable before saving it back out again (I think), which in turn can come from a bunch of places (session, POST, GET...). It doesn't really seem to do much in the middle with it, but can it get mangled?
For me, this is Cacti 0.8.6j, FreeBSD, PHP 5.2.4 and mysql 5.0.45. Not sure what my friend has, but I know it's 0.3.5.2 Thold.