Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


SQL Queries Result Graphs (Plugin + Templates + Script)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
web_rene



Joined: 20 Apr 2007
Posts: 21

PostPosted: Fri Apr 20, 2007 5:48 am    Post subject: SQL Queries Result Graphs (Plugin + Templates + Script) Reply with quote

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...



cacti_sql2.jpg
 Description:
Example of creating a Graph out of the Query File.
 Filesize:  92.83 KB
 Viewed:  4995 Time(s)

cacti_sql2.jpg



cacti_sql.jpg
 Description:
Screenshot of sqlqueries plugin
 Filesize:  235.12 KB
 Viewed:  5950 Time(s)

cacti_sql.jpg



sqlqueries_v_02.tar.gz
 Description:
Version 0.2 of sqlqueries Plugin

Download
 Filename:  sqlqueries_v_02.tar.gz
 Filesize:  9.86 KB
 Downloaded:  311 Time(s)



Last edited by web_rene on Fri Nov 09, 2007 5:28 am; edited 4 times in total
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Fri Apr 20, 2007 9:08 pm    Post subject: Reply with quote

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
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12206
Location: Muenster, Germany

PostPosted: Sat Apr 21, 2007 7:14 am    Post subject: Reply with quote

TheWitness wrote:
I strongly suggest that you look at things like Reinhard's poller statistics Template for accessing arbitrary data in SQL.
Find it at http://forums.cacti.net/viewtopic.php?t=18057&highlight=poller+statistics
Reinhard
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Sat Apr 21, 2007 1:25 pm    Post subject: Reply with quote

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
Back to top
web_rene



Joined: 20 Apr 2007
Posts: 21

PostPosted: Thu May 03, 2007 4:36 am    Post subject: Reply with quote

Thanks for your offer.
Since I received no reply on my PM I guess you have rethought your position again!?

Anyways, I hope that there are some people out there who can make a use of this plugin.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Thu May 03, 2007 7:28 am    Post subject: Reply with quote

Sorry, I am so busy, I have lost track of things. Let me collect my thoughts. What is your locality (time zone)?

Larry
Back to top
web_rene



Joined: 20 Apr 2007
Posts: 21

PostPosted: Thu May 03, 2007 8:16 am    Post subject: Reply with quote


My Timezone is GMT+1.

Greetings from Germany.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Thu May 03, 2007 2:58 pm    Post subject: Reply with quote

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
Back to top
web_rene



Joined: 20 Apr 2007
Posts: 21

PostPosted: Thu Nov 08, 2007 8:32 am    Post subject: Update Reply with quote

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!?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Fri Nov 09, 2007 1:23 am    Post subject: Reply with quote

I have updated the Rosetta with your information thanks!!

http://forums.cacti.net/viewtopic.php?t=14985

TheWitness
Back to top
billporte



Joined: 22 Nov 2007
Posts: 2

PostPosted: Thu Nov 22, 2007 12:33 pm    Post subject: Reply with quote

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
Back to top
billporte



Joined: 22 Nov 2007
Posts: 2

PostPosted: Fri Nov 23, 2007 7:46 am    Post subject: Reply with quote

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/";
Back to top
aboyz



Joined: 18 Jan 2008
Posts: 35

PostPosted: Sat Jan 19, 2008 1:38 am    Post subject: I am not gettin SQL Query on Console Reply with quote

Hi,

On top left under console. I don't see SQL Query? Know why its not showing up?
Back to top
aboyz



Joined: 18 Jan 2008
Posts: 35

PostPosted: Sat Jan 19, 2008 5:15 pm    Post subject: Help.! Reply with quote

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!!
Back to top
aboyz



Joined: 18 Jan 2008
Posts: 35

PostPosted: Sun Jan 20, 2008 2:46 am    Post subject: got it working Reply with quote

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!!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group