- #yum -y install httpd gcc glibc glibc-common gd gd-devel
- #su -l
- #/usr/sbin/useradd nagios
- #passwd nagios
- #/usr/sbin/groupadd nagcmd
- #/usr/sbin/usermod -G nagcmd nagios
- #/usr/sbin/usermod -G nagcmd apache
- #mkdir ~/downloads
- #cd ~/downloads
- #wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc1.tar.gz
- #wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
- #cd ~/downloads
- #tar xzf nagios-3.0rc1.tar.gz
- #cd nagios-3.0rc1
- #./configure --with-command-group=nagcmd
- #make all
- #make install
- #make install-init
- #make install-config
- #make install-commandmode
- #vi /usr/local/nagios/etc/objects/contacts.cfg
- #htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
- #service httpd restart
- #cd ~/downloads
- #tar xzf nagios-plugins-1.4.11.tar.gz
- #cd nagios-plugins-1.4.11
- #./configure --with-nagios-user=nagios --with-nagios-group=nagios
- #make
- #make install
- #chkconfig --add nagios
- #chkconfig nagios on
- #/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
- #service nagios start
- setenforce 0
- #chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
- #chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
- http://localhost/nagios/
- #tar xzf nrpe-2.8.1.tar.gz
- #cd nrpe-2.8.1
- #./configure
- #make all
- #make install-plugin
- define command{
- command_name check_nrpe
- command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }
- #/usr/sbin/useradd nagios
- #passwd nagios
- #tar xzf nagios-plugins-1.4.9.tar.gz
- #cd nagios-plugins-1.4.9
- #./configure --prefix=/usr/local/nagios
- #make && make install
- #chown nagios.nagios /usr/local/nagios/
- #chown -R nagios.nagios /usr/local/nagios/libexec/
- #tar xzf nrpe-2.8.1.tar.gz
- #cd nrpe-2.8.1
- #./configure
- #make all
- #make install-plugin
- #make install-daemon
- #make install-daemon-config
- #/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
- #make install-xinetd
- # /etc/init.d/xinetd restart
- # netstat -nl | grep 5666
- tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
- # lsof -i:5666
- COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
- xinetd 9949 root 5u IPv4 28764 TCP *:nrpe (LISTEN)
- # /usr/local/nagios/libexec/check_nrpe -H x.x.x.x
- #yum -y install openssl-devel
- #yum install php –y