0

我正在开发一个项目,该项目让我的计算机与 arduino 板通信,该板读取传感器输出并在nagios的 C 插件(写入后从串行端口读取)中对其进行测试。我的问题是状态信息始终为空。我的插件在 lib"/usr/local/nagios/libexec" 在 commands.cfg 我添加了以下内容:

define command{
    command_name    arduino_temp_sensor
    command_line    /usr/local/nagios/libexec/essai.c
    }

在 localhost.cfg 我添加了以下内容:

define service{
        use                             generic-service         
        host_name                       localhost
        service_description             Temp
        check_command                   arduino_temp_sensor
        }

我很困惑 printf 的输出是否应该出现在状态信息中。提前致谢。

4

1 回答 1

1

它在我删除 .c 时起作用,如下所示:

define command{
     command_name    arduino_temp_sensor
     command_line    /usr/local/nagios/libexec/essai
     }
于 2013-07-22T07:00:46.903 回答