自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

nagios監(jiān)控網(wǎng)絡(luò)服務(wù)器和網(wǎng)絡(luò)服務(wù)故障解決篇

安全 網(wǎng)站安全
nagios是一個(gè)完全GPL協(xié)議的開源軟件包,包含有nagios主程序和它的各個(gè)插件,配置非常靈活,可以監(jiān)視的項(xiàng)目很多,可以自定義shell腳本進(jìn)行監(jiān)控服務(wù),非常適合大型網(wǎng)絡(luò)。那么在nagios添加主機(jī)和服務(wù)可能出現(xiàn)的問題該如何解決?

nagios添加主機(jī)和服務(wù)可能出現(xiàn)的問題有如下情況:

1:配置參數(shù)出現(xiàn)問題,如果你沒有檢查配置就啟動(dòng)nagios,可能會(huì)啟動(dòng)成功,但是顯示會(huì)不正常;

解決方法:調(diào)整配置參數(shù)

2:Connection refused

當(dāng)出現(xiàn)這個(gè)問題的時(shí)候,我開始以為是ssh的無密碼登錄沒有成功,但是其實(shí)我的服務(wù)器沒有啟動(dòng)該服務(wù)造成的,啟動(dòng)服務(wù)即可。但是這些是有端口的服務(wù),沒有使用端口的狀態(tài)任何檢測(cè)?使用nrpe,ok,我們現(xiàn)在在服務(wù)器上安裝nrpe:

一、遠(yuǎn)程主機(jī)的配置 

1、安裝nrpe與配置 

  1. fetch http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz   
  2. tar zxvf nrpe-2.5.2.tar.gz   
  3. cd nrpe-2.5.2   
  4. ./configure --enable-ssl --enable-command-args    
  5. make all    
  6. mkdir -p /usr/local/nagios/etc   
  7. mkdir /usr/local/nagios/bin    
  8. mkdir /usr/local/nagios/libexec    
  9. pw addgroup nagios   
  10. pw useradd nagios -g nagios -d /usr/local/nagios/ -s /sbin/nologin    
  11. chown -R nagios:nagios /usr/local/nagios    
  12. cp ./sample-config/nrpe.cfg /usr/local/nagios/etc    
  13. cp src/nrpe /usr/local/nagios/bin   

2、啟動(dòng)nrpe,端口為5666 

  1. /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d   
  2. netstat -ant | grep 5666   
  3. tcp4     0     0 *.5666           *.*             LISTEN  

二、監(jiān)控服務(wù)器上的配置 

1、安裝nrpe(主要是使用check_nrpe模塊)

  1. fetch http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz   
  2. tar zxvf nrpe-2.5.2.tar.gz   
  3. cd nrpe-2.5.2   
  4. ./configure --enable-ssl --enable-command-args   
  5. make all    
  6. cp src/check_nrpe /usr/local/nagios/libexec   

2、nagios文件的配置 

vi checkcommands.cfg 

定義check_nrpe命令

  1. # 'check_nrep' command definition   
  2. define command{   
  3.     command_name check_nrpe   
  4.     command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$    
  5.     }  

三、上面我們已經(jīng)配置了一部分參數(shù)

下面是配置的最終結(jié)果:

  1. define host{   
  2.     use               generic-host         ; Name of host template to use   
  3.     host_name           test_nrpe   
  4.     alias             client   
  5.     address           10.5.1.156   
  6.     check_command       check-host-alive   
  7.     max_check_attempts     1   
  8.     check_period         24x7   
  9.     notification_interval   120   
  10.     notification_period   24x7   
  11.     notification_options   d,r   
  12.     contact_groups admins   
  13.     }   
  14.  
  15. # 'check_load' command definition   
  16. define command{   
  17.     command_name   check_load   
  18.     command_line   $USER1$/check_load -w $ARG1$ -c $ARG2$    
  19.     }   
  20.  
  21. # 'check_load' command definition   
  22. define command{   
  23.     command_name   check_disk   
  24.     command_line   $USER1$/check_disk -w $ARG1$ -c $ARG2$    
  25.     }   
  26. define service{   
  27.     use                   generic-service       ; Name of service template to use   
  28.     host_name               test_nrpe   
  29.     service_description         PING   
  30.     is_volatile               0   
  31.     check_period             24x7   
  32.     max_check_attempts         1   
  33.     normal_check_interval       1   
  34.     retry_check_interval         1   
  35.     contact_groups             admins   
  36.     notification_options         w,u,c,r   
  37.     notification_interval       960   
  38.     notification_period         24x7   
  39.     check_command             check_ping!100.0,20%!500.0,60%   
  40.     }   
  41.  
  42. define service{   
  43.     use                   generic-service       ; Name of service template to use   
  44.     host_name               test_nrpe   
  45.     service_description         apache   
  46.     is_volatile               0   
  47.     check_period             24x7   
  48.     max_check_attempts         1   
  49.     normal_check_interval       1   
  50.     retry_check_interval         1   
  51.     contact_groups             admins   
  52.     notification_options         w,u,c,r   
  53.     notification_interval       960   
  54.     notification_period         24x7   
  55.     check_command             check_http!100.0,20%!500.0,60%   
  56.     }   
  57.  
  58. define service{   
  59.     use                   generic-service       ; Name of service template to use   
  60.     host_name               test_nrpe   
  61.     service_description         mysql   
  62.     is_volatile               0   
  63.     check_period             24x7   
  64.     max_check_attempts         1   
  65.     normal_check_interval       1   
  66.     retry_check_interval         1   
  67.     contact_groups             admins   
  68.     notification_options         w,u,c,r   
  69.     notification_interval       960   
  70.     notification_period         24x7   
  71.     check_command             check_mysql!100.0,20%!500.0,60%   
  72.     }   
  73.  
  74. define service{   
  75.     use                   generic-service       ; Name of service template to use   
  76.     host_name               test_nrpe   
  77.     service_description         ntp    
  78.     is_volatile               0   
  79.     check_period             24x7   
  80.     max_check_attempts         1   
  81.     normal_check_interval       1   
  82.     retry_check_interval         1   
  83.     contact_groups             admins   
  84.     notification_options         w,u,c,r   
  85.     notification_interval       960   
  86.     notification_period         24x7   
  87.     check_command             check_ntp!100.0,20%!500.0,60%   
  88.     }   
  89.  
  90. define service{   
  91.     use                   generic-service       ; Name of service template to use   
  92.     host_name               test_nrpe   
  93.     service_description         qmail_smtp      
  94.     is_volatile               0   
  95.     check_period             24x7   
  96.     max_check_attempts         1   
  97.     normal_check_interval       1   
  98.     retry_check_interval         1   
  99.     contact_groups             admins   
  100.     notification_options         w,u,c,r   
  101.     notification_interval       960   
  102.     notification_period         24x7   
  103.     check_command             check_smtp!100.0,20%!500.0,60%    
  104.     }   
  105.  
  106. define service{   
  107.     use                   generic-service       ; Name of service template to use   
  108.     host_name               test_nrpe   
  109.     service_description         qmail_pop3      
  110.     is_volatile               0   
  111.     check_period             24x7   
  112.     max_check_attempts         1   
  113.     normal_check_interval       1   
  114.     retry_check_interval         1   
  115.     contact_groups             admins   
  116.     notification_options         w,u,c,r   
  117.     notification_interval       960   
  118.     notification_period         24x7   
  119.     check_command             check_pop!100.0,20%!500.0,60%    
  120.     }   
  121.  
  122. define service{   
  123.     use                   generic-service       ; Name of service template to use   
  124.     host_name               test_nrpe   
  125.     service_description         test_load   
  126.     is_volatile               0   
  127.     check_period             24x7   
  128.     max_check_attempts         1   
  129.     normal_check_interval       1   
  130.     retry_check_interval         1   
  131.     contact_groups             admins   
  132.     notification_options         w,u,c,r   
  133.     notification_interval       960   
  134.     notification_period         24x7   
  135.     check_command             check_load!100.0,20%!500.0,60%   
  136.     }   
  137.  
  138. define service{   
  139. use                   generic-service       ; Name of service template to use   
  140.     host_name               test_nrpe   
  141.     service_description         test_disk    
  142.     is_volatile               0   
  143.     check_period             24x7   
  144.     max_check_attempts         1   
  145.     normal_check_interval       1   
  146.     retry_check_interval         1   
  147.     contact_groups             admins   
  148.     notification_options         w,u,c,r   
  149.     notification_interval       960   
  150.     notification_period         24x7   
  151.     check_command             check_disk!100.0,20%!500.0,60%      
  152.     }  

四、檢查配置參數(shù)并重啟nagios

如何在nagios中使用外部命令

  1. vi /usr/local/nagios/etc/nagios.cfg   
  2. check_external_commands=1   
  3.  
  4. mkdir /usr/local/nagios/var/rw   
  5. chown nagios.nagcmd /usr/local/nagios/var/rw   
  6. chmod u+rw /usr/local/nagios/var/rw   
  7. chmod g+rw /usr/local/nagios/var/rw   
  8. chmod g+s /usr/local/nagios/var/rw   
  9.  
  10. svc -t /service/nagios/   
  11. /usr/local/apache2/bin/apachectl restart 

nagios監(jiān)控網(wǎng)絡(luò)服務(wù)器和網(wǎng)絡(luò)服務(wù)問題的解決就結(jié)束了,有關(guān)nagios的基礎(chǔ)內(nèi)容您可以參考:概念篇安裝篇配置篇

責(zé)任編輯:佚名 來源: ChinaUnix
相關(guān)推薦

2011-08-22 11:00:10

nagios

2011-08-22 11:00:14

nagios

2011-08-22 11:00:17

nagios

2011-03-22 15:17:13

Nagios監(jiān)控

2011-03-22 15:17:14

Nagios安裝

2011-03-22 15:17:14

Nagios安裝

2011-03-21 11:21:04

LinuxNagios

2011-02-22 11:23:48

vsFTPDLinux服務(wù)器

2011-07-14 14:17:33

網(wǎng)絡(luò)服務(wù)器配置DNS服務(wù)器

2011-07-14 14:45:01

網(wǎng)絡(luò)服務(wù)器配置DHCP服務(wù)器

2011-07-14 15:28:11

服務(wù)器

2011-09-05 09:23:50

2014-06-26 14:10:44

2011-02-22 11:23:48

vsFTPDLinux服務(wù)器

2010-03-24 11:39:01

2011-07-14 14:58:19

網(wǎng)絡(luò)服務(wù)器配置服務(wù)器

2011-03-22 13:50:53

2018-08-09 09:10:54

2012-10-25 13:57:46

2011-07-14 13:13:44

網(wǎng)絡(luò)服務(wù)器配置
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)