码迷,mamicode.com
首页 > 移动开发 > 详细

Nagios详解

时间:2015-04-20 18:25:56      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

1.nagios主配置文件:

[root@localhost etc]# ll                         //安装目录下的/nagios/etc/
total 88
-rw-rw-r-- 1 nagios nagios 12031 Oct 1 2013 cgi.cfg
-rw-r--r-- 1 nagios nagios 21 Jan 15 2013 htpasswd.users
-rw-rw-r-- 1 nagios nagios 44982 Apr 20 15:23 nagios.cfg        //主配置文件
drwxrwxr-x 3 nagios nagios 4096 Apr 20 15:46 objects          //对象
-rw-rw---- 1 nagios nagios 1342 Mar 20 2014 resource.cfg

[root@localhost etc]# vi nagios.cfg

log_file=/usr/local/nagios/var/nagios.log               //定义日志文件的目录

cfg_file=/usr/local/nagios/etc/objects/commands.cfg        //cfg_file定义要监控的文件

cfg_file=/usr/local/nagios/etc/objects/host.cfg

cfg_file=/usr/local/nagios/etc/objects/contacts.cfg

cfg_file=/usr/local/nagios/etc/objects/templates.cfg

cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg

#cfg_dir=/usr/local/nagios/etc/servers               //cfg_dir可定义整个目录下的配置文件

resource_file=/usr/local/nagios/etc/resource.cfg            //全局的一个变量(洪)文件

status_file=/usr/local/nagios/var/status.dat            //保留所有检测结果的状态信息,数据文件

status_update_interval=10                    //数据跟新时间,单位:秒

command_check_interval=-1                   //命令多长时间检测,-1尽可能多的去检测,不定义时间间隔

command_file=/usr/local/nagios/var/rw/nagios.cmd         //定义command的执行权限和执行身份

[root@localhost etc]# vi resource.cfg                 //总共支持32个变量($USER1$ through $USER32$)

$USER1$=/usr/local/nagios//libexec                 //插件所在的目录/usr/local/nagios/libexec

2.objects配置文件

[root@localhost objects]# vi commands.cfg

define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 300.0,80% -c 500.0,100% -p 5
}

 

Nagios详解

标签:

原文地址:http://www.cnblogs.com/linux-chenyang/p/4442255.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!