{"id":160,"date":"2010-02-05T17:12:25","date_gmt":"2010-02-05T22:12:25","guid":{"rendered":"http:\/\/somethingdoug.com\/thoughts\/?p=160"},"modified":"2010-02-07T21:53:19","modified_gmt":"2010-02-08T02:53:19","slug":"nagios-plugin-overhttp-planned-additions","status":"publish","type":"post","link":"https:\/\/somethingdoug.com\/thoughts\/2010\/02\/05\/nagios-plugin-overhttp-planned-additions\/","title":{"rendered":"Nagios::Plugin::OverHTTP Planned Additions"},"content":{"rendered":"<p>I usually get e-mails about my <a href=\"http:\/\/search.cpan.org\/dist\/Nagios-Plugin-OverHTTP\/\">Nagios::Plugin::OverHTTP<\/a> asking about little things being added here and there. The last e-mail I got was from Peter van Eijk asking for support for performance data. I looked over the code and realized that it really needs some refactoring before I can easily add support for performance data, and so I am currently hung up on that before the feature will get added.<\/p>\n<p>My current thoughts on support for getting performance data from the remote page would be to just scrape it from the standard plugin output, which is supported as the body:<\/p>\n<pre>PLUGIN OK - Good to go! | time=0.012s;1;10;10;0<\/pre>\n<p>I was also thinking about how to add support for receiving as headers, since the other supported aspects of the plugin may be transmitted as headers. My current thoughts are for a header named <code>X-Nagios-Performance<\/code> which would hold the <code>name=value<\/code> pair, separated by spaces like the normal plugin and would also allow more than one header with the data to be present:<\/p>\n<pre>X-Nagios-Performance: time=0.012s;1;10;10;0\r\nX-Nagios-Performance: count=2;;;50;0 other=4;;;4;0<\/pre>\n<p>For Nagios::Plugin::OverHTTP itself, since the remote plugin can provide critical and warning thresholds, I was thinking of allowing for actually changing the status based on that to be made optional by default (because if the remote plugin said the status was OK but yet a performance metric it sent said that it should really be in a WARNING state, by default Nagios would have kept that as OK so I believe that my plugin should honor that as well by default). New options for the plugin would be:<\/p>\n<pre>--warning name=threshold\r\n--critical name=threshold\r\n--use-transmitted-thresholds\r\n--override-transmitted-thresholds<\/pre>\n<p>The last option <code>--override-transmitted-thresholds<\/code> would cause the performance data written as the plugin&#8217;s output to be changed to match the thresholds given as the plugin&#8217;s options. This means a plugin with the given options <code>--override-transmitted-thresholds --critical time=4<\/code> would cause the performance data to say <code>time=0.012s;1;4;10;0<\/code> instead of <code>time=0.012s;1;10;10;0<\/code> (note that this setting does not affect the decision of the final status code).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I usually get e-mails about my Nagios::Plugin::OverHTTP asking about little things being added here and there. The last e-mail I got was from Peter van Eijk asking for support for performance data. I looked over the code and realized that it really needs some refactoring before I can easily add support for performance data, and [&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,21,19],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-perl","tag-cpan","tag-nagios","tag-perl5"],"_links":{"self":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/160","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=160"}],"version-history":[{"count":5,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/posts\/160\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingdoug.com\/thoughts\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}