Instalando Nagios 4.0.8 - Debian 7

Publicado por Smurf (última atualização em 15/04/2015)

[ Hits: 8.647 ]

Homepage: .

Download Install_Nagios.sh




Script de instalação Nagios 4.0.8 e Plugins 2.0.3. Testado em Debian 7.

  



Esconder código-fonte

#!/bin/bash
echo "INICIANDO O PROCESSO DE INSTALAÇÃO"
sleep 3
echo "ATUALIZANDO O SISTEMA"
sleep 3
apt-get -y update
sleep 3
echo "INSTALANDO PACOTES REQUERIDOS"
sleep 3
apt-get -y install apache2 build-essential libgd2-xpm-dev
apt-get -y install libjpeg62 libjpeg62-dev libpng12-dev
apt-get -y install snmp libsnmp-base
apt-get -y install libssl-dev openssl
apt-get -y install mc rsh-server openssh-server
apt-get -y install php5 php-pear libsnmp9-dev rcconf
apt-get -y install libsasl2-2 libsasl2-modules sasl2-bin mutt postfix
apt-get -y install libapache2-mod-php5
echo "PACOTES INSTALADOS COM SUCESSO!"
sleep 3
echo "INICIANDO CONFIGURAÇÃO DO NAGIOS"
useradd -m -s /bin/bash nagios
passwd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data
cd /dados
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar -zxf nagios-4.0.8.tar.gz
tar -zxf nagios-plugins-2.0.3
mkdir /dados
cd nagios-4.0.8
./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --enable-nanosleep --enable-event-broker --with-snmp --with-net-snmp --with-snmpwalk --with-snmptranslete --with-snmpget
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
echo "USUARIO: nagiosadmin"
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
cd /dados/nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios -with-snmp -with-snmpd -with-snmpwalk
make
make install
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ln -s /etc/init.d/nagios /etc/rc2.d/S99nagios
/etc/init.d/apache2 reload
/etc/init.d/nagios start
apt-get -y  install mailx
apt-get -y  install postfix
/etc/init.d/nagios restart
apt-get -y autoremove
clear
echo "Customize Configuration

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.

http://nagios.sourceforge.net/docs/3_0/config.html

vi /usr/local/nagios/etc/objects/contacts.cfg"

echo "Acesso ao Nagios

http://localhost/nagios"

Scripts recomendados

Instalando o WhatsApp no computador

lock com xscreensaver

Relatório minuto a minuto de todas as conexões do servidor

Init Service for Slackware

Gerando HTML de status de HD e coneccao de internet


  

Comentários
[1] Comentário enviado por removido em 26/04/2015 - 17:27h

Show de bola!

[2] Comentário enviado por thiago.limax64 em 24/07/2015 - 17:12h

Excelente!

Só uma obs: Baixei recentemente o Debian 7.8 e de cara tive dificuldade de instalar os pacotes. Adicionando a fonte abaixo flui 100% as linhas do script.
Mais um detalhe.... o mkdir /dados está depois do cd /dados ;-)

Parabéns cara, muito bom mesmo :-)

#nano /etc/apt/sources.list
deb http://ftp.de.debian.org/debian wheezy main
#apg-get update


[3] Comentário enviado por Jurandir19 em 30/08/2015 - 02:34h

Olá
Corrigi o script na parte de criar a pasta /dados e depois executei o script sem problema mas quando tento acessar pela URL (http://localhost/nagios) informa que a página não localizada neste servidor.

Podem me ajudar?

Agradeço

Uso Debian 8


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts