Dataquery (ex cactiquery) 1.0a released

Announcements concerning Plugins for Cacti

Moderators: Moderators, Developers

Author
Message
User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

Dataquery (ex cactiquery) 1.0a released

#1 Post by pestilence » Tue Oct 31, 2006 7:15 pm

Its my joy to announce you the initial release of the dataquery plugin.
Dataquery is the predecesor of the old cactiquery addon, it has been ported to the plugin architecture for easy installation and troubleshooting.
/* * 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);

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#2 Post by pestilence » Tue Oct 31, 2006 7:16 pm

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

User avatar
egarnel
Cacti Pro User
Posts: 703
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

#3 Post by egarnel » Wed Nov 01, 2006 12:27 pm

Cool, thanks for bringing this back. It is an awesome util

One quick fix, however:

In the file queryview.php under <cacti dir>/plugins/dataquery/view

Line 169 needs a trailing slash after csv

before:

Code: Select all

$filename = $config['url_path'] . 'plugins/dataquery/csv
after:

Code: Select all

$filename = $config['url_path'] . 'plugins/dataquery/csv[b]/[/b]
Took me a little bit to figure out how to use the plugin until I realized that there was a new icon next to the graphs
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#4 Post by pestilence » Wed Nov 01, 2006 4:47 pm

Thanks for mentioning, i have uploaded an updated version.
/* * 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);

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#5 Post by pestilence » Wed Nov 01, 2006 6:37 pm

Site for cactiquery:

http://pestilence.insert.gr

The webdev.insert.gr is not yet online.
/* * 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);

Exo7
Cacti User
Posts: 135
Joined: Wed Jul 13, 2005 4:50 pm

#6 Post by Exo7 » Wed Nov 01, 2006 6:38 pm

Hi Pestilence. Thanks for your work on pluginizing cactiquery!

I have found it actually requires plugin architecture 1.0 : I had Plugin Architecture 0.9, and as soon as I enable dataquery in config.php, I have this little error showing up in each page of cacti :

Code: Select all

Notice: Undefined index: graph.php:zoom in /usr/share/cacti/site/lib/functions.php on line 1357
which is

Code: Select all

 /* find the current page in the big array */
        $current_array = $nav{$current_page . ":" . $current_action};
the part "graph.php:zoom" of the error change depending on the page I am browsing in Cacti, but the error is always located in this line 1357 of function.php. The tab "dataquery" next to the "misc" tab in the settings page was ok.

When upgraded to plugin arch 1.0, the error vanish and the little icon for querying graph appear :) I think you use one of the few hooks added between 0.9 and 1.0.
Well, it was time for to upgrade to 1.0 anyway ;)

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#7 Post by pestilence » Thu Nov 02, 2006 3:12 am

Gonna check your reportings.
Thanks for the feedback.
/* * 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);

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#8 Post by pestilence » Thu Nov 02, 2006 3:59 am

New version has been uploaded (0.1.2a)
/* * 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);

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#9 Post by pestilence » Thu Nov 02, 2006 4:05 am

Exo7 wrote:Hi Pestilence. Thanks for your work on pluginizing cactiquery!

I have found it actually requires plugin architecture 1.0 : I had Plugin Architecture 0.9, and as soon as I enable dataquery in config.php, I have this little error showing up in each page of cacti :

Code: Select all

Notice: Undefined index: graph.php:zoom in /usr/share/cacti/site/lib/functions.php on line 1357
which is

Code: Select all

 /* find the current page in the big array */
        $current_array = $nav{$current_page . ":" . $current_action};
the part "graph.php:zoom" of the error change depending on the page I am browsing in Cacti, but the error is always located in this line 1357 of function.php. The tab "dataquery" next to the "misc" tab in the settings page was ok.

When upgraded to plugin arch 1.0, the error vanish and the little icon for querying graph appear :) I think you use one of the few hooks added between 0.9 and 1.0.
Well, it was time for to upgrade to 1.0 anyway ;)
Yes indeed the plugin makes use from one of the new hooks that where added to the graph page :)
/* * 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);

torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

#10 Post by torstentfk » Thu Nov 02, 2006 5:44 am

Hi,

I have plugin arch V1. and the newest dataquery:
Error:
On the graph Page at the top:
Notice: Undefined index: graph_view.php:tree in /var/www/html/cacti/lib/functions.php on line 1420
"
1419 /* find the current page in the big array */
1420 $current_array = $nav{$current_page . ":" . $current_action};
1421 $current_mappings = split(",", $current_array["mapping"]);
1422 $current_nav = "";
"

and:

After clicking the arrow near the graph to get into the query, I get serveral times:
Notice: A non well formed numeric value encountered in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 226
"
225 $this->_set_date_format();
226 $timestamp = date($this->graph_date, $timestamp);
227 $data = ($matches[1][$j] * (pow(10,(float)$matches[2][$j])));
228 if (isset($timestamp)
"
But the query works.

Where can I configure the timerange the query is using?

Torsten

torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

#11 Post by torstentfk » Thu Nov 02, 2006 5:48 am

Hi,

at the point to export to csv I get:

Notice: A non well formed numeric value encountered in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 226
class_cactiquery::_open_buffer: Could not open file: /var/www/html/cacti/csvdcimgt21-UnixProcesses.csv for writting
Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 354

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 377

The CSV directory is empty.

Torsten

User avatar
pestilence
Cacti User
Posts: 207
Joined: Fri Jul 25, 2003 10:37 am
Location: Athens/Greece
Contact:

#12 Post by pestilence » Thu Nov 02, 2006 7:27 am

Hmm i will try to debug, allthough its working correctly on 2 boxes...
/* * 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);

User avatar
egarnel
Cacti Pro User
Posts: 703
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

#13 Post by egarnel » Thu Nov 02, 2006 10:05 am

torstentfk wrote:Hi,

at the point to export to csv I get:

Notice: A non well formed numeric value encountered in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 226
class_cactiquery::_open_buffer: Could not open file: /var/www/html/cacti/csvdcimgt21-UnixProcesses.csv for writting
Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 354

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/html/cacti/plugins/dataquery/class_cactiquery.php on line 377

The CSV directory is empty.

Torsten
This sounds like a permissions issue. your web user (apache, nobody,etc) should have ownership & group on the dir typically 755
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey

torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

#14 Post by torstentfk » Thu Nov 02, 2006 10:08 am

egarnel wrote:
torstentfk wrote:Hi,

....
The CSV directory is empty.

Torsten
This sounds like a permissions issue. your web user (apache, nobody,etc) should have ownership & group on the dir typically 755
Hi,
ls -al
drwxrwxr-x 2 apache apache 4096 Nov 2 10:24 csv/

so the apache has all rights to do so.

Torsten

User avatar
egarnel
Cacti Pro User
Posts: 703
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

#15 Post by egarnel » Thu Nov 02, 2006 10:10 am

torstentfk wrote:
egarnel wrote:
torstentfk wrote:Hi,

....
The CSV directory is empty.

Torsten
This sounds like a permissions issue. your web user (apache, nobody,etc) should have ownership & group on the dir typically 755
Hi,
ls -al
drwxrwxr-x 2 apache apache 4096 Nov 2 10:24 csv/

so the apache has all rights to do so.

Torsten
what are the perms for the dataquery above csv?
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey

Post Reply