New plugin: Predict (v0.1)
Moderators: Developers, Moderators
New plugin: Predict (v0.1)
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.
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.
Re: New plugin: Predict (v0.1)
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
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
Re: New plugin: Predict (v0.1)
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";
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";
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Re: New plugin: Predict (v0.1)
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
Re: New plugin: Predict (v0.1)
Please have a look in your http error_log file and tell me about.
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Re: New plugin: Predict (v0.1)
Does this help ?
Code: Select all
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
Re: New plugin: Predict (v0.1)
May be the issue is in my reply to exseven on 11/06 :
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 !
The plugin was tested with php-hash. If you have it, it's better and keep line 54 in predict_res.phpok 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";
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 !
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Re: New plugin: Predict (v0.1)
Already tried that, and your just posted suggestion, but still no image - sorry
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Re: New plugin: Predict (v0.1)
What does say the error_log now ?
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Re: New plugin: Predict (v0.1)
Code: Select all
[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
Re: New plugin: Predict (v0.1)
Solved upgrading rrdtool to 1.4.7
Re: New plugin: Predict (v0.1)
See attached v0.1.1 :
- Temporary file name now depends on php hash module installed or not
- Put default settings at plugin installation
It seems that RRDTOOL needs to be at least 1.4.x, even though I saw 1.3.x elsewhere
Thx to mcutting and Julio Vargas
- Temporary file name now depends on php hash module installed or not
- Put default settings at plugin installation
It seems that RRDTOOL needs to be at least 1.4.x, even though I saw 1.3.x elsewhere
Thx to mcutting and Julio Vargas
- Attachments
-
- predict-0.1.1.zip
- (55.57 KiB) Downloaded 254 times
Re: New plugin: Predict (v0.1)
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 !
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 !
Re: New plugin: Predict (v0.1)
Hello,
I´m trying to use this plugin because I think it is very interesting but I have the same problem, no graph appears when I execute it.
I have installed Predict 0.1.3 in Windows Server 2008 R2 Standard.
Do I need something else? Should I change something more?
Thanks in advance.
Regards,
Laura.
I´m trying to use this plugin because I think it is very interesting but I have the same problem, no graph appears when I execute it.
I have installed Predict 0.1.3 in Windows Server 2008 R2 Standard.
Do I need something else? Should I change something more?
Thanks in advance.
Regards,
Laura.
Re: New plugin: Predict (v0.1)
As seen with Laura, solved by changing rights ton tmp directory
Who is online
Users browsing this forum: No registered users and 2 guests