I recently moved Nagios monitoring from one server to another and ran into a couple minor issues. I wanted to point out some of the errors and the steps I took to resolve those errors on a CentOS Linux server. The biggest pain about moving Nagios for me was the fact that I use Monarch to manage the Nagios configuration files and reconfiguring Monarch was a pain because of some of the Perl modules required and the fact that CentOS still favors Perl 5.8.8 instead of Perl 5.10 which includes some of the necessary Perl modules. Anyway once I got past the Monarch issues I still had some minor problems with Nagios which are pointed out below. The errors are from the Nagios web interface.
Possible Issues Moving Nagios From One Linux Server To Another:
- ERROR: Could not find a suitable psql executable
This error was caused by the simple fact that the postgresql package was not installed on the server. To resolve this error on CentOS install postgresql using the yum package manager as displayed below. On other Linux distros you can find the way to install the postgresql rpm package.
Install PostgreSQL Using Yum On CentOS Linux:bash
- yum install postgresql
- CHECK_NRPE: Error – Could not complete SSL handshake.
This error points to an issue with NRPE not being configured to allow the Nagios server IP to query NRPE. In my case NRPE was run rfom xinetd so I needed to modify the nrpe file located in the “/etc/xinetd.d” directory to allow for the new Nagios server IP address. An example xinetd NRPE configuration file is below.
Xinetd NRPE Configuration File Example From CentOS Linux:bash
- # default: on
- # description: NRPE (Nagios Remote Plugin Executor)
- service nrpe
- flags = REUSE
- socket_type = stream
- port = 5666
- wait = no
- user = nagios
- group = nagios
- server = /usr/local/nagios/bin/nrpe
- server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
- log_on_failure += USERID
- disable = no
- only_from = 192.168.1.33 192.168.200.43
- POSTGRES_CUSTOM_QUERY UNKNOWN: DB “somedatabase” (host:192.168.1.55) FATAL: no pg_hba.conf entry for host “192.168.200.43”, user “postgres”, database “haloror”, SSL off
This error explains specifically what the issue is by letting you know that this server is not authorized to access PostgreSQL on the server you are attempting to monitor from the Nagios server. To resolve this issue create an entry in the pg_hba.conf file typically located in the /var/lib/pgsql/data directory. An entry in the pg_hba.conf file might look something like the below.Example Configuration Line From PostgreSQL pg_hba.conf File:Example pg_hba.conf Authorization Line:bash
- # nagios server entry
- host all all 192.168.200.43/32 md5
- PostgreSQL Monitoring: Displays result as ‘(null)’
This is more than likely displaying an issue connecting to Postgres. Try installing the perl-DBD-Pg package using your favorite package manager. Below is an example using yum to install perl-DBD-Pg.Install perl-DBD-Pg Using Yum On CentOS Linux:bash
- yum install perl-DBD-Pg
Those were the main Nagios web interface and monitoring issues I ran into when moving Nagios between servers. Once I was past the Monarch configuration and the errors noted above Nagios was up and working without issue.