Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jul 20, 2017 1:46 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: Thu Feb 01, 2007 7:03 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
Pestilence,

What I was thinking was the end all for Data Query was to take the Graph Syntax and remove all of the AREA, LINE, GPRINT, etc from the syntax and then export the results and display them. I would use the rrdtool export function to perform this. Then the results would appear in XML format, so it would simply be a matter of reformatting (in this version of Cacti) and displaying the results.

Is this what you are currently doing?

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 9:03 am 
Offline
Cacti User
User avatar

Joined: Fri Jul 25, 2003 10:37 am
Posts: 207
Location: Athens/Greece
TheWitness wrote:
Pestilence,

What I was thinking was the end all for Data Query was to take the Graph Syntax and remove all of the AREA, LINE, GPRINT, etc from the syntax and then export the results and display them. I would use the rrdtool export function to perform this. Then the results would appear in XML format, so it would simply be a matter of reformatting (in this version of Cacti) and displaying the results.

Is this what you are currently doing?

TheWitness


The plugin queries the datasource for the values of a specified time period, then it takes the output and formats it to a spreadsheet compatible format, adding a title, timestamp, and the datasources available.
So i suppose it does do the same thing you are mentioning although in a different manner.
I would be interested to see that version, so be my guest :)

_________________
/* * 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);


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 10:36 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
Ok, time permitting. Working with Gilles on Manage at the moment.

Larry

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Bugfix - dataquery times
PostPosted: Mon Mar 05, 2007 1:09 pm 
Offline

Joined: Mon Feb 12, 2007 6:17 pm
Posts: 26
Location: Bay Area, CA
I noticed when using this that on "normal" i.e. not zoomed graph pages, it doesn't pick up the time range correctly. Here's a patch to make it do that.

I did a bit of digging into why it doesnt show all the datasources on a graph. It turns out that the dataquery picks up all the datasources for a graph, but it sets a single variable to be the last datasource it found, and generates the view based on that. I think the correct solution is that the controller should iterate both the dataquery's datasource processing and the view processing of each datasource. That way if we want to redo the logic on processing multiple datasources, we're only messing with the controller level.

What I'm really interested in getting from this is the ability to look at the data being graphed prior to graph pages being generated. If we can do that, we can sort graphs on a page based on the data they contain. Once I fix the datasource issue, I'll probably start in on that :)

Code:
--- setup.php.old       2006-11-03 06:58:03.000000000 -0800
+++ setup.php   2007-03-05 09:56:21.000000000 -0800
@@ -131,18 +131,26 @@
        {
                $start=$_REQUEST["graph_start"];
        } else {
-               $_REQUEST["graph_start"] = "";
-               $start = time() - 3600;
+        if ( !empty($_SESSION["sess_current_date1"]) ) {
+          $start = strtotime( $_SESSION["sess_current_date1"] );
+        } else {
+                 $_REQUEST["graph_start"] = "";
+                 $start = time() - 3600;
+        }
        }

        if ((isset($_REQUEST["graph_end"])) && (!empty($_REQUEST["graph_end"])))
        {
                $end=$_REQUEST["graph_end"];
        } else {
-               $_REQUEST["graph_end"] = "";
-               $end = time();
+        if ( !empty($_SESSION["sess_current_date1"]) ) {
+          $end = strtotime( $_SESSION["sess_current_date2"] );
+        } else {
+                 $_REQUEST["graph_end"] = "";
+                 $end = time();
+        }
        }
        print '<a href="' .  $config['url_path'] . 'plugins/dataquery/dataquery.php?action=query&local_graph_id='.$local_graph_id.'&rra_id='.$rra_id.'&view_type='.$view_type.'&graph_start=' . $start . '&graph_end=' . $end . '"><img src="' . $config['url_path'] . 'plugins/dataquery/images/graph_query.png" border="0" alt="Query Graph" title="Query Graph" style="padding: 3px;"></a><br>';
}

-?>
\ No newline at end of file
+?>


Top
 Profile  
 
 Post subject: Re: Bugfix - dataquery times
PostPosted: Tue Mar 06, 2007 3:05 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
rbecker wrote:
I noticed when using this that on "normal" i.e. not zoomed graph pages, it doesn't pick up the time range correctly. Here's a patch to make it do that....
This was on purpose. I discussed this effect some time ago with the developer ...
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 4:54 pm 
Offline

Joined: Mon Feb 12, 2007 6:17 pm
Posts: 26
Location: Bay Area, CA
Hrmm. On purpose?

Too bad it wasn't documented, and nor was how to get the full information. Without documentation, I think the intuitive route is much more appropriate.

I'm not sure I see the reason to return partial information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 10:25 am 
Offline
Cacti User
User avatar

Joined: Fri Jul 25, 2003 10:37 am
Posts: 207
Location: Athens/Greece
rbecker wrote:
Hrmm. On purpose?

Too bad it wasn't documented, and nor was how to get the full information. Without documentation, I think the intuitive route is much more appropriate.

I'm not sure I see the reason to return partial information.


There is a reason...leave your timespan to a huge period and watch the system resources go down ;)
I left it intentional like that to avoid this kind of behaviour, i accidently had this done once and my cacti server just crawled. :)

_________________
/* * 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);


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 2:00 am 
Offline
Cacti User

Joined: Sun May 27, 2007 5:42 pm
Posts: 170
First of all.. thanks for this wonderful plugin.

I now using:
Cacti Version - 0.8.7b
Plugin Architecture - 2.1
OS - openSUSE 10.3
Dataquery (dataquery - v0.1.4a)

But I found a few bugs that I not sure anyone reported it already or not.
Bugs are:
1. Dataquery version is wrong when display in "Host Info". It stated Dataquery (dataquery - v0.1.2a)
2. The suppose to be returning to cacti main page link is wrong in "[Dump to CSV ] [ Return ]".
3. The "File download link" still cannot work for virtual path in apache.

For #1 and #2 bug, I modified the existing v0.1.4a files of "setup.php" and "view/queryview.php"

For #3 bug, the situation is like this:
URL link to cacti is (e.g): http://123.123.123.123/cacti
Actual path for cacti in that system is (e.g): /usr/share/cacti
CSV Export Path in settings are (e.g.): /usr/share/cacti/plugins/dataquery/csv/

By configuring the above setting, I can see the "Dump to CSV" and also can see the actual file store in:
/usr/cacti/plugins/dataquery/csv/
But when click "Download", the Apache reject that link because it actually link to the actual directory path instead. (It became http://123.123.123.123/usr/share/cacti/ ... heFile.csv

I tried configure the CSV path to: "/cacti/plugins/dataquery/csv/", and it is worse because I can't see the "[Dump to CSV ] [ Return ]".

Thus, to walk around this problem, I do this:
1. I create a symbolic link of "ln -s /usr/cacti /cacti"
2. Configure CSV Export Path to "/cacti/plugins/dataquery/csv/"
and it work :)

SH


Attachments:
0.1.4a_Modified.zip [4.09 KiB]
Downloaded 283 times
Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2008 8:56 am 
Offline

Joined: Wed Jun 18, 2008 4:24 am
Posts: 8
Hi,

Is there a way to show multiple datasources?

I have the following graph:

Code:
/opt/rrdtool/bin/rrdtool graph - \
--imgformat=PNG \
--start=-14400 \
--end=-300 \
--title="RGS WL App Connections" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/opt/cacti-0.8.7/rra/apache_to_weblogic_rgs_rgswebtoappconapp01_2251.rrd":RGSWebtoAppConapp01:AVERAGE \
DEF:b="/opt/cacti-0.8.7/rra/apache_to_weblogic_rgs_rgswebtoappconapp02_2252.rrd":RGSWebtoAppConapp02:AVERAGE \
DEF:c="/opt/cacti-0.8.7/rra/apache_to_weblogic_rgs_rgswebtoappconapp03_2253.rrd":RGSWebtoAppConapp03:AVERAGE \
DEF:d="/opt/cacti-0.8.7/rra/apache_to_weblogic_rgs_rgswebtoappconapp04_2254.rrd":RGSWebtoAppConapp04:AVERAGE \
LINE1:a#FF0000:"App01"  \
GPRINT:a:LAST:"%8.2lf %s"  \
LINE1:b#00CF00:"App02"  \
GPRINT:b:LAST:"%8.2lf %s"  \
LINE1:c#0000FF:"App03"  \
GPRINT:c:LAST:"%8.2lf %s"  \
LINE1:d#FF00FF:"App04"  \
GPRINT:d:LAST:"%8.2lf %s"


When I click the button for dataquery it only shows data for the first data source.

Is there a way to get it to show all of them?


Top
 Profile  
 
 Post subject: Re: Dataquery (ex cactiquery) 1.0a released
PostPosted: Fri Oct 28, 2011 10:10 pm 
Offline

Joined: Fri Oct 28, 2011 8:50 pm
Posts: 19
If someone want to see the decimal fraction, may modify the line 106 and 108 of queryview.php

the origin:
$value = @sprintf("%8.0lf",$value);

the changed:
$value = @sprintf("%g",$value);

p.s. similarly, the line 342 and 344 in class_cactiquery.php


Last edited by jet755 on Fri Oct 28, 2011 10:35 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Dataquery (ex cactiquery) 1.0a released
PostPosted: Fri Oct 28, 2011 10:28 pm 
Offline

Joined: Fri Oct 28, 2011 8:50 pm
Posts: 19
If someone want to dump .csv file for Excel with individual columns, may modify the line 326 and 346 in class_cactiquery.php

the origin:
$string .= ';' . $column;
$string .= ';'.$value;

the changed:
$string .= ',' . $column;
$string .= ','.$value;


Top
 Profile  
 
 Post subject: Re: Dataquery (ex cactiquery) 1.0a released
PostPosted: Thu Mar 16, 2017 11:45 am 
Offline

Joined: Thu Mar 16, 2017 11:33 am
Posts: 1
Hi,

at the point to export to csv I get:
/usr/bin/php /usr/share/cacti/export/gen_salida.php:
<?php
chdir('./csv');
include_once("../../include/global.php");
include_once("../../lib/rrd.php");
include("class_cactiquery.php");

foreach ($graph_ids as $graph_id) {
$id = $graph_id["id"];
print "$id\n";
$Ccactiquery =& cactiquery::get_instance($id, 0,$desde ,$hasta , $type); **LINEA 43

When i run gen_salida.php:
PHP Strict Standards: Non-static method cactiquery::get_instance() should not be called statically in /usr/share/cacti/export/gen_salida.php on line 43
PHP Notice: Undefined index: data in /usr/share/cacti/export/class_cactiquery.php on line 342

help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 72 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group