THOLD 1.4
Moderators: Developers, Moderators
THOLD 1.4
What happened in THOLD 1.4! On the thresholds tab prior to upgrade from 1.2.4 thresholds for filesystems showed easy to read utilization percentages. Since the upgrade it appears to attempt to show utilization in K,M. This is not making my operators happy at all. Any ideas how to correct this?
-
- Cacti User
- Posts: 250
- Joined: Wed Mar 13, 2019 3:37 pm
- Location: toronto
- Contact:
Re: THOLD 1.4
can you post examples pls ? screenshot of how its being read
also a look at the graph and data source would be helpful
Which version of Cacti ?
windows or Linux deployment ?
also a look at the graph and data source would be helpful
Which version of Cacti ?
windows or Linux deployment ?
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband
Cacti Bug Hunter and Member
www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini
My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates
Always willing to help!
Cacti Bug Hunter and Member
www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini
My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates
Always willing to help!
Re: THOLD 1.4
I am running Cacti version 1.2.7 . This is on a RHEL 7 server.
Re: THOLD 1.4
Post what one of the thresholds looks like, seems like you are missing the Data Manipulation settings.
Re: THOLD 1.4
No ideas why this happens with an upgrade to 1.4 of thresholds.
Re: THOLD 1.4
I don't have the issue, but I am running the latest git verison of thold.
You can try this.
open thold_functions.php
find this function
and after that portion (there is more code in the function below that)
add this line
that will make it return formatted data without the unit descriptors.
You can try this.
open thold_functions.php
find this function
Code: Select all
function thold_format_number($value, $digits = 2, $baseu = 1024, $show_suffix = true) {
$units = '';
$suffix = '';
if ($baseu == 1024 && $show_suffix) {
$suffix = 'i';
}
if (!is_numeric($value)) {
return '-';
}
if ($value == '0') {
return '0';
}
add this line
Code: Select all
return number_format_i18n($value, $digits, $baseu);
Re: THOLD 1.4
Same result. I even took the development version and installed and still the same. When the php upgrade script runs it generates the following errors
2020/08/10 13:39:50 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: name in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 13:39:50 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 13:39:50 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: id in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 13:39:50 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 13:39:50 - THOLD WARNING: Threshold Template with Name and ID 0 Aligns with no matching Data Template
2020/08/10 15:29:49 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: name in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 15:29:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 15:29:49 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: id in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 15:29:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 15:29:49 - THOLD WARNING: Threshold Template with Name and ID 0 Aligns with no matching Data Template
2020/08/10 13:39:50 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: name in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 13:39:50 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 13:39:50 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: id in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 13:39:50 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 13:39:50 - THOLD WARNING: Threshold Template with Name and ID 0 Aligns with no matching Data Template
2020/08/10 15:29:49 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: name in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 15:29:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 15:29:49 - ERROR PHP NOTICE in Plugin 'thold': Undefined index: id in file: /cacti/cacti/plugins/thold/includes/database.php on line: 1285
2020/08/10 15:29:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/extras/upgrade.php[32]:thold_upgrade_database(), /plugins/thold/includes/database.php[1285]:CactiErrorHandler())
2020/08/10 15:29:49 - THOLD WARNING: Threshold Template with Name and ID 0 Aligns with no matching Data Template
Re: THOLD 1.4
That just appears to be an issue with a thold template that isn't assigned a datasource. If you make the above change to the devel version, does it fix the display issue for you?
Re: THOLD 1.4
I spun up a new RHEL 7 vm and installed the latest version of cacti (Version 1.2.14) and installed the development branch of THOLD from github. I made the change you requested above. I imported the filesystem template from my production cacti server (which works correctly). I then configured a client to monitor filesystems with thresholds and I still don't see utilization %, I see utilization in data units (K,M,G)
Re: THOLD 1.4
The problem with this plugin is the following code: This is what is changing my utilization values in THOLD to the metric units listed below. Is there a reason for this change?
function thold_format_number($value, $digits = 2, $baseu = 1024, $show_suffix = true) {
$units = '';
$suffix = '';
if ($baseu == 1024 && $show_suffix) {
$suffix = 'i';
}
if (!is_numeric($value)) {
return '-';
}
if ($value == '0') {
return '0';
}
return number_format_i18n($value, $digits, $baseu);
if (abs($value) < 1) {
$units = ' m';
$value *= $baseu;
if (abs($value) < 1) {
$units = ' µ';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) < 1) {
$units = ' n';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) < 1) {
$units = ' p';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
} else {
if (abs($value) >= $baseu) {
$units = ' K';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' M';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' G';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' T';
$value /= $baseu;
function thold_format_number($value, $digits = 2, $baseu = 1024, $show_suffix = true) {
$units = '';
$suffix = '';
if ($baseu == 1024 && $show_suffix) {
$suffix = 'i';
}
if (!is_numeric($value)) {
return '-';
}
if ($value == '0') {
return '0';
}
return number_format_i18n($value, $digits, $baseu);
if (abs($value) < 1) {
$units = ' m';
$value *= $baseu;
if (abs($value) < 1) {
$units = ' µ';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) < 1) {
$units = ' n';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) < 1) {
$units = ' p';
$value *= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
} else {
if (abs($value) >= $baseu) {
$units = ' K';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' M';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' G';
$value /= $baseu;
} else {
return number_format_i18n($value, $digits, $baseu) . $units . $suffix;
}
if (abs($value) >= $baseu) {
$units = ' T';
$value /= $baseu;
Re: THOLD 1.4
That's the exact piece of code I told you to change above..........
Re: THOLD 1.4
I did and it did not change a thing. What was the purpose of adding this code. It drastically changes the users interpretation of the THOLD gui value. In the older thold versions if you choose within the thold template a percentage of another value it would display as a %. Now with the new thold it is going to get what the percentage value is and display it in units instead of percentage. This will confuse operators/users.
Re: THOLD 1.4
The point of that code was facilitate the display of very small numbers (such as 0.000045) or for very large numbers. If the above change isn't working for you, then your issues may be in another area and not that function.
Who is online
Users browsing this forum: No registered users and 3 guests