七、Centreon的配置
需要在Apache的默认根目录建一个index.html文档,否则在Centreon的配置过程中会有错误产生。
# touch /var/www/html/index.html
另外需要将Nagios的配置目录的属组改成apache
# chown nagios.apache /etc/nagios
A、初始化配置













当首次登录后,界面会出现如下错误:

修正方法见下图:



修改好后,请保存,再访问“Home”,就会出现如下画面:

B、配置nagios.cfg

|
名稱 |
設定值 |
|
Object Configuration Directory |
/etc/nagios/ |
|
Log file |
/var/log/nagios/nagios.log |
|
Downtime File |
/var/log/nagios/downtime.log |
|
Comment File |
/var/log/nagios/comment.log |
|
Temp File |
/var/nagios/nagios.tmp |
|
P1 File |
/usr/bin/p1.pl |
|
Lock File |
/var/run/nagios.pid |
|
Object Cache File |
/var/nagios/objects.cache |
|
Status File |
/var/nagios/status.dat |
|
Aggregated Status Updates Option |
Yes |
|
Aggregated Status Data Update Interval |
15 sec |
|
External Command Check Option |
|
|
External Command Check Interval |
1s |
|
External Command File |
/var/nagios/rw/nagios.cmd |
|
Agressive Host Checks |
Yes |
|
Predictive Host Dependency Checks |
Yes |
|
Orphaned Service Check Option |
|
|
Soft Service Dependencies Option |
No |
|
Predictive Service Dependency Checks |
Yes |
|
Global Host Event Handler |
none |
|
Global Service Event Handler |
none |
|
Service Freshness Check Option |
Yes |
|
Service Freshness Check Interval |
60 |
|
Host Freshness Check Option |
Yes |
|
Host Freshness Check Interval |
60 |
|
Additional freshness latency |
15 |
|
Flap Detection Option |
no |
|
Obsess Over Services Option |
No |
|
Obsess Over Hosts Option |
no |
|
Cached Host Check |
15 |
|
Cached Service Check |
15 |
|
Notification Option |
Yes |
|
Service Check Execution Option |
Yes |
|
Passive Service Check Acceptance Option |
Yes |
|
Event Handler Option |
Yes |
|
Host Check Execution Option |
Yes |
|
Passive Host Check Acceptance Option |
Yes |
|
Syslog Logging Option |
No |
|
Notification Logging Option |
Yes |
|
Service Check Retry Logging Option |
Yes |
|
Host Retry Logging Option |
Yes |
|
Event Handler Logging Option |
Yes |
|
Initial State Logging Option |
no |
|
External Command Logging Option |
Yes |
|
Passive Check Logging Option |
Yes |
|
Log Archive Path |
/var/log/nagios/archives/ |
|
State Retention Option |
Yes |
|
State Retention File |
/var/nagios/retention.dat |
|
Automatic State Retention Update Interval |
Yes |
|
Use Retained Program State Option |
Yes |
|
Use Retained Scheduling Info Option |
Yes |
|
Broker Module |
/usr/lib/nagios/bin/ndomod.o config_file=/etc/nagios/ndomod.cfg |
|
Broker Module Options |
-1 |
|
Performance Data Processing Option |
Yes |
|
Host Performance Data File |
/var/nagios/host-perfdata |
|
Service Performance Data File |
/var/nagios/service-perfdata |
|
Host Performance Data File Mode |
a |
|
Service Performance Data File Mode |
a |
|
Host Performance Data File Processing Interval |
0 |
|
Service Performance Data File Processing Interval |
0 |
|
Timing Interval Length |
5 |
|
Host Inter-Check Delay Method |
s |
|
Maximum Host Check Spread |
30 |
|
Inter-Check Sleep Time |
1 |
|
Service Inter-Check Delay Method |
s |
|
Maximum Service Check Spread |
5 |
|
Service Interleave Factor |
s |
|
Maximum Concurrent Service Checks |
200 |
|
Service Repear Frequency |
5 |
|
Auto-Rescheduling Option |
Yes |
|
Auto-Rescheduling Interval |
30 |
|
Auto-Rescheduling Window |
180 |
|
Use large installation tweaks |
No |
|
Free child process memory |
No |
|
Child processes fork twice |
No |
|
Enable environment macros |
Yes |
|
Date Format |
us |
|
Regular Expression Matching Option |
No |
|
True Regular Expression Matching Option |
no |
|
Enable embedded Perl |
default |
|
Use embedded Perl implicitly |
default |
|
Debug file (Directory + File) |
/var/log/nagios/nagios.debug |
|
Debug file Maximum Size |
100000000 |
C、配置cgi.cfg


D、应用更改

注意:以后每次修改配置文件,或添加新的Host、Service等,都需要执行上述步骤才能生效!!
E、最后
# vi /etc/centreon/instCentStorage.conf
RRD_PERL=/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/RRDs.pm
# vi /etc/centreon/instCentWeb.conf
RRD_PERL=/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/RRDs.pm
# vi /etc/centreon/instCentPlugins.conf
RRD_PERL=/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/RRDs.pm
至此,Nagios+Centreon配置完成!
