HOME | LINUX | CISCO NETWORKING |   
PosgreSQL | Nginx | MariaDB | Bash Shell | GlusterFS | XEN | Cluster | VIM | Iptables | Nagios | Qmail  


nagios 설치하기


 # 설치전 환경설정하기 
 yum -y install gd-* net-snmp openldap-* perl-CPAN 
 perl -MCPAN -e 'install Net::SNMP'
 
 groupadd -g 9000 nagios 
 groupadd -g 9001 nagcmd 
 useradd -u 9000 -g nagios -G nagcmd -d /usr/local/nagios -c "Nagios Admin" nagios 
 
 egrep "^User" /etc/httpd/conf/httpd.conf 
 User nobody 
 
 # nobody 그룹추가해준다. 
 usermod -G nagcmd nobody 
 
 mkdir -p /usr/local/nagios /etc/nagios /var/nagios 
 chown nagios:nagios /usr/local/nagios /etc/nagios /var/nagios 
 
 # 소스설치하기   
 wget -P /usr/local/src http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.1.tar.gz
 cd /usr/local/src
 tar xzvfp nagios-3.5.1.tar.gz
 cd nagios-3.5.1 
 ./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios --with-command-group=nagcmd 
 
 make all
 make install 
 make install-init
 make install-commandmode 
 make install-config 
 
 # /usr/local/nagios 
 #  - /bin : nagios 의 메인 프로그램 
 #  - /libexec : Plugins 프로그램 
 #  - /sbin : CGI 스크립트 프로그램 
 #  - /share : 문서들과 웹 문서들 

 # nagios plugins 설치하기 
 
 wget -P /usr/local/src http://assets.nagios.com/downloads/nagiosplugins/nagios-plugins-1.5.tar.gz
 cd /usr/local/src/
 tar xzvfp nagios-plugins-1.5.tar.gz
 cd nagios-plugins-1.5 
 ./configure --sysconfdir=/etc/nagios --localstatedir=/var/nagios 

 make all
 make install 
 
 chown root.nagios /usr/local/nagios/libexec/check_icmp 
 chmod 4711 /usr/local/nagios/libexec/check_icmp 
 
 # nagios를 위한 아파치 설정하기 
 ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin 
 <Directory "/usr/local/nagios/sbin">
 	AllowOverride AuthConfig 
 	Options ExecCGI 
 	Order allow,deny
 	Allow from 192.168.10.20 
 	AuthName "Nagios Monitoring"
 	AuthType Basic 
 	AuthUserFile /etc/nagios/htpasswd 
 	require valid-user 
 <Directory>
 
 Alias /nagios /usr/local/nagios/share
 <Directory "/usr/local/nagios/share">
    Options None
    AllowOverride AuthConfig
    Order   allow,deny
    Allow from all
  	AuthName "Nagios Monitoring"
 	AuthType Basic 
 	AuthUserFile /etc/nagios/htpasswd 
 	require valid-user 
 <Directory>

 
 
 # 해당 CGI 디렉토리 사용자 계정만들기 
 htpasswd -c /etc/nagios/htpasswd admin 
 
 # 패스워드 입력하고, 패스워드 분실을 대비하기 위해서 nagios 계정하나를
 # 더 생성한다 
 htpasswd /etc/nagios/htpasswd nagios 
 
 chown nobody /etc/nagios/htpasswd 
 chmod 600 /etc/nagios/htpasswd 
 
 service httpd reload 
 
 



Home | Linux | Network | About Me |