【问题标题】:how can execute nagios commands from command line in linux如何在 linux 中从命令行执行 nagios 命令
【发布时间】:2013-07-09 08:13:22
【问题描述】:

我正在使用 nagios o centos 服务器,我只想监控本地主机。

我已经这样定义了我的服务

define service{
 host_name  localhost
 service_description Site1Service
 check_command  check_http-site1
 use   generic-service
 notification_interval 1440
}

commands.cfg 中这样的命令

define command{
 command_name check_http-site1
 command_line /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com
}

我在那里遇到严重错误。所以我想从命令行检查该服务是否正在运行

【问题讨论】:

    标签: linux centos nagios


    【解决方案1】:

    你实际上在你的配置中有答案 - 只需在 shell 中执行:

    /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com
    

    您可以添加 -v 以获得详细输出。

    Nagios 只是一个调度器,它以指定的时间间隔执行命令。然后根据响应报告状态。

    【讨论】:

    • 在我的 CentOS 6.5 服务器上,插件位于 /usr/lib64/nagios/plugins
    猜你喜欢
    • 2023-04-05
    • 1970-01-01
    • 2021-08-19
    • 2013-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-07
    相关资源
    最近更新 更多