服務端
一. nagios 的配置文件在 /usr/local/nagios/etc
1.vi cgi.cfg
refresh_rate=30 #nagios主頁的刷新時間,我設置成30秒自動刷新
use_authentication=0 #關閉認證功能,當nagios配置好后,建議開回來
2.在配置文件/usr/local/nagios/etc/nagios.cfg
已經定義了所用主機文件都在servers
3.在servers 下創建新建主機目錄
例:被監控的主機IP:192.168.66.221
[root@localhost etc]# cd /usr/local/nagios/etc/servers
[root@localhost servers]# vi 192.168.66.221.cfg
編輯內容為:
define service{
use generic-service
host_name 192.168.66.221 (被監控主機的IP)
service_description check_sda1
check_command check_nrpe!check_sda1
max_check_attempts 5
normal_check_interval 1
}
define host{
use linux-server
host_name 192.168.66.221 (被監控主機的IP)
alias 192.168.66.221?。ū槐O控主機的IP)
address 192.168.66.221 (被監控主機的IP)
}
define service{
use generic-service
host_name 192.168.66.221 (被監控主機的IP)
service_description check_ping
check_command check_ping!100.0,20%!200.0,50%
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.66.221 (被監控主機的IP)
service_description check_ftp
check_command check_ftp!21
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.66.221 (被監控主機的IP)
service_description check_ssh
check_command check_ssh
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.66.221 (被監控主機的IP)
service_description check_http
check_command check_http
max_check_attempts 5
normal_check_interval 1
}
被監控端
在/usr/local/nagios/etc 下的nrpe.cfg
修改配置;server_address=192.168.66.221(本地IP)
allowed_hosts=192.168.211.129(服務端IP)
未完
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。