Nagios 一些小技巧

发布时间:2020-06-27 06:31:19 作者:煮酒品茶
来源:网络 阅读:541

序:本文没有太过的篇幅,但是掌握了这些技巧,可以使你配置起nagios的配置文件时会省时省力很多。

Nagios 一些小技巧

 
From:http://nagios.sourceforge.net/docs/nagioscore/3/en/objecttricks.html
 
1、如果你想创建相同的服务给多个主机,可以指定$host_name指令。
 
 define service {
        host_name        nagios-server,rsync-89 ;注意以逗号分开
        service_description   check-host-alive
        check_period          24x7
        max_check_attempts    3
        normal_check_interval 1
        retry_check_interval  1
        contact_groups        ktm
        notification_interval   10
        notification_period     24x7
        notification_options    w,u,c,r
        check_command           check-host-alive
        }
图Nagios1:
 

 Nagios 一些小技巧

 
2、同样多个Hostgroups
 defin service {
hostgroup_name hostgroup1,hostgroup2
...........
}
3、所有主机通配符*来代替。
 defin service {
host_name *
...........
}
 
4、全部但不要某些主机
 defin service {
host_name *,!host1,!host2
...........
}
:更多参考上面的链接。
 
5、对象继承
name定义,use引用。不需要定义的可以单独加进去。可双层定义。即host1组name host2,然后再继续引用。
更多更具体:http://nagios.sourceforge.net/docs/nagioscore/3/en/objecttricks.html
 define service {
        host_name               rsync-89
        service_description   check-host-alive
        check_period          24x7
        max_check_attempts    3
        normal_check_interval 1
        retry_check_interval  1
        contact_groups        ktm
        notification_interval   10
        notification_period     24x7
        notification_options    w,u,c,r
        check_command           check-host-alive
        name                    host1
        }
 
define service {
        host_name               nagios-server
        use                    host1
        }
推荐阅读:
  1. nagios 监控配置介绍(一)
  2. 烂泥:学习Nagios(一):Nagios安装

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

na

上一篇:在android项目中使用VLC

下一篇:React Native自学--嵌入到原生应用

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》