- 论坛徽章:
- 2
|
本帖最后由 djzhangxing 于 2015-03-20 02:01 编辑
下面是一段nagios的配置文件,如果机器下线的现在需要手动找配置文件的IP再删除,但是多台的话会影响效率,我想写个脚本,读取IP列表自动删除。
假如说我想下掉10.200.94.65这个监控,我需要把红色标记的内容删除掉,membere的一个单ip可以sed替换null,下面define如何删除这块的内容呢,求助。
cat host.conf
define hostgroup{
hostgroup_name ops-shop
alias shop
members 10.200.94.65,10.200.94.110,10.100.58.173
}
###############################################################################
define host{
host_name 10.200.94.65
address 10.200.94.65
check_command check-host-alive
max_check_attempts 4
check_period 24x7
contact_groups shop-ops,shop-ops-email
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
define host{
host_name 10.200.94.110
address 10.200.94.110
check_command check-host-alive
max_check_attempts 4
check_period 24x7
contact_groups shop-ops,shop-ops-email
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
define host{
host_name 10.200.94.173
address 10.200.94.173
check_command check-host-alive
max_check_attempts 4
check_period 24x7
contact_groups shop-ops,shop-ops-email
notification_interval 10
notification_period 24x7
notification_options d,u,r
|
|