SQL Queries Result Graphs (Plugin + Templates + Script)
Moderators: Developers, Moderators
SQL Queries Result Graphs (Plugin + Templates + Script)
Hi there,
I'm quite new to Cacti and the Plugin Architecture and have just created my first complete Plugin which I wanted to share with you.
The Idea was, to Manage a set of files with a number of Queries from within Cacti to use them as a Datasource combined with a fitting Script and some fitting templates.
Before Setting up a new Graph, you can create a Queryfile with several Database Queries. In my Case I have some count(*) selects, to get the number of entries in specific tables.
When Setting up the Graph you can choose, which Queryfile to use, and how the Single Fields should be Called in the Graphs' description.
Please be aware that this is my first Plugin and that there is no warranty at all, but please also don't hesitate to post your comments.
-- Open Points --
The Update Plugin from Cactiusers.org always shows that there is an update available... don't have a clue why...
I'm quite new to Cacti and the Plugin Architecture and have just created my first complete Plugin which I wanted to share with you.
The Idea was, to Manage a set of files with a number of Queries from within Cacti to use them as a Datasource combined with a fitting Script and some fitting templates.
Before Setting up a new Graph, you can create a Queryfile with several Database Queries. In my Case I have some count(*) selects, to get the number of entries in specific tables.
When Setting up the Graph you can choose, which Queryfile to use, and how the Single Fields should be Called in the Graphs' description.
Please be aware that this is my first Plugin and that there is no warranty at all, but please also don't hesitate to post your comments.
-- Open Points --
The Update Plugin from Cactiusers.org always shows that there is an update available... don't have a clue why...
- Attachments
-
- Example of creating a Graph out of the Query File.
- cacti_sql2.jpg (92.83 KiB) Viewed 27218 times
-
- Screenshot of sqlqueries plugin
- cacti_sql.jpg (235.12 KiB) Viewed 28173 times
-
- sqlqueries_v_02.tar.gz
- Version 0.2 of sqlqueries Plugin
- (9.86 KiB) Downloaded 1550 times
Last edited by web_rene on Fri Nov 09, 2007 5:28 am, edited 4 times in total.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I strongly suggest that you look at things like Reinhard's poller statistics Template for accessing arbitrary data in SQL. I think it fit's better into that model.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Find it at http://forums.cacti.net/viewtopic.php?t ... statisticsTheWitness wrote:I strongly suggest that you look at things like Reinhard's poller statistics Template for accessing arbitrary data in SQL.
Reinhard
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I have rethought my position. However, I want this to be core. Are you prepared to take development direction and are you prepared to sign off on GPL?
Regards,
TheWitness
Regards,
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Sorry, I am so busy, I have lost track of things. Let me collect my thoughts. What is your locality (time zone)?
Larry
Larry
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
So, how's your noonish tomorrow sound. That would be about 7:00am my time? I would like to conduct a meeting using preferably Skype (I am TheWitness there too), or I can call Germany via Vonage pretty cheap.
PM me with your availability and contact information.
Larry
PM me with your availability and contact information.
Larry
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Update
Updated Versio
n
Now also compatible with Cacti 0.8.7
Could perhaps someone tell be how the Update-Plugin works, since it keeps telling me that there is an update available for my plugin!?
n
Now also compatible with Cacti 0.8.7
Could perhaps someone tell be how the Update-Plugin works, since it keeps telling me that there is an update available for my plugin!?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I have updated the Rosetta with your information thanks!!
http://forums.cacti.net/viewtopic.php?t=14985
TheWitness
http://forums.cacti.net/viewtopic.php?t=14985
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Hello, I tried your plugin, but I've got errors:
Nothing come on graph and cacti log give me
11/22/2007 06:15:06 PM - CMDPHP: Poller[0] Host[11] DS[384] CMD: c:/php/php.exe -q C:/Inetpub/wwwroot/cacti/scripts/mysql_query.php localhost 3306 'user' 'pw' 'example.sql', output: U
11/22/2007 06:15:06 PM - CMDPHP: Poller[0] Host[11] DS[384] WARNING: Result from CMD not valid. Partial Result: File does not exist
The example.sql is under C:\Inetpub\wwwroot\cacti\plugins\sqlqueries\queries
Everything seems goog, I tried to passed on cactid, but it's the same
Thanks for help
Nothing come on graph and cacti log give me
11/22/2007 06:15:06 PM - CMDPHP: Poller[0] Host[11] DS[384] CMD: c:/php/php.exe -q C:/Inetpub/wwwroot/cacti/scripts/mysql_query.php localhost 3306 'user' 'pw' 'example.sql', output: U
11/22/2007 06:15:06 PM - CMDPHP: Poller[0] Host[11] DS[384] WARNING: Result from CMD not valid. Partial Result: File does not exist
The example.sql is under C:\Inetpub\wwwroot\cacti\plugins\sqlqueries\queries
Everything seems goog, I tried to passed on cactid, but it's the same
Thanks for help
It work now, but I've maid some modifications :
in the 4 template.xml, I remove the ' character which were on
'<username>' '<password>' '<query_file>'
<username> <password> <query_file>
and In the mysql_query.php I had to hardcode the path for my queries
$cacti_queries_path = "C:/Inetpub/wwwroot/cacti/plugins/sqlqueries/queries/";
in the 4 template.xml, I remove the ' character which were on
'<username>' '<password>' '<query_file>'
<username> <password> <query_file>
and In the mysql_query.php I had to hardcode the path for my queries
$cacti_queries_path = "C:/Inetpub/wwwroot/cacti/plugins/sqlqueries/queries/";
I am not gettin SQL Query on Console
Hi,
On top left under console. I don't see SQL Query? Know why its not showing up?
On top left under console. I don't see SQL Query? Know why its not showing up?
Help.!
Anyone know what I am doing wrong? I tried to install the Plugin Architecture
Stable
: 1.4
I added a plugins into that folder but its now showing up in my CONSOLE. Anyone know what I'm doing wrong? Here is the step I did.
Clean installation of the Cacti 0.8.7a , and the new Plugin Architechture 1.4 which have the 0.8.7a, So basically I just drag plugin architechture into the cacti main folder and overwrite it. The plugin architureture say to edit the includes/config.php but it doesn't have the new one. It is cacit old config.php . Anyone know if I'm missing any step? Please advise.
Is there some stuff I'm missing?
Thanks!!
Stable
: 1.4
I added a plugins into that folder but its now showing up in my CONSOLE. Anyone know what I'm doing wrong? Here is the step I did.
Clean installation of the Cacti 0.8.7a , and the new Plugin Architechture 1.4 which have the 0.8.7a, So basically I just drag plugin architechture into the cacti main folder and overwrite it. The plugin architureture say to edit the includes/config.php but it doesn't have the new one. It is cacit old config.php . Anyone know if I'm missing any step? Please advise.
Is there some stuff I'm missing?
Thanks!!
got it working
Ok,
I got the plugins to show up, I created a sql queries, and graph it, but the graph is not showing up.
Anyway to test this.? or troubleshoot this?
Can someone help me out. Why my graph is not showing up here is my example.sql data.
select count(*) "WHERE customer_id != 0" from oscom.whos_online;
select count(*) "WHERE customer_id = 0" from oscom.whos_online;
Thanks!!
I got the plugins to show up, I created a sql queries, and graph it, but the graph is not showing up.
Anyway to test this.? or troubleshoot this?
Can someone help me out. Why my graph is not showing up here is my example.sql data.
select count(*) "WHERE customer_id != 0" from oscom.whos_online;
select count(*) "WHERE customer_id = 0" from oscom.whos_online;
Thanks!!
Who is online
Users browsing this forum: No registered users and 0 guests