Where is installed Nagios ?
default to [/usr/local/nagios]
> /usr/share/nagios3/
Path /usr/share/nagios3/ OK
Where is your nagios config directory
default to [/usr/local/nagios/etc]
> /etc/nagios3
Path /etc/nagios3 OK
Where is your Nagios var directory ?
default to [/usr/local/nagios/var]
> /var/log/nagios3/
Path /var/log/nagios3/ OK
Where is your Nagios plugins (libexec) directory ?
default to [/usr/local/nagios/libexec]
> /usr/lib64/nagios/plugins
Path /usr/lib64/nagios/plugins OK
/usr/sbin/nagios3 OK
Where is your Nagios image directory ?
default to [/usr/local/nagios/share/images/logos]
> /usr/share/nagios3/htdocs/images/logos/
Path /usr/share/nagios3/htdocs/images/logos/ OK
Where is your NDO ndomod binary ?
default to [/usr/sbin/ndomod.o]
> /usr/lib/ndoutils/ndomod-mysql-3x.o
/usr/lib/ndoutils/ndomod-mysql-3x.o OK
4.4 Web 安装centreon完成后
### 参考链接:http://www.xodino.it/?page_id=968
Finalize Centreon configuration:
Open in webrowser: "http://<yourserverip>/centreon/", replace "<yourserverip>" with your Centreon server ip address or hostname.
Go to: Configuration -> Nagios -> cgi (in sidebar), Press on "CGI.cfg" link
Change settings to some options, as writed below:
- Physical HTML Path: /usr/share/nagios3/htdocs
- URL HTML Path : /nagios3
- Nagios Process Check Command: /usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'
Press Save
Go to: Configuration -> Nagios -> nagios.cfg (in sidebar), Press on "Nagios CFG 1" link, you should be in "Files" section of the configuration screen.
Make sure to set folowing configuration values:
- Log File : /var/log/nagios3/nagios.log
- Downtime File : /var/lib/nagios3/downtime.dat
- Comment File : /var/lib/nagios3/comment.dat
- Temp File : /var/cache/nagios3/nagios.tmp
- P1 File : /usr/lib/nagios3/p1.pl
- Lock File : /var/run/nagios3/nagios3.pid
- Object Cache File : /var/cache/nagios3/objects.cache
- Status File : /var/cache/nagios3/status.dat
- External Command File : /var/lib/nagios3/rw/nagios.cmd
Now Press on "Logs Options" tab to go to "Logs Options" section.
Make sure to set folowing configuration values:
- Log Archive Path : /var/log/nagios3/archives/
- State Retention File : /var/lib/nagios3/retention.dat
Press Save
Go to: Administration -> Options -> CentStorage (in sidebar)
Make sure to set folowing configuration values:
- Nagios current log file to parse: /var/log/nagios3/nagios.log
Press Save
Now let's apply our changes, go to: Configuration -> Nagios
Select as below:
- Generate Configuration Files
- Include Comments
- Run Nagios debug (-v)
- Move Export Files
- Restart Nagios
- Method: "External Command"
Press Export
This will restart Nagios & apply all changes you made in Web Interface.
You will do it every time you make changes, e.g. adding/modifying of hosts, commands, contacts, services...etc...
The installation of Centreon is completed.
Final fixes (very important):
Go to terminal console, then...
In Debian/Ubuntu the user "nagios" is set to "/bin/false" shell. Because of it "centcore" and "centstorage" daemons won't start. A reason for that is because those daemons use "su -c" command which requires a real shell, so the shell for
"nagios" user must be set to "/bin/sh":
# usermod -s /bin/sh nagios
Apply permissions for Web interface to be able to send "External Commands", perform the following commands to change directory permissions and to make the changes permanent:
# invoke-rc.d nagios3 stop
# dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
# dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
Add htaccess user with password "P@ssw0rd" for nagios CGI:
# htpasswd -bc /etc/nagios3/htpasswd.users nagiosadmin P@ssw0rd