AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
Alias /nagios/ /usr/local/nagios/share/
DirectoryIndex index.html
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
4启动nagios服务器
service nagios start
查看nagios是否配置有问题,请使用
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
nagios服务器问题1
我当时遇到奇怪现象,可以看到首页,链接打不开,检查apache配置,文件权限,后来确认当有部分程序出现奇怪状态,比如权限问题得时候,请关闭SELINUX
解决方法:
vi /etc/sysconfig/selinux
SELINUX=enforcing --> SELINUX=disabled
存盘退出
nagios服务器问题2
监控页面出现
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
1、修改/etc/cgi.cfg
vi /usr/local/nagios/cgi.cfg
use_authentication=1 #把1修改为0,保存
root@nagios#/etc/init.d/nagios restart
nagios服务器问题3
Warning: Return code of 127 for check of service 'Uptime' on host 'winserver' was out of bounds. Make sure the plugin you're trying to run actually exists
通常都的plugin没有安装,或者安装位置有问题,我遇到是查看目录:/usr/local/nagios/libexec/libexec、后来将libexec文件往前挪一下就可以了:/usr/local/nagios/libexec.
5监控windows系统
下载NSClient++-Win32-0.3.5 文件,并安装在受监控的服务器上
下载NSClient++-Win32-0.3.5.msi并安装。
到安装目录打开NSC.ini文件进行修改:
在[modules]模块,将除CheckWMI.dll和RemoteConfiguration.dll外的所有dll文件明前的注释(;)去掉。
在[Settings]模块可以设置一个连接密码password=PWD,为了简单,在此不设密码。设置allowed_hosts=127.0.0.1/32,192.168.0.19,这里是LINUX监控服务器的地址,如果写成192.168.0.0/24则表示该子网内的所有机器都可以访问;如果这个地方是空白则表示所有的主机都可以连接上来(注意在[NSClient]有allowed_hosts的同样设置,不要设置错了),最后不要忘记去掉前面的注释符(;)。监视端口必须开启 :端口号默认:12489
运行nsclient++
NSClient++ /install
NSClient++ SysTray install
NSClient++ /start
如果有防火墙,请开放相应端口。可以通过netstat -an 查看端口12489是否开启,并是否处于监听状态。
创建监控配置文件,使用check_nt命令监控windows系统信息(此命令默认已定义)。