[quote="_Dmitry_"]Hello,
recently I was inspired by [url=
http://forums.cacti.net/viewtopic.php?t ... highlight=]MySQL Host Template [/url] and made my own for PostgreSQL Host Template with Data Queries to get all DB from it and draw following Graphs for them.
All Statistics are based on this Docs:
http://www.postgresql.org/docs/current/ ... stats.html
If anyone interested I'll upload Host Template with all Scripts and XML here later.
Installation instruction:
Make sure you have enabled Statistic Collector in Postgres (postgresql.conf)
[i]# - Query/Index Statistics Collector -
stats_start_collector = on
stats_command_string = on
stats_block_level = on
stats_row_level = on
stats_reset_on_server_start = off
[/i]
1. Create new User in PostgreSQL ,for example [b]monitor[/b] (you don't have to grant any special roles to this users AFAIK, any user has access to Statistic Tables).
2. Try to connect remotely under this user to postgres Database:
psql -h YOUR_POSTGRES_HOST -U monitor -W postgres
and try execute following SQL:
select * from pg_stat_all_tables;
If everything work proceed with installation otherwise fix your problem till you get results.
3. Cacti Import
[b]pgsql_stats.php[/b] - the Script, put this in <cacti_root>/scripts/
[b]postgres_dbstat.xml[/b] - the Definition, put this in <cacti_root>/resource/script_queries
[b]cacti_data_query_postgresql_database_stats.xml[/b] - Data Query + Graphs - import into Cacti
4. Edit [b]pgsql_stats.php[/b] line 173 and 174 and put username and password you have created at point 1. (I don't know how to pass username and password parameters to Data Queries. If you know how, let me know so I can remote username and password from script)
5. Edit your Host Template or Device and add [b]PostgreSQL Database Stats[/b] in Data Queries.
6. Create your Graphs :)
Please let me know if you had any troubles or have any wishes :)[/quote]
would you please send me these scripts?