NagVis / nagvis

Visualization addon for your open source monitoring core
http://nagvis.org/
GNU General Public License v2.0
115 stars 73 forks source link

Gadget graph_multi_lines.php error php7.4 (solved) [BUG] #363

Open T100D opened 9 months ago

T100D commented 9 months ago

We installed a new monitoring server where PHP is upgraded to version PHP 7.4.33 (cli) and run into a error with the gadget /graph_multi_lines.php

The error in /var/log/httpd/error.log:

PHP Warning:  time() expects exactly 0 parameters, 1 given in /usr/local/nagvis/share/userfiles/gadgets/graph_multi_
lines.php on line 103

we changed the code in graph_multi_lines.php from:

# Precommand -> basic settings for rrdtool
$precommand = 'graph - --disable-rrdtool-tag --imgformat PNG --start '.(time('')-$secondsback).' --end '.time('').' --height '.$height.' --width '.$width.' --title "'.$title.'" --vertical-label "'.$unit.'" --font DEFAULT:9:'.$font.'';

to:

# Precommand -> basic settings for rrdtool
$precommand = 'graph - --disable-rrdtool-tag --imgformat PNG --start '.(time()-$secondsback).' --end '.time().' --height '.$height.' --width '.$width.' --title "'.$title.'" --vertical-label "'.$unit.'" --font DEFAULT:9:'.$font.'';

and the problem was solved and gadget is working as desired. we tested it on our old environment (PHP 7.1.33 (cli)) and it is working there as well.