- Ubuntu Server 14.04.1 LTS x64.
- OpenSSH
- Hostname : SVR01
- Username : master
Follow these steps-by-steps :-
- sudo apt-get update
- sudo apt-get upgrade
- sudo /etc/network/interfaces
- static
- address 192.168.4.248
- netmask 255.255.255.0
- gateway 192.168.4.1
- network 192.168.4.0
- broadcast 192.168.4.255
- dns-nameservers 202.188.0.133 202.188.1.5
- sudo apt-get install \
- wget \
- build-essential \
- apache2 \
- apache2-utils \
- libapache2-mod-php5 \
- php5-gd \
- libgd2-xpm-dev \
- postfix
- When prompted for email address and SMTP server, just use the desired email address (preferably an IT Admin email) and the SMTP server address.
- sudo useradd --system --home /usr/local/nagios -M nagios
- sudo groupadd --system nagcmd
- sudo usermod -a -G nagcmd nagios
- sudo usermod -a -G nagcmd www-data
- cd /tmp
- sudo wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz (a newer version maybe available during this post, please check Nagios website).
- sudo wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz (a newer version of plugins maybe available during this post, please check Nagios website).
- tar -xzvf nagios-4.0.8.tar.gz
- tar -xzvf nagios-plugins-2.0.3.tar.gz
- cd nagios-4.0.8
- sudo ./configure \
- --with-nagios-group=nagios\
- --with-command-group nagcmd \
- --with-mail=/usr/sbin/sendmail \
- --with-httpd_conf=/etc/apache2/conf-available
- sudo make all
- sudo make install
- sudo make install-init
- sudo make install-config
- sudo make install-commandmode
- sudo make install-webconf
- sudo cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
- sudo chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
- sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (verify Nagios configuration is correct or not).
- sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
- cd ..
- cd nagios-plugins-2.0.3
- sudo ./configure \
- --with-nagios-user=nagios \
- --with-nagios-group=nagios \
- --enable-perl-modules \
- --enable-extra-opts
- sudo make
- sudo make install
- sudo a2enmod cgi
- sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin (when prompted for password, key-in your preferred password, this will be use during login to the Web GUI).
- sudo nano /etc/apache2/sites-enabled/000-default.conf
- Type --> Include conf-available/nagios.conf
- sudo nano /etc/apache2/conf-available/fqdn.conf
- Type --> SVR01 localhost
- sudo a2enconf fqdn
- sudo nano /usr/local/nagios/etc/objects/contacts.cfg
- nagiosadmin = master@domain.com
- sudo service apache2 restart
- sudo service nagios start
URL = http://192.168.4.248/nagios
When prompted for username and password :-
Username = master
Password = [the password you have specified earlier]
No comments:
Post a Comment