Nagios系統下nagios.cfg配置說明
nagios系統nagios.cfg 配置說明
1、aggregate_status_updates = <0/1> 統計狀態更新選項:0不更新;1更新
2、status_update_interval= 狀態更新間隔:秒
3、enable_notifications = <0/1> 是否通知:0不通知;1通知
4、execute_service_checks = <0/1> 檢查服務選項:0不檢查;1檢查
5、accept_passive_service_checks=<0/1> 是否接受被動服務檢查:0不檢查;1檢查
6、enable_event_handlers=<0/1> 事件處理:0不檢查;1檢查
7、log_rotation_method=
log輪循:
n = None (don't rotate the log - this is the default)
h = Hourly (rotate the log at the top of each hour)
d = Daily (rotate the log at midnight each day)
w = Weekly (rotate the log at midnight on Saturday)
m = Monthly (rotate the log at midnight on the last day of the month)
8、check_external_commands=<0/1>
9、service_check_timeout = 如果服務檢查時間超過了所定義的時間,顯示CRITICAL狀態。
10、host_check_timeout= 如果主機檢查時間超過了所定義的時間,顯示CRITICAL狀態。
11、event_handler_timeout= 事件處理最長時間,超出后Warning記錄到log中。
12、process_performance_data=<0/1> 性能監測選項:0不檢查;1檢查
13、check_service_freshness=<0/1> 刷新服務選項:0不檢查;1檢查
14、illegal_object_name_chars= 不規范定義字符
一、主要包括的定義文件有: Services、Hosts、Host Groups、Contacts、Contact Groups、Commands、Time Periods、Service Escalations、Service Dependencies、Host Escalations、Host Dependencies、Hostgroup Escalations
1.CGI.cfg
1)、main_config_file=/usr/local/nagios/etc/nagios.cfg Nagios主配置文件
2)、physical_html_path=/usr/local/nagios/share web頁面所在路徑
3)、use_authentication=<0/1> 用戶驗證選項:0不驗證;1驗證
2.配置驗證
1)、vi httpd.conf,添加下面的內容到httpd.conf文件中
- AllowOverride AuthConfig
- order allow,deny
- allow from all
- Options ExecCGI
2)、如果還需要對html頁面也進行驗證,需要vi httpd.conf,添加下面的內容
- AllowOverride AuthConfig
- order allow,deny
- allow from all
3)、然后在cgi所在目錄新增.htaccess文件,文件內容見下面
- AuthName "Nagios Access"
- AuthType Basic
- AuthUserFile /usr/local/nagios/etc/htpasswd.users
- require valid-user
4)、設置驗證用戶賬號
- htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
5)、默認權限
【編輯推薦】