【问题标题】:JnrpeClient : java.net.SocketException: Software caused connection abort: recv failedJnrpeClient:java.net.SocketException:软件导致连接中止:recv 失败
【发布时间】:2019-07-28 00:15:31
【问题描述】:

nrpe 代理工作得很好,但是在执行上面的代码时,我仍然收到这个错误:java.net.SocketException:软件导致连接中止:recv 失败

 try {
        JNRPEClient client = new JNRPEClient("192.168.121.129", 5666, false);
        client.setTimeout(30);
        ReturnValue ret = client.sendCommand("check_ping -H 192.168.121.129 -t 60 -w 3000.0,80% -c 5000.0,100% -p 5");
        System.out.println(ret.getMessage());
        System.exit(ret.getStatus().intValue());
    } catch (JNRPEClientException exc) {
        System.out.println(exc.getCause());
        System.out.println(exc.getMessage());

    }

【问题讨论】:

    标签: java sockets socket.io nrpe jnrpe


    【解决方案1】:

    将构造函数参数更改为 true 以启用 SSL,这应该可以解决 你的问题。

    JNRPEClient client = new JNRPEClient("192.168.121.129", 5666, true);
    

    【讨论】:

    • 感谢您的回复。那么,您是否在 nrpe 主机客户端上配置了 ssl?
    • 我没有在 nrpe 上配置 SSL。
    • 请将您的 IP 地址添加到 nrpe.cfg 中的 allowed_hosts 中
    • 它适用于开发版本。但是,他们仍然没有发布它。你可以在本地构建,可以试试。
    • 你能给我发个教程或一些提示吗
    猜你喜欢
    • 2012-04-15
    • 2010-09-13
    • 2012-02-20
    • 1970-01-01
    • 2017-04-20
    • 1970-01-01
    • 2011-02-03
    • 2016-07-09
    • 2011-10-09
    相关资源
    最近更新 更多