GitXplorerGitXplorer
e

nagios-postgresql

public
10 stars
4 forks
2 issues

Commits

List of commits on branch master.
Unverified
2cf8d737fb2e4b6051a20013fbae0aef547c26ee

Ignoring backup files

eelecnix committed 16 years ago
Unverified
d58ef2308da5ed0d6b50acba04e420d7a32399d1

INSTALL now mentions createlang

eelecnix committed 16 years ago
Unverified
d66098bb450e5e8750c97f42a9048d1e8f85da97

Trapping execute error for curr_conn and reporting that error.

committed 16 years ago
Unverified
4334c2fb5414454e54f4fb99915b73d128b41113

Added testing of DB connection in installation steps, with instructions for installing required Perl modules.

committed 16 years ago
Unverified
0c3b702b4c90c6b1d460e61d19086a86acb50659

Make README a bit more legible

committed 18 years ago
Unverified
ab89a7da036a78fe365cc95ab189bcfc15aee86f

make install a little more legible for crappy editors, clean up a few links and clarify some warnings

committed 18 years ago

README

The README file for this repository.

Here's the nagios plugins I have hacked up over the past few months and what they do. Please let me know if you find these scripts useful. It may encourage me to work on them. :-)

Tony Wasson (ajwasson@gmail.com)

2006-08-29 - I've made all the scripts use the pg_stat_activity() function. This is using security definer, so you can run your monitoring as a non-super-user. See the INSTALL for extra details.

  • check_pg_connections.pl - Shows percentage of connections available. It uses "SELECT COUNT(*) FROM pg_stat_activity()" / "SHOW max_connections". It can also alert when less than a certain number of connections are available.

  • check_pg_queries.pl - If you have query logging enabled this summarizes the types of queries running (SELECT, INSERT, DELETE, UPDATE, ALTER, CREATE, TRUNCATE, VACUUM, COPY) and warns if any queries have been running longer than 5 minutes (configurable).

  • check_pg_waiting_queries.pl - It whines if any queries are in the "waiting" state. It does this by joining pg_locks with pg_stat_activity().

  • check_pg_lock_status.pl - Look for Exclusive locks that can block. This is just testing if a blocking/waiting condition can occur. pg_waiting_queries is actually reporting that a blocking/waiting state IS occuring.

  • check_pg_time.pl - Makes sure that postgresql's time is in sync with the monitoring server. It also shows the version currently running.

  • check_pg_max_xid.pl - "With the standard freezing policy, the age column will start at one billion for a freshly-vacuumed database." So essentially for any large or high transaction volume database, 1B is normal. The script warns before a wrap could happen at 2 billion transaction IDs. It starts warning once one or more databases show an age over 1.5 billion transactions. It reports critical at 1.75B transactions.

If you are using autovacuum on 8.1, you should not have any trouble with transaction ids. The code in 8.1 is also much better than 7.4 or 8.0 for dealing with a wraparound. You may choose not to use this check, depending on your comfort level.


Here's a sample for your checkcommands.cfg file in nagios

#compare time via postgresql define command { command_name check_pg_time command_line $USER1$/check_pg_time.pl $HOSTADDRESS$ template1 postgres }

#Get # of active connecctions define command { command_name check_pg_connections command_line $USER1$/check_pgconnections.pl $HOSTADDRESS$ template1 postgres }

#Get # of db locks define command { command_name check_pg_lock_status command_line $USER1$/check_pg_lock_status.pl $HOSTADDRESS$ template1 postgres }

#Find any queries waiting define command{ command_name check_pg_waiting_queries command_line $USER1$/check_pg_waiting_queries.pl $HOSTADDRESS$ template1 postgres }

#Find slow or abnormal queries running define command{ command_name check_pg_queries command_line $USER1$/check_pgqueries.pl $HOSTADDRESS$ template1 postgres }

#Check postgresql transaction IDs define command{ command_name check_pg_transactionids command_line $USER1$/check_pg_max_xid.pl $HOSTADDRESS$ template1 postgres }