Open giddie opened 3 years ago
This project is dead and there are lots of unpatched vulnerabilities. We ran ganglia for a few years but have since migrated to grafana+prometheus.
I kind of got the impression that it's at least struggling, but I notice there are commits from Jan 2021, so it's not dead dead. But yeah, probably time to consider something else :+1:
Munin looks to be pretty comparable to Ganglia and simple to set up. I haven't tried it yet, but will try to remember to report back when I find some time.
I was able to get ganglia working with php82 on centos7. I made the following changes.
file: /usr/share/ganglia/ganglia.php
Line 353 - 355 commented out this
//if ( in_array($context, $SKIP_GMETAD_CONTEXTS) ) { // return TRUE; //}
file: /usr/share/ganglia/ganglia/functions.php line 732 - changed 'continue' to 'break' as described in https://github.com/ganglia/ganglia-web/pull/368
file: /usr/share/ganglia/ganglia/lib/common_api.php line 18: changed funciton to have only the first 4 variables. 18 //function ganglia_api_error_handler ($no, $str, $file, $line, $context) { //old version 19 function ganglia_api_error_handler ($no, $str, $file, $line) {
Additional: PHP Fatal error: Uncaught Error: Undefined constant "LOCALTIME"
in file: cluster_view.php
can be fixed by replacing: $cluster[LOCALTIME]
with $cluster['LOCALTIME']
in line 617 and 765.
Check for the error log file $ vi /var/log/httpd/error_log
$ vi /usr/share/ganglia/dwoo/plugins/builtin/blocks/if.php -> on line 41 change while loop with foreach loop //while (list($k,$v) = each($params)) { foreach ($params as $k => $v) { $ vi /usr/share/ganglia/dwoo/Dwoo/Compiler.php -> On line 3044 change while loop with foreach loop //while (list($k,$v) = each($map)) { foreach ($map as $k => $v) { $ vi /usr/share/ganglia/cluster_view.php -> On line 617 change LOCALTIME to 'LOCALTIME'
After applying all the above-mentioned changes to the appropriate files in an installation of Ganglia on Debian 12, there is now still one error appearing in /var/log/apache2/error.log
:
PHP Fatal error: Uncaught Error: Call to undefined function each() in /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php:2530\nStack trace:\n#0 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php(1427): Dwoo_Compiler->parseOthers()\n#1 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php(1674): Dwoo_Compiler->parse()\n#2 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php(1365): Dwoo_Compiler->parseFunction()\n#3 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php(805): Dwoo_Compiler->parse()\n#4 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Template/String.php(369): Dwoo_Compiler->compile()\n#5 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Core.php(373): Dwoo_Template_String->getCompiledTemplate()\n#6 /usr/share/ganglia-webfrontend/dwoo/Dwoo/Core.php(299): Dwoo_Core->get()\n#7 /usr/share/ganglia-webfrontend/header.php(449): Dwoo_Core->output()\n#8 /usr/share/ganglia-webfrontend/index.php(38): include_once('...')\n#9 {main}\n thrown in /usr/share/ganglia-webfrontend/dwoo/Dwoo/Compiler.php on line 2530
The line 2530 in /dwoo/Dwoo/Compiler.php
reads:
while (list($k,$char) = each($breakChars)) {
so, I assume it needs to be re-written as a foreach
as well?
Maybe foreach ($breakChars as $k => $char) {
if it follows the same logic as the above? Sorry, I don't know any PHP ;)
EDIT: Yup, that worked!
Thank you all ! its is fixed now in PR #376, which has include some of your fix. it can be easy tested by the rpm files in epel now.
@berlin2123 Is this change already available on epel? what version are we looking for exactly?
yes,verssion >= *-48 , you can check the changelog in epel build system or src
So what I did before was applying all the above mentioned patches to the PHP code with ganglia-web 3.7.5-40 on RHEL9. This still had some issues but I already could see the UI and my data was showing. After updating to 3.7.6-48, It fiddled with my configured apache settings for ganglia, so I set those back correctly but then I again ran into the argument issue where there are 4 expected and 5 given.
So is it possible that the changes are not yet available in that version/release?
you need show the details of that issue.
find isuse >> check >> fix >> finally may send a Pull requests in this repository
Apparently, I was doing something wrong on my end. Had confliciting versions/releases installed with different related packages (gmetad gmond web). When all of these have the same release of -48 this should work. Also had to note that /var/lib/ganglia/rrds should be owned by nobody instead of ganglia (which was in the past so I think?)
There seem to be multiple fixes required for compatibility with PHP 8.0.3. It starts with:
It seems the fifth argument to
set_error_handler()
was deprecated a while back, and is now removed in PHP 8. After that: