PostgreSQL Host Template

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

_Dmitry_
Posts: 36
Joined: Tue Sep 18, 2007 4:58 am
Location: DE

Re: postgres template xml file hash problem

Post by _Dmitry_ »

jehan.procaccia wrote:when I try to import the template from cacti_data_query_postgresql_database_stats.xml
I get:

Error: XML: Hash version does not exist.

what's wrong ? I run on cacti-0.8.6i-1.el4.rf .

thanks.
I have created this Export with 0.8.7b, I will reexport Template with 0.8.7d and attach it later.
jehan.procaccia wrote: PS: BTW, should I download postgresql_database_stats_1.tgz (10.67KB) or
postgresql_database_stats.tgz 9.92KB) ?
...stats_1.tgz is with DB Size and ...stats.tgz without.
vguna
Posts: 1
Joined: Wed Mar 10, 2010 3:48 am

Added Connection Usage

Post by vguna »

Hi.

Great templates you've created there Dmitry! Runs like a charm with only a bit configuration effort.

Inspired from that, I added an additional report for connection usage. It displays:

- Total Connections
- Connections in use/idle

I patched your pgsql_stats.php file to add the new get data_idx operation in the manner you've created the ones before.

What I didn't figure out, how you embedded the reports into one single .xml file. I had to create an external one - outside of your package. Maybe you could create the whole package again with this new report? Would be great for other users.

One last problem though: Getting active connections requires that the user used to login (here: monitor) must be the same doing the queries against the db - or has superuser privileges. If that's not the case active == total connections. But that's ok I think.

Hope hearing from you.
Attachments
pgsql_stats.patch
Patch for pgsql_stats.php
(2.69 KiB) Downloaded 864 times
maxw
Posts: 8
Joined: Fri May 28, 2010 4:59 am

Post by maxw »

Is anyone using this template on cacti 0.8.7f?

I've installed it, configured it and the data query runs fine but I get a screen asking for Index Type, Index Value and Output Type ID??

Screenshot attached.

Any ideas?
Attachments
Screenshot
Screenshot
Untitled.png (89.74 KiB) Viewed 7493 times
trieuvi
Posts: 1
Joined: Fri Jul 23, 2010 2:32 am

Post by trieuvi »

I can't see any file, please help me!!!!
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

>> If anyone interested I'll upload Host Template with all Scripts and XML here later.

Dear Sir,

Would you please send me the scripts in order to allow Cacti to monitor postgres database?
Thank you very much.

Richard
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

Hi,

I thing I have the file postgresql_database_stats_1.tgz. Will continue.

Thanks.

Richard
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

Hi,

I need the instruction on 5. Edit your Host Template or Device and add PostgreSQL Database Stats in Data Queries.
Thanks.

Richard
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

Hi,

I also not sure how to do on:

3. Cacti Import: cacti_data_query_postgresql_database_stats.xml - Data Query + Graphs - import into Cacti

Would you please give me instruction?

Thanks.

Richard
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

Hi:

I figureed out and completed: 5. Edit your Host Template or Device and add PostgreSQL Database Stats in Data Queries.

I am still trying on: cacti_data_query_postgresql_database_stats.xml - Data Query + Graphs - import into Cacti, please give me instruction if you could.

Thanks.

Richard
Richardtai
Posts: 6
Joined: Wed Jan 26, 2011 4:04 pm

Re: PostgreSQL Host Template

Post by Richardtai »

Hi,

Import on (cacti_data_query_postgresql_database_stats.xml) was completed. Thanks.

Richard
leasonliang
Posts: 2
Joined: Wed Apr 20, 2011 5:02 am

Re: Hi Smiles ,i hit your problem.Did you get the result

Post by leasonliang »

maxw wrote:Is anyone using this template on cacti 0.8.7f?

I've installed it, configured it and the data query runs fine but I get a screen asking for Index Type, Index Value and Output Type ID??

Screenshot attached.

Any ideas?

Hi Smiles ,i hit your problem.Did you get the result? Please give me some idea?
leasonliang
Posts: 2
Joined: Wed Apr 20, 2011 5:02 am

Re: PostgreSQL Host Template

Post by leasonliang »

hi, Dmitry!I had a problem ,when import your template.Please help me.

I used Version 0.8.7g. And I import your templates.And I click (Verbose Query) for debug.And return

+ Running data query [10].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/postgres_dbstat.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php /var/www/html/cacti/scripts/pgsql_stats.php 192.168.0.244 index'
+ Executing script query '/usr/bin/php /var/www/html/cacti/scripts/pgsql_stats.php 192.168.0.244 query dbname'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/postgres_dbstat.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/postgres_dbstat.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_queries/postgres_dbstat.xml'

when I click the "Create Graphs for this Host" to create the graph. There is no graph for select.Please see the Screenshot.
Attachments
Device_2.png
Device_2.png (15.28 KiB) Viewed 6483 times
device.png
device.png (31.99 KiB) Viewed 6483 times
smccloud
Posts: 5
Joined: Tue Aug 16, 2011 11:57 am

Re: PostgreSQL Host Template

Post by smccloud »

Just got this installed and I'm not able to create any graphs. When I click Create Graphs for this Host what you see in the attached screenshot. Debugging the query returns

Code: Select all

+ Running data query [20].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/local/share/cacti/resource/script_queries/postgres_dbstat.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php /usr/share/cacti/site/scripts/pgsql_stats.php sradmin index'
+ Executing script query '/usr/bin/php /usr/share/cacti/site/scripts/pgsql_stats.php sradmin query dbname'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_queries/postgres_dbstat.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_queries/postgres_dbstat.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/script_queries/postgres_dbstat.xml'
And doing the select statement you said to returns results like expected.
Attachments
Capture.PNG
Capture.PNG (82.77 KiB) Viewed 6301 times
smccloud
Posts: 5
Joined: Tue Aug 16, 2011 11:57 am

Re: PostgreSQL Host Template

Post by smccloud »

Ok, just figured out my problem. I had to add the data query to an existing device instead of creating a new device.

Do you know if it would be possible to automatically add stats graphs for databases that match a specific name pattern? I.e. ones that start with gsr.
ejortegau
Posts: 2
Joined: Tue Jan 02, 2007 3:01 pm

Re: PostgreSQL Host Template

Post by ejortegau »

Hi, all:

I realize this is an oooooold thread, but I was wondering whether anyone knows if the template still works. Particularly, on cacti 0.8.7g

Regards,

E.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest