LWP ::协议:: https ::套接字:连接:超时错误 [英] LWP::Protocol::https::Socket: connect: timeout error

查看:367
本文介绍了LWP ::协议:: https ::套接字:连接:超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置 aws cloudwatch 脚本以监视内存等。在执行该脚本时,我们遇到以下错误,并升级了 perl 软件包的LWP版本也是最新的6,但是脚本仍然失败,并出现以下错误。

I am trying to configure aws cloudwatch script for monitoring memory etc. While executing the script we get below error and I upgraded the perl package the LWP version is also latest as 6 but still script is failing with below error.

我尝试将环境变量设置为 PERL_LWP_ENV_PROXY = 1 PERL_LWP_SSL_VERIFY_HOSTNAME = 0 仍然失败。

I tried setting env variables as PERL_LWP_ENV_PROXY=1 and PERL_LWP_SSL_VERIFY_HOSTNAME=0 but still failing. Please help on this.


[ec2-user @ ip-10-175-82-195 aws-scripts-mon] $ sudo
./mon-put-instance-data.pl --mem-util --mem-used --mem-avail
--aws-credential-file =。/ awscreds.template

[ec2-user@ip-10-175-82-195 aws-scripts-mon]$ sudo ./mon-put-instance-data.pl --mem-util --mem-used --mem-avail --aws-credential-file=./awscreds.template

错误:无法调用CloudWatch:HTTP500。消息:无法连接至
monitoring.ap-southeast-1.amazonaws.com:443(超时)

ERROR: Failed to call CloudWatch: HTTP 500. Message: Can't connect to monitoring.ap-southeast-1.amazonaws.com:443 (timeout)

LWP :: Protocol :: https :: Socket:connect:
的超时时间/usr/local/share/perl5/LWP/Protocol/http.pm第47行

LWP::Protocol::https::Socket: connect: timeout at /usr/local/share/perl5/LWP/Protocol/http.pm line 47.

有关更多信息,请运行'mon-put-instance-data.pl --help'

For more information, run 'mon-put-instance-data.pl --help'


推荐答案


PERL_LWP_ENV_PROXY = 1

我想这也意味着您已将 http_proxy 环境变量设置为应该使用的代理,并且

I guess this also means that you have the http_proxy environment variable set to a proxy it should use and that there is no way to the target except by using this proxy.


$ sudo ./mon-put-instance- data.pl

使用sudo调用某些东西将以不同的权限运行它。出于安全原因,在调用程序之前,sudo会严重擦除环境变量,这可能意味着sudo运行的程序 http_proxy 为空。这再次意味着它将尝试直接访问目标站点而不是使用代理,并且由于只能使用代理访问该站点,因此连接超时。

Calling something using sudo will run it with different privileges. For security reasons the environment variables are heavily scrubbed before by sudo before calling the program which probably means that http_proxy is empty for the program run by sudo. This again means that it will try to reach the target site directly instead of using a proxy and will timeout on connection since the site can only be reached using the proxy.

这篇关于LWP ::协议:: https ::套接字:连接:超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆