Hello all,
I’m new to icinga, I have installed icinga2 on Ubuntu Server 22.04 and all running well, now I have enabled graphite but I still have error instead of graphics, errors are like those ones:
icinga2 - The Icinga 2 network monitoring daemon (version: r2.14.0-1)
Copyright (c) 2012-2023 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
System information:
Platform: Ubuntu
Platform version: 22.04.3 LTS (Jammy Jellyfish)
Kernel: Linux
Kernel version: 5.15.0-86-generic
Architecture: x86_64
Build information:
Compiler: GNU 11.3.0
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
Application information:
General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2
Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var
Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
php -v
PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies
What could be the issue? How can I fix it?
Thanks in advance,
Alessandro
Deprecated : Calling static trait method Icinga\Module\Graphite\Forms\TimeRangePicker\TimeRangePickerTrait::getRelativeRangeParameter is deprecated, it should only be called on a class using the trait in**/usr/share/icingaweb2/modules/graphite/library/Graphite/Web/Widget/Graphs.php**
Deprecated : Calling static trait method Icinga\Module\Graphite\Forms\TimeRangePicker\TimeRangePickerTrait::getRelativeRangeParameter is deprecated, it should only be called on a class using the trait in**/usr/share/icingaweb2/modules/graphite/library/Graphite/Web/Widget/Graphs.php**
Deprecated
: Calling static trait method Icinga\Module\Graphite\Forms\TimeRangePicker\TimeRangePickerTrait::getDefaultRelativeTimeRange is deprecated, it should only be called on a class using the trait in
/usr/share/icingaweb2/modules/graphite/library/Graphite/Web/Widget/Graphs.php
Based on your PHP versions and the deprecation warnings, this seems to be related to the PHP 8.1 change making “calling a static method, or accessing a static property directly on a trait […] deprecated” (Traits, Static Trait Members section).
However, the code of the latest release, v1.2.4, does not exactly contain your errors. Git blaming similar sections got me to this commit, which seems to be included in releases v1.2.0 and newer.
Thus, I would kindly ask you to supply the version of the installed icingaweb2-module-graphite? If you are using an outdated version, please update.
Seems that there is icingaweb2-module-graphite 1.2.2 available in release 23.04 and newer. I’m still running 22.04, icingaweb2-module-graphite is 1.1.0-3. Maybe it’s a good reason to start planning an upgrade, if there is no other solution.
You can solve this by using the Icinga Package Repository for Ubuntu. While the Ubuntu 22.04 repositories are packaging the older version 1.1.0-3, the Icinga Package Repositories always ship the latest version.
Please follow the installation guide and take care when switching packages, as there is AFAIK no official migration path from distribution packages to the Icinga packages.
Without wanting to play the blame game, there seems to be incompatible packages being shipped by Ubuntu. Thus, if you want to keep this installation with the Ubuntu packages, you could also try to contact the Ubuntu package maintainer, mentioning the incompatibility.
I was pretty sure I had the icinga repo configured. Seems that icingaweb2-module-graphite is from the ubuntu repo, maybe it was left over from before somehow ?
Anyway, uninstalled it and installed icinga-graphite and icinga-graphite-web 1.2.4 (from icinga repo). I then started geeting errors “GuzzleHttp\ClientInterface::MAJOR_VERSION”, but I found out these were caused by pdfexport web module. Disabled it and all graphite graphs are back !
I’ll do some more digging see what else is left from the ubuntu repo and clear it. Thanks for your help Alvar.