分类: BSD
2008-11-04 09:56:30
yum install gcc
yum install glibc glibc-commonyum install gd gd-devel验证Nagios的样例配置
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
================================如果没有报错,可以启动Nagios服务
service nagios start
=========================================
3。编辑apache 的httpd.conf
最后面添加:
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-userAlias /nagios "/usr/local/nagios/share"
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
=========================================
4。在验证下
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
没有出错的话!重新启动nagios和apache
========================
5。关于selinux,如果selinux是关闭状态,可以忽略这部!
如果selinux开启!那么如果是SELinux处于强制模式时需要做
getenforce
令SELinux处于容许模式
setenforce 0
如果要永久性更变它,需要更改/etc/selinux/config里的设置并重启系统。
不关闭SELinux或是永久性变更它的方法是让CGI模块在SELinux下指定强制目标模式:
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/ chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
6。登陆web接口!
s
输入你刚才设置的用户名密码!ok了!看到界面了吧
ps:如果遇到问题!!!!
如果遇到关于cgi什么权限问题!察看下/usr/local/nagios的属主组权限,
包括里面的内容,
尤其是/usr/local/nagios/etc/htpasswd.users这个文件的权限!都应该是nagios:nagios
另外尝试编辑
vi /usr/local/nagios/etc/cgi.cfg
把
use_authentication=1
修改为
use_authentication=0
如果出现页面无法显示之类的,去访问bbs.itnms.net里面的http://www.itnms.net/discuz/forumdisplay.php?fid=10&pageD4
有关于基本的错误的解决方法!