#Basic support gcc glibc glibc-common gd gd-devel
useradd -m nagios #Add a user named nagios to run nagios
passwd nagios #Set password
groupadd nagcmd #Add nagcmd user group to submit external control commands through web pages
usermod -a -G nagcmd nagios #Add nagios user to nagcmd group
usermod -a -G nagcmd nginx #Add nginx user to nagcmd group
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
wget http://nagios.manubulon.com/nagios-snmp-plugins.1.1.1.tgz
tar zxvf nagios-3.2.0.tar.gz
tar zxvf nagios-plugins-1.4.13.tar.gz
tar zxvf nagios-snmp-plugins.1.1.1.tgz
cd nagios-3.2.0
./configure –with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
At this time, nagios itself has basically been installed
vi /usr/local/nagios/etc/objects/contacts.cfg #Modify the email address in the nagiosadmin line to your email address to send the alarm email to your email
#make install-webconf #Install nagios web interface
#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
#Set the account password for HTTP authentication when logging in to the web interface
#Because I use nginx, so the above three lines are not executed, manually change the nginx configuration by myself
cd ..
cd nagios-plugins-1.4.13
./configure –with-nagios-user=nagios –with-nagios-group=nagios
make
make install
cd ..
cd nagios_plugins
#Install the components used by perl
perl -MCPAN -e shell
cpan> install Net::SNMP
./install.sh #Enter all the way
#nagios complete installation
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg #Check whether the configuration of nagios is correct
/etc/init.d/nagios start
/etc/init.d/nginx start
Nagios needs to use cgi-bin. For the cgi-bin configuration on nginx, please refer to nginx configuration cgi-bin to run perl
Gentoo system installation and configuration nagios+nginx
This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/gentoo-system-installation-and-configuration-nagiosnginx/