Project

General

Profile

Nagios

  • set up syslinks
    cd /usr/bin/
    check_postgres.pl --symlinks
    
  • some useful commands
    ## Check connection to Postgres database ’cdb’
    check_postgres_connection --db=cdb
    
    ## Warn if > 100 locks, critical if > 200, or > 20 exclusive
    check_postgres_locks --warning=100 --critical="total=200;exclusive=20" --db=cdb
    
    ## Show the current number of idle connections on port 5432:
    check_postgres_txn_idle --port=5432 --output=simple
    
    #check_postgres_timesync
    
    ##Check that the number of ready WAL files is 10 or less, for use on stand by server
    check_postgres_archive_ready --critical=10 --db=cdb
    
    ## Give a warning when any databases on port 5432 are above 97%
    check_postgres_autovac_freeze --port=5432 --warning="97%" 
    
    ## Give a critical when we reach 75% of our max_connections setting
    check_postgres_backends --warning="75%" --critical="75%" 
    
    ## Give a warning when there are only 10 more connection slots left, and a critical when we have only 5 left.
    check_postgres_backends --warning=-10 --critical=-5
    
    ## Warn if any table on port 5432 is over 100 MB bloated, and critical if over 200 MB
     check_postgres_bloat --port=5432 --warning="100 MB" --critical="200 MB" 
    
    ## Warn if any database is less than 90% in commitratio, and critical if less then 80%.
    check_postgres_commitratio --warning="90%" --critical="80%" --db=cdb
    
    ## Warn if any database is over 1 TB in size, and critical if over 1.1 TB.
    check_postgres_database_size --warning="800 MB" --critical="900 MB"