Icinga2 Graphite deprecated calling

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:

Here is my configuration:

icinga2 -V

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

1 Like

Hello,

I’m facing same issue, did you ever solve this ?

ubuntu 22.04
icinga2 2.12.1
PHP 8.1.2-1ubuntu2.18
icinga/icinga-php-library 0.14.0
icinga/icinga-php-thirdparty 0.12.1

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

Thanks to both of you for reporting this issue.

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.

Hi Alvar,

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.