Instalando nagios 3 en Debian 6

linux

Otro apunte, para instalar nagios3 en una Debian.
Primero, instalamos unas dependencias básicas:

#aptitude install build-essential gcc libgd2-xpm-dev libglib2.0-dev apache2

Creeamos usuario y grupo:

# /usr/sbin/useradd nagios
# passwd nagios
# /usr/sbin/groupadd nagcmd
#/usr/sbin/usermod -G nagcmd nagios
# /usr/sbin/usermod -G nagcmd www-data

Ahora instalamos unas dependencias básicas:

root@nagios:~# apt-get install apache2 mc libapache2-mod-php5 php5-cli php5-common php5-cgi php5-gd
root@nagios:~# aptitude install build-essential gcc libgd2-xpm-dev libglib2.0-dev apache2
root@nagios:~# apt-get install php5-cli php5-common php5-gd
root@nagios:~# apt-get install libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev
root@nagios:~# apt-get install php5-cli php5-common php5-gd php-pear
root@nagios:~# apt-get install ssh apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi php5-gd -qy bison flex libncurses5-dev zlib1g-dev libssl-dev libnewt-dev libiksemel-dev -qy make linux-headers-`uname -r` gcc g++ libstdc++6 mysql-client mysql-server phpmyadmin linux-headers-`uname -r` bison openssl libssl-dev libeditline0 libeditline-dev libedit-dev gcc make g++ php5-cli mysql-common libmysqlclient15-dev libnewt-dev libmysqlclient15-dev libnewt-dev

Y reiniciamos apache2:

root@nagios:~# /etc/init.d/apache2 restart

Y seguimos añadiendo usuarios y grupos :

root@nagios:~# /usr/sbin/useradd nagios
root@nagios:~# passwd nagios
root@nagios:~# /usr/sbin/groupadd nagcmd
root@nagios:~# /usr/sbin/usermod -G nagcmd nagios
root@nagios:~# /usr/sbin/usermod -G nagcmd www-data

Ahora descargamos el nagios en /usr/src y creamos un directorio para ello y lo descomprimimos:

root@nagios:~# cd /usr/src/
root@nagios:~# mkdir nagios
root@nagios:~# cd nagios/
root@nagios:~# wget -c https://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.4.1/nagios-3.4.1.tar.gz/download
root@nagios:~# tar -zxvf nagios-3.4.1.tar.gz
root@nagios:~# wget -c https://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
root@nagios:~# tar -zxvf nagios-plugins-1.4.15.tar.gz

Y ahora a compilar:

root@nagios:/usr/src/nagios# ./configure --with-command-group=nagcmd
root@nagios:/usr/src/nagios# make all
root@nagios:/usr/src/nagios# make install
root@nagios:/usr/src/nagios# make install-init
root@nagios:/usr/src/nagios# make install-config
root@nagios:/usr/src/nagios# make install-commandmode
root@nagios:/usr/src/nagios# make install-webconf

Creamos el usuario para el acceso web:

root@nagios:/usr/src/nagios# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Y ahora toca el nagios-plugins

root@nagios:/usr/src/nagios# cd nagios-plugins-1.4.15/
root@nagios:/usr/src/nagios/nagios-plugins-1.4.15# ./configure --with-nagios-user=nagios --with-nagios-group=nagcmd
root@nagios:/usr/src/nagios# make
root@nagios:/usr/src/nagios# make install

Ahora instalamos la parte para que enví­e las notificaciones:

root@nagios:/usr/local/nagios/share# apt-get remove exim4 exim4-config
root@nagios:/usr/local/nagios/share# apt-get install postfix postfix-doc

Y configuramos el main.cf de postfix, tal que:

myhostname = nagios.dominio.local
mydomain = dominio.local
myorgin = $mydomain
masquerade_domain = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetwork_style = host
##########################################################
mynetworks = 192.168.0.0/16
relay_domains = dominio.local
transport_maps = hash:/etc/postfix/transport
bounce_notice_recipient = email@dominio.com
delay_notice_recipient = email@dominio.com
2bounce_notice_recipient = email@dominio.com
error_notice_recipient = email@dominio.com
default_destination_concurrency_limit = 10
smtpd_recipient_limit = 100
maximal_queue_lifetime = 1d
fallback_relay =
smtp_destination_recipient_limit = 200
smtp_destination_concurrency_limit = 10
message_size_limit = 5240000
append_at_myorigin = yes
append_dot_mydomain = no
swap_bangpath = no

Y reiniciamos postfix:

root@nagios:/etc/postfix# /etc/init.d/postfix restart
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
root@nagios:/etc/postfix#

Y ahora toca configurar plugins y resto de cosillas.
Enjoy your nagios 🙂

3 comentarios en «Instalando nagios 3 en Debian 6»

  1. Hi men I believe this is a great pusiblh I’ll definetely continue reading through your functions, congratulations. It is very important to have high quality material on the web, we are able to rely on them as a reliable source for the tasks.I have see clearly along with enjoyment and Im sure I’m gonna study the rest of the stuff you will create, great work man!.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *