Thold Current Value is incorrect

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Thold Current Value is incorrect

Post by jason23 »

Hello Sir,

As I have upgraded from v0.8.8h to v1.2.27, and now the Thold Plugin is able to send alert email out, but the current value (Mbytes) can't match with the data showing in Graph (Mbits), even I made self calculation.

Cacti Version: v1.2.27
PHP 8.3.7
MySQL 5.7.43
Thold 1.8.1
NET-SNMP version: 5.5
cmd.php
Concurrent Processes Name: Main Poller, Procs: 40
Max Threads Name: Main Poller, Threads: 60
PHP Servers 10
Minimum Connections: Main Server: Current: 3000, Min Required: 2900

May I know if anyone can help to provide some solution for me ?

Cacti Error Log
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
2024-06-04 19:18:02 - CMDPHP PHP ERROR Backtrace: (D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[99]:perform_thold_processes(), D:\Inetpub\wwwroot\cacti\plugins\thold\poller_thold.php[154]:thold_check_all_thresholds(), D:\Inetpub\wwwroot\cacti\plugins\thold\includes\polling.php[332]:thold_check_threshold(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[2219]:get_thold_emails(), D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php[7596]:CactiErrorHandler())
2024-06-04 19:18:02 - ERROR PHP DEPRECATED: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in file: D:\Inetpub\wwwroot\cacti\plugins\thold\thold_functions.php on line: 7596
Thank you,
Last edited by jason23 on Tue Jun 04, 2024 6:51 am, edited 1 time in total.
User avatar
macan
Cacti Guru User
Posts: 1146
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Thold Current Value is incorrect

Post by macan »

really php 5? Error message seems like from PHP 8.

It is bug, please report it here:
https://github.com/Cacti/plugin_thold/issues
Let the Cacti grow!
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

macan wrote: Tue Jun 04, 2024 6:46 am really php 5? Error message seems like from PHP 8.

It is bug, please report it here:
https://github.com/Cacti/plugin_thold/issues
Sorry about that, it should be PHP 8.3.7.

You mean this Thold Incorrect is a bug??
User avatar
macan
Cacti Guru User
Posts: 1146
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Thold Current Value is incorrect

Post by macan »

It seems that there is bug in database table. Show result of SQL query:
describe thold_data;
Let the Cacti grow!
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

macan wrote: Tue Jun 04, 2024 6:55 am It seems that there is bug in database table. Show result of SQL query:
describe thold_data;
Hello Macan,

Here is the result.
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1388
Server version: 5.7.43-log MySQL Community Server (GPL)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use cacti
Database changed
mysql> describe thold_data;
+-----------------------------+------------------+------+-----+---------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------------+------------------+------+-----+---------------------+-----------------------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| thread_id | int(10) unsigned | NO | | 0 | |
| name | varchar(150) | YES | | | |
| name_cache | varchar(150) | NO | | | |
| local_data_id | int(11) unsigned | NO | MUL | 0 | |
| data_template_rrd_id | int(11) unsigned | NO | MUL | 0 | |
| local_graph_id | int(11) unsigned | NO | MUL | 0 | |
| graph_template_id | int(11) unsigned | NO | MUL | 0 | |
| data_template_hash | varchar(32) | YES | | | |
| data_template_id | int(11) unsigned | NO | MUL | 0 | |
| data_source_name | varchar(100) | NO | | | |
| thold_hi | varchar(100) | YES | | | |
| thold_low | varchar(100) | YES | | | |
| thold_fail_trigger | int(10) unsigned | YES | | NULL | |
| time_hi | varchar(100) | YES | | | |
| time_low | varchar(100) | YES | | | |
| time_fail_trigger | int(12) | NO | | 1 | |
| time_fail_length | int(12) | NO | | 1 | |
| thold_warning_hi | varchar(100) | YES | | | |
| thold_warning_low | varchar(100) | YES | | | |
| thold_warning_fail_trigger | int(10) unsigned | YES | | NULL | |
| thold_warning_fail_count | int(11) | NO | | 0 | |
| time_warning_hi | varchar(100) | YES | | | |
| time_warning_low | varchar(100) | YES | | | |
| time_warning_fail_trigger | int(12) | NO | | 1 | |
| time_warning_fail_length | int(12) | NO | | 1 | |
| notify_warning_extra | text | YES | | NULL | |
| notify_alert | int(10) unsigned | NO | | 1 | |
| snmp_event_category | varchar(255) | YES | | | |
| snmp_event_description | varchar(1000) | YES | | | |
| snmp_event_severity | tinyint(1) | NO | | 3 | |
| snmp_event_warning_severity | tinyint(1) | NO | | 2 | |
| notes | varchar(1024) | YES | | | |
| external_id | varchar(20) | YES | | | |
| notify_warning | int(10) unsigned | NO | | 1 | |
| thold_fail_count | int(11) | NO | | 0 | |
| thold_alert | int(1) | NO | | 0 | |
| prev_thold_alert | int(1) | NO | | 0 | |
| thold_enabled | enum('on','off') | NO | MUL | on | |
| thold_per_enabled | char(3) | NO | | on | |
| thold_type | int(3) | NO | | 0 | |
| bl_ref_time_range | int(10) unsigned | YES | | NULL | |
| bl_type | int(3) | NO | | 0 | |
| bl_pct_down | varchar(100) | YES | | | |
| bl_pct_up | varchar(100) | YES | | | |
| bl_fail_trigger | int(10) unsigned | YES | | NULL | |
| bl_fail_count | int(11) unsigned | YES | | NULL | |
| bl_alert | int(2) | NO | | 0 | |
| bl_cf | varchar(4) | NO | | AVG | |
| bl_reference_min | double | YES | | 0 | |
| bl_reference_max | double | YES | | 0 | |
| bl_reference_avg | double | NO | | 0 | |
| bl_reference_last | double | NO | | 0 | |
| lastread | varchar(100) | YES | | | |
| lasttime | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| lastchanged | timestamp | NO | | 0000-00-00 00:00:00 | |
| oldvalue | varchar(100) | NO | | | |
| repeat_alert | int(10) unsigned | YES | | NULL | |
| notify_extra | varchar(512) | YES | | | |
| host_id | int(10) | YES | MUL | NULL | |
| syslog_priority | int(2) | YES | | 3 | |
| syslog_facility | int(2) | YES | | NULL | |
| syslog_enabled | char(3) | NO | | | |
| data_type | int(12) | NO | | 0 | |
| show_units | char(3) | NO | | | |
| units_suffix | varchar(10) | NO | | | |
| decimals | int(11) | NO | | -1 | |
| cdef | int(11) | NO | | 0 | |
| percent_ds | varchar(64) | NO | | | |
| expression | varchar(512) | NO | | | |
| upper_ds | varchar(64) | NO | | | |
| thold_template_id | int(11) unsigned | NO | MUL | 0 | |
| template_enabled | char(3) | NO | MUL | | |
| tcheck | int(1) | NO | MUL | 0 | |
| exempt | char(3) | NO | | | |
| acknowledgment | char(3) | NO | | | |
| thold_hrule_alert | int(11) unsigned | YES | | NULL | |
| thold_hrule_warning | int(11) unsigned | YES | | NULL | |
| skipscale | char(3) | YES | | | |
| restored_alert | char(3) | NO | | | |
| reset_ack | char(3) | NO | | | |
| persist_ack | char(3) | NO | | | |
| email_subject | varchar(128) | NO | | | |
| email_subject_warn | varchar(128) | NO | | | |
| email_subject_restoral | varchar(128) | NO | | | |
| email_body | varchar(1024) | YES | | | |
| email_body_warn | varchar(1024) | NO | | | |
| email_body_restoral | varchar(1024) | NO | | | |
| trigger_cmd_high | varchar(512) | NO | | | |
| trigger_cmd_low | varchar(512) | NO | | | |
| trigger_cmd_norm | varchar(512) | NO | | | |
| bl_thold_valid | int(10) unsigned | NO | | 0 | |
| format_file | varchar(255) | NO | | | |
| graph_timespan | int(11) unsigned | NO | | 7 | |
+-----------------------------+------------------+------+-----+---------------------+-----------------------------+
94 rows in set (0.00 sec)

mysql>
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold Current Value is incorrect

Post by TheWitness »

This was fixed in GitHub.
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?
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

TheWitness wrote: Sat Jun 08, 2024 10:40 am This was fixed in GitHub.
Hello @TheWitness,

As I am still facing the Incorrect Current Value which I have mentioned in the last post in Github, would you please help to provide some solution on it?

Thanks for your help on it.
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold Current Value is incorrect

Post by TheWitness »

What is the base value? What do you type in when editing the Thold? What is stored in the backend?
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?
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

TheWitness wrote: Sat Jun 08, 2024 10:52 am What is the base value? What do you type in when editing the Thold? What is stored in the backend?
In the Thold Page, I edit the Threshold and type 225M in the Alert's High Threshold Box. And it is also showing AHi: 225M .

But the problem I encounter is the value of "traffic_in's Last" & "traffic_out's Last" (Showing with xxxM) cannot match with the Graph (Showing in MBit), even I have convert the Mbyte to MBit, the value showing in "traffic_in's Last" & "traffic_out's Last" are much bigger than the data in Graph.

https://github.com/Cacti/plugin_thold/issues/674
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold Current Value is incorrect

Post by TheWitness »

Are you using the cdef manipulation in Thold? If so, don't.
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?
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

TheWitness wrote: Sat Jun 08, 2024 11:04 am Are you using the cdef manipulation in Thold? If so, don't.
Hello TheWitness, I am using with the "Exact Value" in the Threshold setting for the "Data Manipulation - Data Type"
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold Current Value is incorrect

Post by TheWitness »

Use the cdef divide by 8.
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?
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

TheWitness wrote: Sat Jun 08, 2024 11:18 am Use the cdef divide by 8.
I mean that is not the Conversion issue for Mbytes & Mbits.

Please take a look at the below PrintScreen for my situation.

Image

eg: The First Row of "Traffic_out's Last" ==> 5.889143M (which is 5.889143 Mbytes x 8 = 47.113144 Mbits)
But the Graph is showing "Outbound's Current" ==> 24.59 M (Mbits)
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold Current Value is incorrect

Post by TheWitness »

I don't see any screen cap here.
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?
jason23
Posts: 44
Joined: Wed May 22, 2024 9:52 am

Re: Thold Current Value is incorrect

Post by jason23 »

TheWitness wrote: Sat Jun 08, 2024 12:08 pm I don't see any screen cap here.
Hello TheWitness, I have posted with the screen cap with Cacti Log in the last post in Github of my post.

Would you mind to see it in there? As I can’t upload in here.

Thank you so much.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests