sclient++
NSClient /install
NSClient SysTray install
NSClient /start
如果有防火墙,请开放相应端口.可以通过netstat -an 查看端口12489是否开启,并是否处于监听状态.
创建监控配置文件,使用check_nt命令监控windows系统信息(此命令默认已定义).
6在/usr/local/nagios目录下
先进入 etc目录下 修改nagios.cfg ,开启windows.cfg服务(取消其前面的;)
然后在etc/objects目录下 修改windows.cfg文件,在内部新建主机命,定义各种服务.
配置结束后,依然可以通过/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
查看配置是否出错,如果没有问题 ,重起nagios服务,然后查看http://ipaddress/nagios/
"check_nrpe_bandwidth" = "$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_bandwidth";
7nagios的权限配置
先建立htpasswd.users文件,直接用下面的命令
htpasswd -c /usr/local/nagios/etc/htpasswd.users username password
htpasswd -c /usr/local/nagios/etc/htpasswd.users root
redhat
redhat
OK
在/etc/httpd/conf/httpd.conf一段直接改成下面
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory "/usr/local/nagios/sbin/">
# AllowOverride AuthConfig
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios/ /usr/local/nagios/share/
<Directory "/usr/local/nagios/share/">
DirectoryIndex index.html
Options None
# AllowOverride AuthConfig
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
配置nagios的时候需要加入httpd.conf面两条命令
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory "/usr/local/nagios/sbin/">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /nagios/ /usr/local/nagios/share/
<Directory "/usr/local/nagios/share/">
DirectoryIndex index.html
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
Alias /nagios/ /usr/local/nagios/share/ /这个符号如果有,则保证前后多有,否则会出现问题.
pwd 查看目前文件的路径
echo$ 查看当前的值是什么
[root@bogon libexec]# echo $LANG 查看语言
zh_CN.UTF-8 使用的是中文
[root@bogon libexec]# LANG=en_US 更改为英文
cd /usr/local/nagios/libexec/libexec 进到目录里面
mv * .. 把当前所有文件移动到父目录
cd .. 回到上个目录
rmdir libexec 删除空的目录libexec
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
上面那条命令作用:检查nagios 的错误在那里????
本文出自 “wxfxn2000” 博客,谢绝转载!
|