Mise en place de Nagios NRPE sur Solaris 10
Contents
1 Introduction
Traditionally Linux is the platform of choice for running Nagios however Solaris takes some beating for performance and reliability. Installing Nagios on Solaris is pretty straightforward however there are some tricks to make the install smoother.
Usually our installation comprises Nagios 2.0, Nagios Plugins 1.4.2 and NRPE 2.4 so we'll cover these here.
Our target system is a Sun Ultra 60 so we're using the SPARC version of Solaris 10. The same principles should apply to Solaris on Intel though.
2 Installing Solaris 10
We started off with a vanilla install of Solaris 10 (01/06) and opted to install all packages except OEM. You can get away with less if you're running the system headless.
Many of the development tools and libraries we'll need for Nagios come on the Solaris Companion DVD so the next step was to install those. Again we opted for the standard list of components.
Our Ultra 60 only has a CD-ROM. To get around this we used NFS to mount the DVD from another server.
3 Preparing Solaris
In order to make the Nagios install go smoothly we performed some tweaks. These are made from the command shell.
3.1 Setting default shell to Bash
$ usermod -s /usr/bin/bash |
When you log in you'll now get the Bash shell.
If you have a strong preference for another shell then free to use that instead :-)
3.2 Correcting Path
The default path misses packages installed from the Solaris Companion DVD, we can fix this by typing the following command:
$ export PATH=/usr/sfw/bin:/usr/ccs/bin:/opt/sfw/bin/:/usr/bin:/usr/ucb:/usr/sbin |
3.3 Setting Compiler flags
These are optional but will make Nagios run faster on your system. Setting -mcpu and -mtune to 'ultrasparc' should be fine for most Sun UltraSPARC based systems. Using -pipe speeds up compilation but may cause problems if you are tight on memory.
$ export CFLAGS="-O3 -pipe -mcpu=ultrasparc -mtune=ultrasparc" |
More information can be found at gcc.gnu.org.
3.4 Making changes stick
We to make our changes permenant we appended the following lines to .profile in our home directory:
.profile |
PATH=/usr/sfw/bin:/usr/ccs/bin:/opt/sfw/bin/:/usr/bin:/usr/ucb:/usr/sbin CFLAGS="-O3 -pipe -mcpu=ultrasparc -mtune=ultrasparc" export PATH CFLAGS |
4 Nagios Prerequisites
4.1 GD Graphics Libraries
We found it was necessary to install the GD Graphics libraries for Nagios to compile, we used version 2.0.33. A standard 'configure', 'make' and 'make install' was sufficient, remember to install as root (or configure sudo). Software can be found at http://www.boutell.com/gd/
4.2 NRPE
We found that NRPE couldn't find the required SSL libraries to compile so we downloaded the package 'openssl-0.9.8a-sol10-sparc-local.gz' from Sun Freeware - http://www.sunfreeware.com/
4.2.1 Installation steps
$ gzip -d openssl-0.9.8a-sol10-sparc-local.gz $ su - # /usr/sbin/pkgadd -d openssl-0.9.8a-sol10-sparc-local $ exit |
4.2.2 Compilation and Installation
Both Nagios and Nagios Plugins compiled and installed as normal. NRPE required the following configuration parameters to correctly build:
$ ./configure --with-ssl-lib=/usr/local/ssl/lib/ |
Now your system is ready to configure...