|
|
| Author |
Message |
tetu_024
Joined: 20 Jun 2007 Posts: 31
|
Posted: Wed Jan 23, 2008 3:24 am Post subject: Sql Queries Script |
|
|
Hi,
I have a problem with the sqlqueries script. When i want to create a graph with Mysql 5 count queries the field host name isn't being displayed. I'm attaching screen shots.
Et
| Description: |
|
| Filesize: |
61.21 KB |
| Viewed: |
1979 Time(s) |

|
| Description: |
|
| Filesize: |
69.38 KB |
| Viewed: |
1979 Time(s) |

|
|
|
| Back to top |
|
 |
web_rene
Joined: 20 Apr 2007 Posts: 21
|
Posted: Mon Feb 18, 2008 10:00 am Post subject: Hi |
|
|
Hi and sorry for the Late reply.
The Hostname is taken from the Host you create the Graph for.
Means, if you create a graph for
db1.yourdomain.com he will use this hostname in the mysql-connect string as targethost.
|
|
| Back to top |
|
 |
tetu_024
Joined: 20 Jun 2007 Posts: 31
|
Posted: Mon Feb 18, 2008 1:13 pm Post subject: |
|
|
| Thanks for the reply. is the query good for postgres sql server?
|
|
| Back to top |
|
 |
web_rene
Joined: 20 Apr 2007 Posts: 21
|
Posted: Tue Feb 19, 2008 7:21 am Post subject: |
|
|
Up to know, it only supports mysql.
But if you have some experience with scripting in php with databaseconnects to pg, I think it should be no Problem.
|
|
| Back to top |
|
 |
dass_ba
Joined: 31 Mar 2008 Posts: 2
|
Posted: Mon Mar 31, 2008 7:12 pm Post subject: Sql Queries Script |
|
|
can you post this SQLquery script and any xml template if one available ?
Thanks
|
|
| Back to top |
|
 |
web_rene
Joined: 20 Apr 2007 Posts: 21
|
|
| Back to top |
|
 |
dass_ba
Joined: 31 Mar 2008 Posts: 2
|
Posted: Tue Apr 01, 2008 1:24 pm Post subject: |
|
|
Thank you web_ren - I think this sqlquery is very close to what I'm looking for. I need to make a template and produce the graph for sql 2005 transaction query - hope this one will serve the purpose.
Thanks
|
|
| Back to top |
|
 |
ceyounger
Joined: 10 Feb 2006 Posts: 35 Location: San Jose, CA USA
|
Posted: Tue Apr 01, 2008 4:22 pm Post subject: |
|
|
| dass_ba wrote: | Thank you web_ren - I think this sqlquery is very close to what I'm looking for. I need to make a template and produce the graph for sql 2005 transaction query - hope this one will serve the purpose.
Thanks |
Did you have any luck with querying from a SQL 2005 server? PHP just hangs when I attempt to run this from CLI.
|
|
| Back to top |
|
 |
web_rene
Joined: 20 Apr 2007 Posts: 21
|
Posted: Wed Apr 02, 2008 4:39 am Post subject: |
|
|
| Actually the PHP Script uses MySQL Connect, so I guess it won't work with SQL2005 Server...
|
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9689 Location: MI, USA
|
Posted: Wed Apr 02, 2008 4:51 am Post subject: |
|
|
The correct approach here is to use a Script Server script that contains the SQL and the connect logic. That script would use PHP's internal database functions to execute your queries inside of your Script Server scripts.
PHP Supports connectivity to Postgress and Microsoft SQL Server without issue. By default, Cacti's API does not. I would suggest that the aformentioned template was designed specifically for MySQL.
From my perspective this is not the best approach, although a creative one, and something to think about for future enhancements to Cacti.
There are several examples of Script Server scripts that have been written to obtain information from a database. If you need help, I would goto the PHP.Net website and look at the various database connectors for examples.
Regards,
TheWitness
|
|
| Back to top |
|
 |
|