As part 1 of the four part installation procedure of Nagios Open Source Monotioring Solution, this covers the basics and installation and configuration of pre-requisites for Nagios before proceeding to the actual installation of Nagios binaries.
The Pre-requisites that needs to be installed and configured for Nagios are
GNU compiler Collection (debian gcc package) Make package to install the binaries (make) Apache Webserver (apache2) PHP 5 (php5) php5-gd php5-cgi modules Nagios Users Setup Nagios Root DirectorySo, lets get started.
Install GNU Compiler Collection
debian4r2:~# aptitude install gcc
Install Make package
debian4r2:~# aptitude install make
Install Apache 2 Webserver
debian4r2:~# aptitude install apache2
Install PHP 5
debian4r2:~# aptitude install php5
Install PHP5 module php5-gd & php5-cgi
debian4r2:~# aptitude install php5-gd
debian4r2:~# aptitude install php5-cgi
Now, lets create users and groups for nagios
Create user nagios
debian4r2:~# useradd nagios
This creates user “nagios” and the group “nagios”
Create group nagioscmd for command file (external commands)
debian4r2:~# groupadd nagcmd
Add user “nagios” and “www-data” (the user that runs the apache webserver) to this group
debian4r2:~# usermod -G nagcmd nagios
debian4r2:~# usermod -G nagcmd www-data
Create the Nagios root directory
debian4r2:~# mkdir /user/local/nagios
Chown the ownership of the group to the nagios user and group
debian4r2:~# chown nagios:nagios /user/local/nagios
Thats it done, Nagios is now ready to be installed on the server. Follow the next steps to complete the installation.