Public Repository

Last pushed: a year ago
Short Description
install nagios 4.1.1 on ubuntu 14.4 with fully configued for web and plugin etc
Full Description

from Mitchell Anicas:
create user and group:
sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios

install needed lib on OS:
sudo apt-get update
sudo apt-get install build-essential libgd2-xpm-dev openssl libssl-dev xinetd apache2-utils unzip
sudo apt-get install apache2
sudo usermod -G nagcmd www-data

install nagios core
curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
tar xvf nagios-.tar.gz
cd nagios-

./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-mail=/usr/sbin/sendmail
make all
sudo make install
sudo make install-commandmode
sudo make install-init
sudo make install-config
sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf
(if last install failed, just manully cp sample-config/httpd.conf to /etc/apache2/sites-available/nagios.conf)

intall nagios plugins
curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
tar xvf nagios-plugins-.tar.gz
cd nagios-plugins-

./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make
sudo make install

install NRPE
curl -L -O http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar xvf nrpe-.tar.gz
cd nrpe-

./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all
sudo make install
sudo make install-xinetd
sudo make install-daemon-config

Update web server IP and start nrpe
vi /etc/xinetd.d/nrpe to replace 172.17.0.2 with your server IP <---------------------------YOU NEED TO TAKE ACTION!
service xinetd restart

####################################CONFIG NAGIOS ##########################################
vi /usr/local/nagios/etc/nagios.cfg and uncomment line #cfg_dir=/usr/local/nagios/etc/servers

mkdir /usr/local/nagios/etc/servers

vi /usr/local/nagios/etc/objects/contacts.cfg and update email with your owns <---------YOU NEED TO TAKE ACTION!

vi /usr/local/nagios/etc/objects/commands.cfg and add
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

sudo a2enmod rewrite
sudo a2enmod cgi

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin <-------------if you wanna use a different user, TAKE more ACTION! (google it)

sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

sudo service nagios start
sudo service apache2 restart

######################################ACCESS FROM WEB#################################
from your browser: http://<serverip>/nagios
login with "nagiosadmin" and the password you set when you run "htpasswd" ´<---------------------in the image it is 19831101 now

Docker Pull Command
Owner
zdtsw

Comments (0)