Nagios install

Da GibeWiki.
Jump to navigation Jump to search
Nagios install
step by step
apt update
apt upgrade
apt install -y autoconf bc gawk dc build-essential gcc libc6 make wget unzip libapache2-mod-php libgd-dev libmcrypt-dev make libssl-dev snmp libnet-snmp-perl gettext
cd Scaricati
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.14.tar.gz
tar xvf nagios-4.4.14.tar.gz
cd nagios-4.4.14
./configure --with-httpd-cof=/etc/apache2/sites-enabled
Deve uscire: Review the options above for accuracy. If they look okay,

type 'make all' to compile the main program and CGIs.

make all
make install-groups-users
usermod -a -G nagios www-data
make install
Deve uscire: *** Main program, CGIs and HTML files installed ***
make install-daemoninit
make install-init
make install-commandmode
make install-config
make install-webconf
a2enmod rewrite cgi
cd
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadm
apt install monitoring-plugins nagios-nrpe-plugin -y
cd /usr/local/nagios/etc
vi nagios.cfg
Togli # da
  1. cfg_dir=/usr/local/nagios/etc/servers
  2. cfg_dir=/usr/local/nagios/etc/printers
  3. cfg_dir=/usr/local/nagios/etc/switches
  4. cfg_dir=/usr/local/nagios/etc/routers

e salva.

mkdir servers printers switches routers
vi resource.cfg
Aggiungi sotto $USER1$=/usr/local/nagios/libexec

$USER1$=/usr/lib/nagios/plugins e salva.

cd objects
vi contacts.cfg
sostituisci email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******Testo della cella

con nagios@giberti.net

vi commands.cfg
in fondo aggiungi:

define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ - c $ARG1$ } e salva.

Se vuoi il firewall

ufw status ufw ebavke ufw allow 80 ufw allow 443 ufw allow 22 ufw reload ufw status

systemctl restart apache2
systemctl restart nagios
systemctl enable apache2
systemctl enable nagios
systemctl status apache2
systemctl status nagios
fine