NAGIOS INSTALLATION
https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/how-to-install-nagios-on-ubuntu-22-04.html
https://www.howtoforge.com/tutorial/how-to-install-nagios-on-ubuntu-2004/
============SERVER=================
1 clear
2 apt update
3 sudo apt install -y autoconf bc gawk dc build-essential gcc libc6 make wget unzip apache2 php libapache2-mod-php libgd-dev libmcrypt-dev make libssl-dev snmp libnet-snmp-perl gettext
4 cd ~
5 ls
6 cd ~/
7 ls
8 wget https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.6.tar.gz
9 tar -xf nagios-4.4.6.tar.gz
10 ls
11 cd nagioscore-nagios-4.4.6/
12 ./configure --with-httpd-conf=/etc/apache2/sites-enabled
13 make all
14 make install-groups-users
15 usermod -a -G nagios www-data
16 make install
17 make install-daemoninit
18 make install-commandmode
19 make install-config
20 make install-webconf
21 a2enmod rewrite cgi
22 systemctl restart apache2
23 sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
24 for svc in Apache ssh; do ufw allow $svc; done
25 ufw enable
26 ufw status numbered
27 apt install monitoring-plugins nagios-nrpe-plugin
28 cd /usr/local/nagios/etc
29 mkdir -p /usr/local/nagios/etc/servers
30 vim nagios.cfg
31 vim resource.cfg
32 vim objects/contacts.cfg
33 vim objects/commands.cfg
34 systemctl start nagios
35 systemctl enable nagios
36 systemctl status nagios
37 systemctl restart apache2
38 cd /usr/lib/nagios/plugins/check_nrpe -H 172.31.53.136
39 /usr/lib/nagios/plugins/check_nrpe -H 172.16.0.6
40 /usr/lib/nagios/plugins/check_nrpe -H 172.31.53.136
41 /usr/lib/nagios/plugins/check_nrpe -H 172.31.53.136 -c check_ping
42 cd /usr/local/nagios/etc
43 ls
44 vi servers/
45 cd servers/
46 ls
47 vi client01.cfg
48 systemctl restart nagios
49 cd
50 systemctl restart nagios
51 cd /usr/local/nagios/etc/
52 cd servers/
53 vi client01.cfg
54 systemctl restart nagios
55 systemctl status nagios
56 history
==============================AGENT====================================
1 clear
2 apt update
3 apt install nagios-nrpe-server monitoring-plugins
4 cd /etc/nagios/
5 vim nrpe.cfg
6 vim nrpe_local.cfg
7 systemctl restart nagios-nrpe-server
8 systemctl enable nagios-nrpe-server
9 systemctl status nagios-nrpe-server
10 history