gpt4 book ai didi

ssh - 基础/Nagios 的 check_by_ssh 返回 "Remote command execution failed"

转载 作者:行者123 更新时间:2023-12-02 13:46:36 25 4
gpt4 key购买 nike

我正在使用 Groundwork/Nagios,并且正在尝试设置 check_by_ssh。现在,命令是:

$USER1$/check_by_ssh -i ~nagios/.ssh/id_dsa -H $HOSTADDRESS$ -t 60 -l "$USER24$" -C "/tmp/test"



其中/tmp/test 是一个 Hello World 程序。

但它正在返回消息 "Remote command execution failed:********************************************"
我为 nagios 设置了 ssh key 以登录 $HOSTADDRESS$$USER24$ ,但我仍然收到错误消息。 (私钥在基础盒上的 ~nagios/.ssh 中,公钥在远程主机上的 ~/$USER24$/.ssh 中)

所以基本上, check_by_ssh 无法运行任何程序。

最佳答案

出于某种原因,添加“-E”标志修复了它。根据check_by_ssh man page ,这是忽略 STDERR 标志。现在我从/tmp/test 得到输出。

最终命令:

$USER1$/check_by_ssh -i ~nagios/.ssh/id_dsa -H $HOSTADDRESS$

-t 60 -l "$USER24$" -C "/tmp/test" -E



最终输出:

Hello World

关于ssh - 基础/Nagios 的 check_by_ssh 返回 "Remote command execution failed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6431929/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com