pnp4nagios / pnp4nagios

PNP is an addon to NagiosCore which analyzes performance data provided by plugins and stores them automatically into RRD-databases. PNP= Pnp is Not Perfparse. Perfparse is first parsing tool in Nagios 0.x
https://github.com/pnp4nagios/pnp4nagios
GNU General Public License v2.0
11 stars 5 forks source link

Creation of dynamic property Popup_Controller::$imgwidth is deprecated #70

Open midi123 opened 2 months ago

midi123 commented 2 months ago

Describe the bug After fresh install of pnp4nagios on the page: /pnp4nagios/index.php/popup?host=&srv= page the error appears:

Creation of dynamic property Popup_Controller::$imgwidth is deprecated
application/controllers/popup.php [29]:

To Reproduce Steps to reproduce the behavior:

  1. Install https://github.com/pnp4nagios/pnp4nagios/releases/tag/v0.6.27-5
  2. Go to: /pnp4nagios/index.php/popup?host=&srv=
  3. See error

Expected behavior Graph with content.

Screenshots image

Desktop (please complete the following information): NagiosCore: 4.5.3 OS: Linux raspberrypi 6.6.31+rpt-rpi-v7 Raspbian (2024-05-29) armv7l Browser: Edge pnp4nagios: https://github.com/pnp4nagios/pnp4nagios/releases/tag/v0.6.27-5 PHP version: PHP 8.2.7 (cli) (built: Jul 20 2023 18:02:54) (NTS)

midi123 commented 2 months ago

The solution is:

edit: /share/application/controllers/popup.php and change:

class Popup_Controller extends System_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->template          = $this->add_view('popup');
    }

into:

class Popup_Controller extends System_Controller
{
    public $imgwidth;
    public function __construct()
    {
        parent::__construct();
        $this->template          = $this->add_view('popup');
    }
sistemmsn commented 2 months ago

Hello, then we assume it can work in PHP 8.2, currently I have 8.1 because it gave problems