{"id":71,"date":"2009-05-20T19:48:41","date_gmt":"2009-05-21T00:48:41","guid":{"rendered":"http:\/\/somethingdoug.com\/thoughts\/?p=71"},"modified":"2009-05-20T20:07:02","modified_gmt":"2009-05-21T01:07:02","slug":"nagiospluginoverhttp-gets-timeout","status":"publish","type":"post","link":"https:\/\/somethingdoug.com\/thoughts\/2009\/05\/20\/nagiospluginoverhttp-gets-timeout\/","title":{"rendered":"Nagios::Plugin::OverHTTP gets timeout"},"content":{"rendered":"<p>In versions of <a href=\"http:\/\/search.cpan.org\/dist\/Nagios-Plugin-OverHTTP\/\">Nagios::Plugin::OverHTTP<\/a> previous to 0.06 the only way to set a timeout on the plugin was to initiate your own LWP::UserAgent and set the timeout on it and pass that to Nagios::Plugin::OverHTTP like:<\/p>\n<pre lang=\"perl\" escaped=\"true\">use LWP::UserAgent;\r\nuse Nagios::Plugin::OverHTTP;\r\n\r\nmy $ua = LWP::UserAgent-&gt;new(timeout =&gt; 20);\r\nmy $plugin = Nagios::Plugin::OverHTTP-&gt;new(useragent =&gt; $ua);<\/pre>\n<p>So now you can skip the entire custom user agent step unless you actually want a custom user agent:<\/p>\n<pre lang=\"perl\" escaped=\"true\">use Nagios::Plugin::OverHTTP 0.06;\r\n\r\nmy $plugin = Nagios::Plugin::OverHTTP-&gt;new(timeout =&gt; 20);<\/pre>\n<p>In addition verson 0.07 changes the check_over_http script so that the timeout defaults to 10 seconds, which is reasonable with Nagios plugins.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In versions of Nagios::Plugin::OverHTTP previous to 0.06 the only way to set a timeout on the plugin was to initiate your own LWP::UserAgent and set the timeout on it and pass that to Nagios::Plugin::OverHTTP like: use LWP::UserAgent; use Nagios::Plugin::OverHTTP; my $ua = LWP::UserAgent-&gt;new(timeout =&gt; 20); my $plugin = Nagios::Plugin::OverHTTP-&gt;new(useragent =&gt; $ua); So now you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[12,27,19],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-perl","tag-cpan","tag-perl","tag-perl5"],"_links":{"self":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":12,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/71\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}