Home Directory Plugins Databases PostgresQL Postgresql 9.3 Streaming Replication Delay

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree

Postgresql 9.3 Streaming Replication Delay

Compatible With
  • Nagios 3.x
  • Nagios 4.x
check_repdelay.pyPython Script
check_repdel.phppnp4nagios template
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Python script to check and graph the delay in seconds from your primary to your hot standby PostgreSQL 9.3 server.
This script will check the delay in seconds of your PostgreSQL 9.3 hot standby. I am assuming that users are familiar enough with PostgreSQL and the use of .pgpass that I don't need to cover the full setup details here.

Written for CentOS 6.x using Python 2.6.6 (current version on CentOS 6 at time of writing) I suspect it will work on 2.6.9 without issue, I have not tested on 3.x

For security purposes, I suggest using a .pgpass file in your nrpe users home director (CentOS 6.x = /var/run/nrpe/). This will allow you to leave the -P/--password field blank and only provide a username which you reference in the .pgpass file.

To test if the script runs as the nrpe user, the follow command run as root will execute it as the nrpe user.

sudo su nrpe -c '/usr/lib64/nagios/plugins/check_repdelay.py' -s /bin/bash

You can add -C and -W levels inside the single quotes for testing functionality.

The .php template for pnp4nagios is provided.