# Install the required packages yum install gcc glibc glibc-common wget gd gd-devel perl postfix unzip zip httpd php # php安装后可访问web页面 # Download and Install Nagios Core cd /tmp wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.3.tar.gz tar xzf nagios-4.4.3.tar.gz ./configure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
useradd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagcmd apache # 得安装httpd才有
./configure --with-nagios-group=nagios --with-command-group=nagcmd make all make install make install-init # Next, run the following command to install the Nagios sample configuration files make install-config # To, install the initialization script which can be used to manage your Nagios service, run the following command make install-daemoninit # Run the following command to install and configure the external command file to make Nagios Core to work from the command line: make install-commandmode # The following command will install the Apache web server configuration files make install-webconf # After all the installations are complete, restart your apache service with: systemctl restart httpd
wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz tar -zxvf nagios-plugins-2.2.1.tar.gz cd /tmp/nagios-plugins-2.2.1/ # Compile and install the Nagios plugins. ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install