Cactiquery-Cactistoric Release
Moderators: Developers, Moderators
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
Cactiquery-Cactistoric Release
Ok here goes the first release of cactistoric-cactiquery addon for cacti.
Thanks to Bruno once again for inspiring and his code.
Thanks to Bruno once again for inspiring and his code.
- Attachments
-
- cactiquery-cactistoric-0.8.5-0.02-en.tar.gz
- (33.41 KiB) Downloaded 910 times
Last edited by pestilence on Sat May 08, 2004 2:28 am, edited 1 time in total.
/* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code);
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi pestilence
thanks for combining cactiquery & cactistoric
I've tried it with Cacti 0.8.5a (Gentoo Linux, Apache 2.0.49, PHP 4.3.6RC2, MySQL 4.0.18, rrdtool 1.0.45) but it didn't work :
Here's the command that cactiquery was running :
Running this command by hand returned this :
I'm using the following RRAs :
and it worked :
I've then add a quick and dirty fix to lib/rrd.php :
before the line running rrdtool, and it works.
My second problem is that I can't export to a CSV file; here's what I get :
Do you know how to solve this ?
Many thanks in advance.
Edit : BTW, I don't have the drop down list "Type" as shown in your screenshot; is it normal / related to my problem ?
Regards,
Frédéric
thanks for combining cactiquery & cactistoric
I've tried it with Cacti 0.8.5a (Gentoo Linux, Apache 2.0.49, PHP 4.3.6RC2, MySQL 4.0.18, rrdtool 1.0.45) but it didn't work :
Code: Select all
No data was found for the given device and timespan
Code: Select all
rrdtool fetch /path/to/dir/file.rrd LAST -r 300 -s 1083477600 -e 1083564000
Code: Select all
ERROR: the RRD does not contain an RRA matching the chosen CF
So I've tried the following command :daily (modified to keep 51840 rows), with CF AVERAGE and MAX
weekly with CF AVERAGE and MAX
montly with CF AVERAGE and MAX
yearly with CF AVERAGE and MAX
Code: Select all
rrdtool fetch /path/to/dir/file.rrd AVERAGE -r 300 -s 1083477600 -e 1083564000
Code: Select all
cpu_idle
1082008800: 1.9531167991e+01
1082009100: 1.8342991318e+01
1082009400: 2.0238037904e+01
1082009700: 1.9606805113e+01
Code: Select all
$type = "AVERAGE";
My second problem is that I can't export to a CSV file; here's what I get :
Code: Select all
Notice: Undefined variable: regexps in /cacti/cacti-0.8.5a/lib/rrd.php on line 619
Viewing Query for 'Sauvegardes - Hermes - Consommation CPU'
Writting to file: /var/www/localhost/htdocs/cacti_csv/10.50.50.50-SteriaCPUidle.csv
Warning: Invalid argument supplied for foreach() in /cacti/cacti-0.8.5a/lib/rrd.php on line 656
Notice: Undefined index: values in /cacti/cacti-0.8.5a/lib/rrd.php on line 665
[Download][Return]
Notice: Undefined variable: regexps in /cacti/cacti-0.8.5a/lib/rrd.php on line 619
Many thanks in advance.
Edit : BTW, I don't have the drop down list "Type" as shown in your screenshot; is it normal / related to my problem ?
Regards,
Frédéric
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
I know this issue, i had a menu for allowing the user to choose if he wanted the values for Min, Last, Max or Average..but because i always use only with last values i removed it for practical purposes...if you want it i will add it in the next release of cactiquery.
Thanks for the response
Thanks for the response
/* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code);
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
My second problem is that I can't export to a CSV file; here's what I get :Do you know how to solve this ?Code: Select all
Notice: Undefined variable: regexps in /cacti/cacti-0.8.5a/lib/rrd.php on line 619 Viewing Query for 'Sauvegardes - Hermes - Consommation CPU' Writting to file: /var/www/localhost/htdocs/cacti_csv/10.50.50.50-SteriaCPUidle.csv Warning: Invalid argument supplied for foreach() in /cacti/cacti-0.8.5a/lib/rrd.php on line 656 Notice: Undefined index: values in /cacti/cacti-0.8.5a/lib/rrd.php on line 665 [Download][Return] Notice: Undefined variable: regexps in /cacti/cacti-0.8.5a/lib/rrd.php on line 619
Many thanks in advance.
Edit : BTW, I don't have the drop down list "Typ
e" as shown in your screenshot; is it normal / related to my problem ?
Regards,
Frédéric
I am looking for your problem right now, i will try to find out why you get this error.
/* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code);
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
In fact my 2 problems where related; I've changedto
in cactiquery.php, and now I can export to CSV
Code: Select all
print " <tr><td colspan='3' align='center'><strong>[<a href='cactidump.php?local_graph_id=$local_graph_id&rra_id=$rra_id&query_start=$query_start&query_end=$query_end&typeq=LAST'>Dump to CSV</a>]</strong></td></tr>";
Code: Select all
print " <tr><td colspan='3' align='center'><strong>[<a href='cactidump.php?local_graph_id=$local_graph_id&rra_id=$rra_id&query_start=$query_start&query_end=$query_end&typeq=AVERAGE'>Dump to CSV</a>]</strong></td></tr>";
Cacti-query/Cactistoric messed up my Interface traffic graph
Hello,
After installing cactiquery-cactistoric, I am unable to get graphs for traffic on my interfaces.
Cacti - 0.8.5a
Win 2K server
IIS5
Perl 5.8
Mysql
PHP
Errors: From the "source link":
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 735
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 739
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 743
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=end-86400 \
--end=1083714093 \
COMMENT:"From 2004-05-03 19:41:33 to 2004-05-04 19:41:33\c" \
COMMENT:"Graph Generated at 2004-05-04 19:41:33\c" \
--title="Cisco3640 - Traffic - Se0/0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="C\:\Inetpub\wwwroot\cacti-0.8.5a/rra/cisco3640_traffic_in_42.rrd":traffic_in:AVERAGE \
DEF:b="C\:\Inetpub\wwwroot\cacti-0.8.5a/rra/cisco3640_traffic_in_42.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total In: 0 bytes\n" \
LINE1:cdeff#002A97:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdeff:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total Out: 0 bytes"
What is wrong here? I have changed the rows for all the .rrd files. Infact I deleted my old .rrd files and started off brand new.
----------------------------------------------------------------------------
2. I tried to use the cactiquery on other graph that I was getting but the query did not give any data. I saw the post by "fmangeant" where he said adding the line "$type = "AVERAGE"; solved the problem. It did not for me. Could some one please tell me where to add the line? Or "pestilence" is it possible for you to send me the php file with the menu that let users choose what values they wanted to - min, max, average or last?
Thank you in advance for any help
Take care
Deepak
After installing cactiquery-cactistoric, I am unable to get graphs for traffic on my interfaces.
Cacti - 0.8.5a
Win 2K server
IIS5
Perl 5.8
Mysql
PHP
Errors: From the "source link":
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 735
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 739
Notice: Undefined offset: 2 in C:\Inetpub\wwwroot\cacti-0.8.5a\lib\rrd.php on line 743
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=end-86400 \
--end=1083714093 \
COMMENT:"From 2004-05-03 19:41:33 to 2004-05-04 19:41:33\c" \
COMMENT:"Graph Generated at 2004-05-04 19:41:33\c" \
--title="Cisco3640 - Traffic - Se0/0" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
DEF:a="C\:\Inetpub\wwwroot\cacti-0.8.5a/rra/cisco3640_traffic_in_42.rrd":traffic_in:AVERAGE \
DEF:b="C\:\Inetpub\wwwroot\cacti-0.8.5a/rra/cisco3640_traffic_in_42.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdeff=b,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total In: 0 bytes\n" \
LINE1:cdeff#002A97:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdeff:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total Out: 0 bytes"
What is wrong here? I have changed the rows for all the .rrd files. Infact I deleted my old .rrd files and started off brand new.
----------------------------------------------------------------------------
2. I tried to use the cactiquery on other graph that I was getting but the query did not give any data. I saw the post by "fmangeant" where he said adding the line "$type = "AVERAGE"; solved the problem. It did not for me. Could some one please tell me where to add the line? Or "pestilence" is it possible for you to send me the php file with the menu that let users choose what values they wanted to - min, max, average or last?
Thank you in advance for any help
Take care
Deepak
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
New cactiquery-cactistoric release.
I have fixed the issue with the form, now you can select what you want to query from the Data source (MIN,LAST,MAX,AVERAGE).
I have fixed the issue with the form, now you can select what you want to query from the Data source (MIN,LAST,MAX,AVERAGE).
- Attachments
-
- cactiquery-cactistoric-0.8.5-0.02-en.tar.gz
- (33.41 KiB) Downloaded 745 times
Last edited by pestilence on Fri May 07, 2004 4:01 am, edited 1 time in total.
/* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code);
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Hi pestilence
thanks for this new release
I had an error when exporting to CSV :
There seems to miss one bracket :
instead of
And could you just add one line in include/config_arrays.php :
instead of
Thanks in advance.
Frédéric
thanks for this new release
I had an error when exporting to CSV :
Code: Select all
Parse error: parse error, unexpected ')', expecting ']' in /cacti/cacti-0.8.5a/cactidump.php on line 89
Code: Select all
if(isset($_GET['typeq'))
Code: Select all
if(isset($_GET['typeq']))
Code: Select all
$hash_version_codes = array(
"0.8.4" => "0000",
"0.8.5" => "0001",
"0.8.5a" => "0002"
);
Code: Select all
$hash_version_codes = array(
"0.8.4" => "0000",
"0.8.5" => "0001"
);
Frédéric
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
error
Pestilence.
I upgraded cacti from 0.8.4 to 0.8.5a and installed cactiquery as per the instruction.Now when I click the [Zoom] or [Query] button on interface. I get the following error.
Zoom
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactistoric.php on line 265
Query
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactiquery.php on line 245
Any clue..
Karunesh
I upgraded cacti from 0.8.4 to 0.8.5a and installed cactiquery as per the instruction.Now when I click the [Zoom] or [Query] button on interface. I get the following error.
Zoom
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactistoric.php on line 265
Query
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactiquery.php on line 245
Any clue..
Karunesh
__Kårunesh__
- pestilence
- Cacti User
- Posts: 207
- Joined: Fri Jul 25, 2003 10:37 am
- Location: Athens/Greece
- Contact:
Re: error
Thats wierd that lines mark the EOF of each file. Gonna check it again tonight...karunesh wrote:Pestilence.
I upgraded cacti from 0.8.4 to 0.8.5a and installed cactiquery as per the instruction.Now when I click the [Zoom] or [Query] button on interface. I get the following error.
Zoom
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactistoric.php on line 265
Query
------
Parse error: parse error, unexpected $ in /var/www/html/cacti/cactiquery.php on line 245
Any clue..
Karunesh
/* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code);
graph crop
One more issue.When I run the following script to resize the existing rrd graphs from 600 to 17280 rows, it resizes the rrd but unfortunatly it deleted the rrd data earlier then 2 weeks.I lost the data older then 2 weeks .
for f in `find . -maxdepth 1 -name \*\.rrd`
do
echo "-- Working on $f"
echo " Growing RRA 0"
rrdtool resize $f 0 GROW 16680
mv resize.rrd $f
echo " Growing RRA 4"
rrdtool resize $f 4 GROW 16680
mv resize.rrd $f
echo "Done."
done
What happen to my old data .
for f in `find . -maxdepth 1 -name \*\.rrd`
do
echo "-- Working on $f"
echo " Growing RRA 0"
rrdtool resize $f 0 GROW 16680
mv resize.rrd $f
echo " Growing RRA 4"
rrdtool resize $f 4 GROW 16680
mv resize.rrd $f
echo "Done."
done
What happen to my old data .
__Kårunesh__
Allow me to redirect you to a thread that will hopefully come to some conclusions about how to resolve this. From what I read, when you're adding A LOT of rows to your RRA's (such as you do here) it can cause consolidation problems when you try and graph the data. This is due to the large amounts of rows that contains "NaN" that have been added. It is best to resize the RRA's a little every week or two. Quite a pain, but hopefully we'll come up with a better solution.
http://www.raxnet.net/board/viewtopic.php?t=4038
Perhaps this can clear some things up (Referenced from: http://www.ee.ethz.ch/~slist/rrd-users/msg05809.html )
http://www.raxnet.net/board/viewtopic.php?t=4038
Perhaps this can clear some things up (Referenced from: http://www.ee.ethz.ch/~slist/rrd-users/msg05809.html )
It probably couldn't hurt to comb the list archives: http://www.ee.ethz.ch/~slist/If you add rows to the 5-minute RRA these rows will contain NaN values.
If you add enough rows to satisfy a request for a complete year, you
will fetch the 5-minute rows and thus see unknown data. You expect to
see known data thus RRDtool doesn't seem to match your expectations.
This can be circumvented: If you ask for "--end hh:mm" "--start
end-365days"
where "hh:mm" is midnight UTC represented in your local time, RRDtool
will use the original 1-day RRA and thus will not use the freshly added
5-minute rows.
In general: RRDtool will try to match your request as close as possible.
For MRTG-compatible RRDs this means RRDtool won't use the "daily" RRA
to graph a full year. It cannot use the "weekly" or "monthly" RRAs
either so the only choice is to use the "yearly" RRA.
If you alter the amount of rows in the "daily" RRA to, for instance,
120000 rows (more than a year) RRDtool has to choose between the
"daily" RRA and the "yearly" RRA as both contain enough rows to
satisfy your request. RRDtool will then look at the start and end
time of the data to fetch. The "yearly" RRA contains rows that start
and end on 00:00 UTC. The "daily" RRA contains rows that start and
end on multiples of 5 minutes.
If you request "now" it is highly likely the "daily" RRA will be
selected. If you request n*86400 (for example: 1040947200) as the
end time and "--start end-400days" for the start time, RRDtool will
select the "yearly" RRA.
Who is online
Users browsing this forum: No registered users and 0 guests