快速业务通道

nagios监控系统搭建!!

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-15
tall-daemon
make install-daemon-config
vi /usr/local/nagios/etc/nrpe.conf
allowed_hosts=192.168.8.150
#为了监控swap在nrpe.cfg中添加
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/sda1
#sdb1可根椐实际情况更改,我这里的硬盘类型是scsi vi /etc/services
#增加nrpe
nrpe 5666/tcp # nrpe
#启动nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d netstat -at|grep nrpe
netstat -an|grep 5666 #############################################################################
#再对监控服务器进行设置
#添加nrpe的定义
vi /usr/local/nagios/etc/objects/commands.cfg
# ''check_nrpe '' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
} vi /usr/local/nagios/etc/cgi.cfg
把use_authentication=1修改为use_authentication=0如果出现页面无法显示之类的
authorized_for_system_commands=nagiosadmin,kerry --kerry为http访问授权用户
authorized_for_all_services=nagiosadmin,kerry
authorized_for_all_hosts=nagiosadmin,kerry
authorized_for_all_service_commands=nagiosadmin,kerry
authorized_for_all_host_commands=nagiosadmin,kerry #测试NRPE是否则正常工作
/usr/local/nagios/libexec/check_nrpe -H localhost killall nagios
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d" >> /etc/rc.local
ehco "/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg" >>/etc/rc.local #问题:notifications for this service have been disabled
#解决办法:enable notifications for this service #问题:Status Map页面无法显示
#解决方法:ln -s /usr/local/lib/libgd.so.2 /usr/lib/libgd.so.2 vi /usr/local/nagios/etc/nagios.cfg
#添加
cfg_file=/usr/local/nagios/etc/objects/emos-mailserver.cfg
#emos-mailserver.cfg这个文件名可以自定义 #对刚定义的emos-mailserver.cfg文件进行配置
vi /usr/local/nagios/etc/objects/emos-mailserver.cfg
define host{
use linux-server
host_name emos-mailserver
alias emos-mailserver
address 192.168.8.151
}
define service{
use generic-service
host_name emos-mailserver
service_description HTTP
check_command check_http
}
define service{
use generic-service
host_name emos-mailserver
service_description SSH
check_command check_ssh
} define service{
use generic-service
host_name emos-mailserver
service_description SMTP
check_command check_smtp
} define service{
use generic-service
host_name emos-mailserver
service_description POP3
check_command check_pop
}
#define service{
# use generic-service
# host_name emos-mailserver
# service_description mysql
#

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号