nagios服务端和客户端的正确配置文件

服务器端:

nagios检查自身或其他服务器或设备的一个配置:

[root@bogon objects]# pwd
/usr/local/nagios/etc/objects
[root@bogon objects]# cat linux.cfg
define host{
           use             linux-server
          host_name        124.172.223.141
          alias            124.172.223.141
          address        124.172.223.141
        }
define service{
        use                      generic-service
        host_name             124.172.223.141
        service_description     check-swap
        check_command        check_nrpe!check_swap
               }
define service{
        use                      generic-service
        host_name             124.172.223.141
        service_description     check-load
       check_command         check_nrpe!check_load
               }
define service{
        use                      generic-service
        host_name             124.172.223.141
       service_description     check-disk
       check_command        check_nrpe!check_df
                   }
define service{
        use                      generic-service
        host_name             124.172.223.141
       service_description     check-users
       check_command        check_nrpe!check_users
               }
define service{
        use                    generic-service
        host_name           124.172.223.141
        service_description  otal_procs
        check_command     check_nrpe!check_total_procs
}


nagios主配置文件:

cat /usr/local/nagios/etc/nagios.cfg

# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/usr/local/nagios/etc/objects/linux.cfg     (这是我自己加的)

# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg   (可以禁止这个)


cat commands.cfg



客户端:


command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 190 -c 230
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 30% -c 10%
command[check_ping]=/usr/local/nagios/libexec/check_ping -H 124.172.223.141 -w 3000.0,80% -c 5000.0,100% -p 5
command[check_df]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 




以上是一套配置文件。方便以后查看和核对




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值