#author(“2018-03-30T10:08:31+00:00”,“default:kazuma”,“kazuma”) Nagios
useradd nagios
yum install make gcc patch httpd httpd-devel openssl gcc gd gd-devel php php-mbstring
cd /usr/local/src
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
tar zxvf nagios-3.4.1.tar.gz
cd nagios
wget http://ftp.momo-i.org/pub/other/nagios-jp-3.4.1.patch.gz
gzip -dc nagios-jp-3.4.1.patch.gz | patch -p1
./configure --with-nagios-user=nagios \
--with-nagios-group=nagios \
--with-command-user=apache \
--with-command-group=apache \
--with-httpd-conf=/usr/local/apache2/conf
make
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
cd /usr/local/src
tar xfvz nagios-plugins-1.4.15.tar.gz
make
make install
chown -R nagios:nagios /usr/local/nagios
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd reload
vi /etc/httpd/conf.d/nagios.conf <Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
# Order allow,deny
# Allow from all
Order deny,allow
Deny from all
# Allow from 127.0.0.1
Allow from IPアドレス
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
# Order allow,deny
Order deny,allow
# Allow from all
# Order deny,allow
Deny from all
# Allow from 127.0.0.1
Allow from IPアドレスを指定
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
service httpd reload
vi /etc/sysconfig/iptables #HTTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
service nagios start
chkconfig --add nagios
chkconfig nagios on