Nagiosモニタリングプラットフォームの迅速なインストール


Nagiosはオープンソースの無料ネットワーク監視ツールで、Windows、Linux、Unixのホスト状態、スイッチルータなどのネットワーク設定、プリンタなどを効果的に監視することができます.
 
一、まずapacheをインストールする:
   
   
   
   
  1. apache, yum , yum install –y httpd  
  2. apache , apache /etc/init.d/httpd restart  ! 

 
二、phpをインストールする:
   
   
   
   
  1. Nagios php , php, yum  
  2. Yum install php php-devel -y  

  
三、nagiosをダウンロードする:
   
   
   
   
  1. nagios :  
  2. wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.2.1/nagios-3.2.1.tar.gz/download  
  3. wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download   
  4. wget  http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz   
  5.    
  6. Nagios  
  7. useradd nagios  
  8. passwd nagios 

四、サーバー側で、Nagiosとnrpe、nagiosプラグインをインストールする:
   
   
   
   
  1. Nagios  
  2. tar zxvf nagios-3.2.1.tar.gz  
  3. cd nagios-3.2.1  
  4. ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios  
  5. make all  
  6. make install                   // ,CGI HTML  
  7. make install-init              // /etc/rc.d/init.d  
  8. make install-config            // , /usr/local/nagios/etc  
  9. make install-commandmode//    
  10. make install-webconf       
  11.    
  12. Nagios-plugins  
  13. tar zxvf nagios-plugins-1.4.15.tar.gz  
  14. cd nagios-plugins-1.4.15  
  15. ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios  
  16. make && make install  
  17. nrpe   
  18. tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config  
  19. chown  -R nagios:nagios /usr/local/nagios/   
  20.  
  21. /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d   nrpe  

 
五、webアクセスユーザーの作成:
   
   
   
   
  1. :( c)  
  2. htpasswd -c /usr/local/nagios/etc/htpasswd.users  nagiosadmin  
  3.  
  4. nagios , apache, nagios,/etc/init.d/nagios restart  
  5. :http://localhost/nagios/  !  nagios  

 
六、クライアントにnrpe、nagios-pluginをインストールする:
   
   
   
   
  1. nagios-plugins-1.4.15.tar.gz nrpe-2.13.tar.gz,  
  2.    
  3. :  
  4. #!/bin/sh  
  5. ###auto make install nagios_plugin and nrpe  
  6. useradd nagios  
  7. tar -xzf nagios-plugins-1.4.15.tar.gz &&cd nagios-plugins-1.4.15 &&./configure --prefix=/usr/local/nagios &&make &&make install  
  8.    
  9. sleep 2  
  10.    
  11. echo "This is make install nrpe ,please waiting .................."  
  12. cd ../ ; tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config  
  13.    
  14. chown  -R nagios:nagios /usr/local/nagios/  
  15. cd .. ;cp nrpe.cfg /usr/local/nagios/etc/nrpe.cfg  
  16.    
  17. /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d  
  18.    
  19. ###Add auto start  
  20. grep "nrpe" /etc/rc.local  
  21.    
  22. if [ $? -ne 0 ];then  
  23. echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local  
  24. else  
  25. echo "nrpe is exist"  
  26. fi  
  27. !