More Related Content
Similar to use Nagios on openSUSE 11.4
Similar to use Nagios on openSUSE 11.4 (20)
use Nagios on openSUSE 11.4
- 12. 主機定義
define host{
use linux-server
host_name mail01
alias mail server 01
address 172.18.55.202
notifications_enabled 1
process_perf_data 1
check_command check-host-alive
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
- 14. 服務定義
define service{
name ping
check_command
check_ping!100.0,20%!500.0,60%
contact_groups nagios-admins
check_period 24x7
max_check_attempts 3
normal_check_interval 5
notification_interval 120
notification_period 24x7
notification_options c,r
}
- 20. 安裝 nagios主要套件
#zypper install nagios nagios-plugins-extra
若要收集其他主機資訊,可一併安裝nagios-nrpe
安裝後會協助建置nagios所需帳號<nagios>、群組<nagios>與
<nagcmd>
#grep nagiso /etc/passwd
#grep nag /etc/group
而 nagios的相關設定檔案在 /etc/nagios之下
- 21. 設定 nagios的帳號與密碼
管理帳號
#htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin
檔案與帳號是預設值,若需變動
在 /etc/nagios/cgi.cfg 修改管理帳號
在 /etc/apache2/conf.d/nagios.conf 修改驗證檔案
一般帳號,僅提供檢視報告用
#htpasswd2 /etc/nagios/htpasswd.users nagios
注意,並不需要使用 "-c"囉
確認所需帳號已建立完成
#cat /etc/nagios/htpasswd.users