ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Nagios 添加别名

Nagios 添加别名

原创 Linux操作系统 作者:tomshenhao 时间:2011-09-22 16:48:41 0 删除 编辑
1. 针对check_mk监控的服务器:
修改文件:/etc/check_mk/main.mk
添加方法:
extra_host_conf["alias"] = [
  ( ""] )
]
 
例如:
extra_host_conf["alias"] = [
( "abc", ["11.11.0.103"])
]
 
如果添加的别名中含有中文,需要在文件开头申明:
#!/usr/bin/python
# -*- coding: utf-8 -*-
 
例如:
extra_host_conf["alias"] = [
( "地铁一号线/高桥站/设备机房/数据库服务器", ["11.11.0.103"])
]
 
2. 添加监控机自己的别名:
修改文件:/usr/local/nagios/etc/objects/localhost.cfg
修改内容:
 
原内容:
define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               localhost
        alias                           localhost
        address                 127.0.0.1
        }
 
修改后:
define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               localhost
        alias                   monitor
        address                 127.0.0.1
        }
 
 
 
 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24751738/viewspace-708111/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Linux ssh连接
下一篇: SHELL 文件处理
请登录后发表评论 登录
全部评论

注册时间:2011-07-14

  • 博文量
    260
  • 访问量
    431307