-
Notifications
You must be signed in to change notification settings - Fork 89
/
Nagios_CoreI_nstallation.
69 lines (55 loc) · 1.84 KB
/
Nagios_CoreI_nstallation.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## Disable SELinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled' /etc/selinux/config
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
cat /etc/selinux/config
setenforce 0
## Add Firewall rule to allow http and https
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
## Configure EPEL Repository
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
## Install Required dependent packages
yum install wget php gcc glibc-common gd gd-devel make net-snmp perl perl-devel openssl
## Download Nagios Core Package
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz
## Extract Downloaded package using tar
tar -xvf nagios-4.4.6.tar.gz
## Create Nagios user and group
groupadd nagcmd
groupadd nagios
useradd -g nagios -G nagcmd nagios
usermod -aG nagcmd apache
## Change directory path into extracted package
cd nagios-4.4.6
./configure --with-command-group=nagcmd
make all
make install
make install
make install-init
make install-commandmode
make install-config
make install-exfoliation
make install-webconf
## Create Nagiosadmin user with password for web access
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
## Enable and start httpd & nagios services
systemctl enable httpd
systemctl start httpd
systemctl enable nagios
systemctl start nagios
## Verify the Nagios config
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
## Download Nagios Plugins and Install
cd /tmp/
wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
tar -xvf nagios-plugins-2.3.3.tar.gz
cd nagios-plugins-2.3.3
./configure --with-nagios-user=nagios --with-nagios-group=nagcmd
make
make install
## Verify the plugins in below path
cd /usr/local/nagios/libexec/
ls
## Access Nagios Web console
http://NagiosServerIP/nagios