0% found this document useful (0 votes)
55 views3 pages

Nagios Server 1 Sudo Apt-Get Update

The document provides instructions for installing and configuring a Nagios server and monitoring clients (remote hosts). It involves setting up users and groups, installing packages, downloading and compiling Nagios core, NRPE, and plugins. Configuration files are edited and services are enabled and started. Steps are included to configure monitoring checks between the server and remote hosts.

Uploaded by

Ravi Ghantasala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views3 pages

Nagios Server 1 Sudo Apt-Get Update

The document provides instructions for installing and configuring a Nagios server and monitoring clients (remote hosts). It involves setting up users and groups, installing packages, downloading and compiling Nagios core, NRPE, and plugins. Configuration files are edited and services are enabled and started. Steps are included to configure monitoring checks between the server and remote hosts.

Uploaded by

Ravi Ghantasala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Nagios server

1 sudo apt-get update


2 sudo useradd nagios
3 sudo groupadd nagcmd
4 sudo usermod -a -G nagcmd nagios
5 sudo apt-get update
6 sudo apt-get install -y autoconf gcc libc6 make wget unzip apache2 php
libapache2-mod-php7.0 libgd2-xpm-dev
7 sudo apt-get install build-essential libgd2-xpm-dev openssl libssl-dev unzip
8 wget -O nagioscore.tar.g
https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.3.tar.gz
9 tar zxf nagios-*.tar.gz
10 ls
11 tar zxf nagios*.tar.gz
12 ls
13 cd nagios-*
14 cd nagios*
15 sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
16 ./configure --with-nagios-group=nagios --with-command-group=nagcmd
17 sudo ./configure --with-nagios-group=nagios --with-command-group=nagcmd
18 sudo make all
19 sudo make install
20 sudo make install-commandmode
21 sudo make install-config
22 sudo make install-init
23 sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-
available/nagios.conf
24 sudo usermod -G nagcmd www-data
25 curl -L -O
https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.2.1/nrpe-
3.2.1.tar.gz
26 tar zxf nrpe-*.tar.gz
27 ls
28 rm -rf nrpe-3.2.1
29 ls
30 rm -rf nrpe-3.2.1.tar.gz
31 ls
32 cd
33 curl -L -O
https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-
3.2.1/nrpe-3.2.1.tar.gz
34 tar zxf nrpe-*.tar.gz
35 cd nrpe-*
36 ./configure
37 make check_nrpe
38 sudo make install-plugin
39 sudo nano /usr/local/nagios/etc/nagios.cfg
40 sudo mkdir /usr/local/nagios/etc/servers
41 sudo nano /usr/local/nagios/etc/objects/contacts.cfg
42 sudo nano /usr/local/nagios/etc/objects/commands.cfg
43 sudo a2enmod rewrite
44 sudo a2enmod cgi
45 sudo ln -s /etc/apache2/sites-available/nagios.conf /etc/apache2/sites- enabled/
46 sudo systemctl restart apache2
47 sudo systemctl start nagios
48 sudo nano /etc/apache2/sites-available/nagios.conf
49 sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
50 sudo systemctl restart apache2
51 sudo systemctl status apache2
52 sudo nano /etc/apache2/sites-available/nagios.conf
53 sudo systemctl status apache2
54 sudo systemctl restart apache2
55 sudo nano /etc/systemd/system/nagios.service
56 sudo systemctl enable /etc/systemd/system/nagios.service
57 sudo systemctl start nagios
58 sudo systemctl restart nagios
59 sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev
wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
60 sudo systemctl restart nagios
61 sudo nano /etc/systemd/system/nagios.service
62 sudo nano /etc/apache2/sites-available/nagios.conf
63 sudo systemctl restart nagios
64 cd
65 wget --no-check-certificate -O nagios-plugins.tar.gz
https://github.com/nagios-plugins/nagios-plugins/archive/release-
2.2.1.tar.gz
66 tar zxf nagios-plugins.tar.gz
67 ls
68 cd nagios-plugins-release-2.2.1/
69 sudo ./tools/setup
70 sudo ./configure
71 sudo make
72 sudo make install
73 sudo systemctl restart apache2
74 sudo systemctl restart nagios
75 /usr/local/nagios/libexec/check_nrpe -H remote_host_ip
76 /usr/local/nagios/libexec/check_nrpe -H 192.168.35.31
77 df -h /
78 sudo nano /usr/local/nagios/etc/nrpe.cfg
79 sudo systemctl restart nrpe.service
80 sudo systemctl restart nrpe
81 sudo nano
/usr/local/nagios/etc/servers/your_monitored_server_host_name.cfg
82 sudo nano /usr/local/nagios/etc/servers/node1.cfg
83 sudo systemctl restart nagios

Remote hosts

1 sudo useradd nagios


2 sudo apt-get update
3 sudo apt-get install build-essential libgd2-xpm-dev openssl libssl-dev unzip
4 sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev
wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
5 wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-
plugins/nagios-plugins/archive/release-2.2.1.tar.gz
6 tar zxf nagios-plugins.tar.gz
7 ls
8 cd nagios-plugins-release-2.2.1/
9 sudo ./tools/setup
10 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-
openssl
11 sudo make
12 sudo make install
13 cd
14 curl -L -O https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-
3.2.1/nrpe-3.2.1.tar.gz
15 tar zxf nrpe-*.tar.gz
16 cd nrpe-*
17 ./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
18 sudo make all
19 sudo make install
20 sudo make install-config
21 sudo make install-init
22 sudo nano /usr/local/nagios/etc/nrpe.cfg
23 sudo systemctl start nrpe.service
24 sudo systemctl status nrpe.service
25 sudo ufw allow 5666/tcp

You might also like