GIS Tutorials >> PostgreSQL/PostGIS >> Advanced PostgreSQL/PostGIS Tutorials >> Setting Up pgAdmin Server Instrumentation

GIS Programming Tutorials

GIS Theoretical Tutorials

GISTutor Newsletter



GISTutor Poll

How did you hear about us?
 

GISTutor Users Online

We have 35 guests online
Setting Up pgAdmin Server Instrumentation
( 4 Votes )

Navigate to Tools > Server Status. You will likely see a popup message saying "Server instrumentation not installed", "The server lacks instrumentation functions." With server instrumentation installed, you can use pgAdmin to view the postgresql.conf and pg_hba.conf files which are critically important for tuning your PostgreSQL Server. In order to install server instrumentation for PostgreSQL 8.4 database you will need to run an sql file that is distributed as part of the postgresql contrib.

 


Windows users should do a find for *.sql and look for adminpack.sql. On a Linux system enter the following command.

find / -name "*.sql"

If adminpack.sql was not found in the list of results run the following commands to install the postgresql contrib modules.

yum search postgresql
yum install postgresql84-contrib


Note: The PostgreSQL Contrib package could be named postgresql-contrib depending on your version of linux and PostgreSQL Server.


Now that you have tracked down the required adminpack.sql we have to modify a line in the postgresql.conf file, then we will install the sql file on your maintenance database, likely named postgres. This adminpack.sql has some functions with specific log_filenames setup. To prevent the "ERROR the logfile parameter must equal 'postgresql-%Y-%m-%d_%H%M%S.log'" error message open up your postgresql.conf, find log_filename and change the value to the following.


log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'


Save the file. Now you need to run the adminpack.sql file on your maintenance database in order to install server instrumentation and then restart the PostgreSQL Server once installed for the settings to take effect. Linux users use the following commands.

su postgres
psql -f /fullpathto/adminpack.sql postgres
pgctl restart -D /usr/local/pgsql/data

Now reopen pgAdmin and navigate to Tools > Server Status. If everything was successful you should not see any "Server instrumentation not installed", "The server lacks instrumentation functions." error messages anymore, and the server should display the active feed of the log file. Also Tools > Server Configuration will now be activated allowing you to view the postgresql.conf and pg_hba.conf files from within pgAdmin.

 

Comments  

 
+1 #3 2011-12-30 12:47
In PostgreSQL 9.1 all you have to do is using: CREATE EXTENSION adminpack

postgresql.org/.../...

Simple script
#!/bin/bash
sudo apt-get install postgresql-contrib;

echo "CREATE EXTENSION adminpack" | su postgres -c "psql -U postgres postgres";
Quote
 
 
0 #2 2011-12-09 09:39
Nice! Thanks!
Quote
 
 
0 #1 2011-09-15 16:08
Cool, I've got rid of that annoying message.

:)
Quote
 

Add comment


Security code
Refresh