Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titlePerl Setup
yum -y install cpan
cpan
install YAML
install Time::HiRes
install Net::SMPP
exit

 

Ins

Activate the MySQL plugin

The plugin is part of the Nagios standard package. During the installation of the Nagios plugins, the configure tool detects if the MySQL packages are installed.

If you followed the instruction in this Wiki, you have to repeat the build process:

Code Block
languagebash
titleRebuild Nagios plugins
cd /tmp/nagios-plugins-*
make clean
./configure --with-nagios-user=nagios --with-nagios-group=nagios
# Near the end of the configure output you must see the following line:
#                      --with-mysql: /usr/bin/mysql_config
make
make install

Download and install the Postgres Plugin

Download

Check for the latest version at http://bucardo.org/wiki/Check_postgres, scroll down to "Download".

 

 

Code Block
languagebash
titleDownload and install
cd /tmp
wget http://bucardo.org/downloads/check_postgres-2.21.0.tar.gz
tar -xzf check_postgres*.tar.gz
cd check_postgres-2.20.1*
cp check_postgres.pl /usr/local/nagios/libexec/

Set up the Postgres user "nagios"

Code Block
languagebash
titleCreate Postgres User
su - postgres
psql
CREATE USER nagios WITH PASSWORD 'some_password';
exit\q
exit # back to root

Set up OS user "nagios"

To keep the Postgres password from preying eyes, a password file is is required in the home directory of OS user "nagios":

Code Block
languagebash
titlePassword file
vi ~nagios/.pgpass
# insert:
localhost:5432:template1:nagios:some_password
# insert end (EOF)
# save and exit vi
chown nagios:nagios ~nagios/.pgpass
chmod 600 ~nagios/.pgpass

Test locally

Code Block
titleTest
su - nagios
cd /usr/local/nagios/libexec/
./check_postgres.pl -H localhost -db template1 -u nagios --action connection
./check_postgres.pl -H localhost -db template1 -u nagios --action dbstats
./check_postgres.pl -H localhost -db template1 -u nagios --action bloat
# in the next statement, you should set the limits as appropriate
./check_postgres.pl -H localhost -db template1 -u nagios --action=database_size --warning='30 GB' --critical='35 GB'
exit # back to root

Amend nrpe.cfg

Add the following lines to /usr/local/nagios/etc/nrpe.cfg

...