Plugin Thold shows the current value as 0 after executing CDEF

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
igomez
Posts: 1
Joined: Fri Mar 17, 2023 9:06 am

Plugin Thold shows the current value as 0 after executing CDEF

Post by igomez »

After upgrading the CACTI version to 1.2.24, we have noticed an issue when creating a new Thold template. The SNMP-extracted voltage value from a device is not correctly captured after applying the CDEF logic of dividing it by 100.

Analyzing the CACTI logs, we have found the following error lines:

01-Jun-2023 12:55:52 - THOLD: Checking Threshold: Name: HOST - TEMPLATE', Graph: '9347'
01-Jun-2023 12:55:52 - THOLD WARNING: Value for Data ID 7240 is not numeric:'CURRENT_DATA_SOURCE', Previous Value was:'CURRENT_DATA_SOURCE'
01-Jun-2023 12:55:52 - THOLD WARNING: Erroneous CDEF logic, the first value should be numeric, but is 'CURRENT_DATA_SOURCE'
01-Jun-2023 12:55:52 - ERROR PHP WARNING in Plugin 'thold': A non-numeric value encountered in file: /cacti/plugins/thold/thold_functions.php on line: 4117


It seems that when applying the logic, the function encounters a non-numeric value. Analyzing the Thold database tables, we can see that the value of the last reading is stored as varchar2, which may be the cause of the issue.

On the other hand, we have tried updating the Thold plugin to its latest version, but the problem persists. We have also tested performing the CDEF operation with byte-to-bit conversion, and in this case, it seems to work correctly. Therefore, the error only occurs with non-traffic data.

If we collect the value as an exact value, it captures the current value correctly. The issue seems to be specifically related to the CDEF function.

Could you please review what might be happening?

Thank you very much in advance.

Best regards.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Plugin Thold shows the current value as 0 after executing CDEF

Post by TheWitness »

Could you add these details to your ticket on GitHub. I am working on a new release of Cacti and this information is pretty important.
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?
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Plugin Thold shows the current value as 0 after executing CDEF

Post by TheWitness »

I think I have traced this one. Working on it.
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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests