Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 405 forks source link

Realtime graphs not working properly #1744

Closed sam-san91 closed 6 years ago

sam-san91 commented 6 years ago

`PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function rrdtool_function_create(), 2 passed in /var/lib/cacti/poller_realtime.php on line 215 and at least 3 expected in /var/lib/cacti/lib/rrd.php:475 Stack trace:

0 /var/lib/cacti/poller_realtime.php(215): rrdtool_function_create('124826', true)

1 /var/lib/cacti/poller_realtime.php(159): process_poller_output_rt(Resource id #37, '743e75c6uagan8b...', 5)

2 {main}

thrown in /var/lib/cacti/lib/rrd.php on line 475 `

After the latest commits the realtime graphes won't work properly because the rrd files can't get created. I suspect this has something to do with #1710

netniV commented 6 years ago

The problem is with the following two files:

datasource.php:
<pre><?php print @rrdtool_function_create(get_request_var('id'), true);?></pre>
poller_realtime.php:
$command = @rrdtool_function_create($item['local_data_id'], true);

Neither are supplying the $initial_time field that was added and non-optional. I think a quick workaround would be to change the parameter to be optional with $initial_time = time() but that will require reordering of the parameters too. I'll create a PR for this later today, for now, if you find the two above lines and change , true to , time(), true this could be a temporary workaround but I'm not 100% clear on if that's the right thing to do.

cigamit commented 6 years ago

This should be resolved now. Thanks for reporting.