Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Hi everybody,
RRDtool provides a great feature : PREDICT.
Of course, you can use it in CDEFs but have then to rewrite your graphs to really enjoy it.
So I created a plugin, originally called predict which allows you to watch a datasource and its "normal" behaviour (calculated with RRDTool feature PREDICT) between 2 dates. The end date may be in the future... cacti as a fortune teller !
By the way, remember that PREDICT will just estimate a datasource basing on its previous values.
Beware, it works on datasources, not on graphs (maybe in a later version ???).
You can download it and see screenshots there : http://docs.cacti.net/userplugin:predict
Any remark/suggestion will be appreciated.
Tried out the plugin and I am getting an error when attempting to generate a graph. Any idea?
PHP Fatal error: Call to undefined function hash() in /usr/local/share/cacti/plugins/predict/predict_res.php on line 54" while reading response header from upstream
ok try to install php-hash
if you can't you may try to replace in line 54
$hash_calc = hash('md5', "$ds_id$date_start$date_end$tspan$units$win");
with
$hash_calc = "$ds_id$date_start$date_end$tspan$units$win";
This plugin doesn't seem to create any images in the tmp directory, nor can I see them in the console. I even set 777 rights on the relevant directories - still nothing - any thoughts ?
Cacti Version 0.8.8b Cacti OS Ubuntu LTS RRDTool Version RRDTool 1.4.7 Poller Information Type SPINE 0.8.8b
ERROR: invalid rpn expression in: 3600,-4,300,a,PREDICT
[Fri Nov 23 08:43:04 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/share/cacti/site/plugins/predict/tmp/f_test.png, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:43:06 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: Week in /usr/share/cacti/site/plugins/predict/predict.php on line 64, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:43:06 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: AREA in /usr/share/cacti/site/plugins/predict/predict.php on line 68, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:43:06 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: LINE2 in /usr/share/cacti/site/plugins/predict/predict.php on line 70, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:43:06 2012] [error] [client xxx.xxx.xxx.xxx] PHP Warning: unlink(tmp/f_test.png): No such file or directory in /usr/share/cacti/site/plugins/predict/predict.php on line 75, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:43:06 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /var/www/favicon.ico
ERROR: invalid rpn expression in: 3600,-4,300,a,PREDICT
[Fri Nov 23 08:43:07 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/share/cacti/site/plugins/predict/tmp/f_test.png, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
ERROR: Could not make sense out of '08:432012-11-24'
[Fri Nov 23 08:46:44 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/share/cacti/site/plugins/predict/tmp/f_62322012-11-22 08:432012-11-24 08:4336003300.png, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
ERROR: Could not make sense out of '08:432012-11-24'
[Fri Nov 23 08:46:57 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/share/cacti/site/plugins/predict/tmp/f_62322012-11-22 08:432012-11-24 08:4336003300.png, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:48:05 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: Week in /usr/share/cacti/site/plugins/predict/predict.php on line 64, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:48:05 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: AREA in /usr/share/cacti/site/plugins/predict/predict.php on line 68, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:48:05 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined index: LINE2 in /usr/share/cacti/site/plugins/predict/predict.php on line 70, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:48:05 2012] [error] [client xxx.xxx.xxx.xxx] PHP Warning: unlink(tmp/f_62322012-11-22 08:432012-11-24 08:4336003300.png): No such file or directory in /usr/share/cacti/site/plugins/predict/predict.php on line 75, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 08:48:05 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /var/www/favicon.ico
Cacti Version 0.8.8b Cacti OS Ubuntu LTS RRDTool Version RRDTool 1.4.7 Poller Information Type SPINE 0.8.8b
May be the issue is in my reply to exseven on 11/06 :
ok try to install php-hash
if you can't you may try to replace in line 54
$hash_calc = hash('md5', "$ds_id$date_start$date_end$tspan$units$win");
with
$hash_calc = "$ds_id$date_start$date_end$tspan$units$win";
The plugin was tested with php-hash. If you have it, it's better and keep line 54 in predict_res.php
If you have not, replace line 54 with something like $hash_calc = preg_replace('/\W/','',"$ds_id$date_start$date_end$tspan$units$win");
to avoid having special chars, I suppose that spaces in the temp filename was not a good idea, sorry !
[Fri Nov 23 10:43:18 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/share/cacti/site/plugins/predict/tmp/f_623220121122103720121124103736003300.png, referer: http://cactiserver/cacti/plugins/predict/predict_res.php
[Fri Nov 23 11:01:52 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined offset: 3 in /usr/share/audit/admin_pc_add_2.php on line 1744
[Fri Nov 23 11:01:52 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined offset: 4 in /usr/share/audit/admin_pc_add_2.php on line 1745
[Fri Nov 23 11:01:52 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined offset: 5 in /usr/share/audit/admin_pc_add_2.php on line 1746
[Fri Nov 23 11:01:52 2012] [error] [client xxx.xxx.xxx.xxx] PHP Notice: Undefined offset: 6 in /usr/share/audit/admin_pc_add_2.php on line 1747
Cacti Version 0.8.8b Cacti OS Ubuntu LTS RRDTool Version RRDTool 1.4.7 Poller Information Type SPINE 0.8.8b
New version available there : http://docs.cacti.net/_media/userplugin ... _0.1.3.zip
Fixes issues with ds names under windows especially colon in file name which could not let rrdtool graph work.
Thank you Praveen Kumar !