THold 0.3.5.2 - changes host_ids?

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

THold 0.3.5.2 - changes host_ids?

Post by Howie »

I'm working on something for a weathermap user to pull data out of threshold for maps - we've found that in some situations the host_id field in thold_data changes. We noticed it while comparing results with Monitor. I didn't actually look at the code for Monitor before writing mine, but it seems that it fetches all the thold_data rra_id values, and then looks up the actual host_id in Cacti's data_local table, and NOT using the thold_data host_id field! :-) Which explains why we saw differences.

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 |
+---------+---------+--------+---------+-------------+
The first line shows the discrepancy.

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.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

So far, it seems that the new host_id is always 3, too.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
looc
Cacti User
Posts: 110
Joined: Mon Aug 13, 2007 3:40 am

Post by looc »

it is a thold 0.3.5.2 bug~
when you config a thold and save,host_id changed lastest host's id~ :oops:
Cacti Version - 0.8.7 & spine
Plugin Architecture - 1.3
Server Info - Windows 2003 EP
Web Server -IIS6.0
PHP - 5.2.3
MySQL - 4.1.10
RRDTool - 1.2.15
SNMP - 5.4.1
--------------------------
plugins:
reportit 0.5.1|monitor 0.8.1|thold 0.3.8
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

I will take a look at this.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Any joy with this Jimmy ? I think this is also the same issue in the bug I posted with version 0.3.6.

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Ouch!

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?
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

I have just released v0.3.7 which should fix this issue. I also fixed the issue of the Settings plugin having to be before thold in the plugins array.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Thanks Jimmy. Just downloaded it.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests