<feed xmlns='http://www.w3.org/2005/Atom'>
<title>monitoring-plugin-perl/lib/Monitoring, branch master</title>
<subtitle>Monitoring::Plugin
</subtitle>
<id>https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/atom?h=master</id>
<link rel='self' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/'/>
<updated>2020-09-14T08:52:29Z</updated>
<entry>
<title>Handling if only the warning or critical is set</title>
<updated>2020-09-14T08:52:29Z</updated>
<author>
<name>A Codeweavers Infrastructure Bod</name>
<email>36475663+infraweavers@users.noreply.github.com</email>
</author>
<published>2020-09-14T08:52:29Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=1b5dbf6c09952a69843e08bd8943506e98bcfe1a'/>
<id>urn:sha1:1b5dbf6c09952a69843e08bd8943506e98bcfe1a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>We think it is better to always have a threshold object implicitly created when warning and critical is passed in, so that order of execution between $mp-&gt;check_threshold and $mp-&gt;add_perfdata doesn't matter</title>
<updated>2020-09-09T12:21:25Z</updated>
<author>
<name>A Codeweavers Infrastructure Bod</name>
<email>36475663+infraweavers@users.noreply.github.com</email>
</author>
<published>2020-09-09T09:59:13Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=0b62478ad269cc6042dfc411619cfe0f6c9517aa'/>
<id>urn:sha1:0b62478ad269cc6042dfc411619cfe0f6c9517aa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>release 0.40</title>
<updated>2018-07-25T20:16:18Z</updated>
<author>
<name>Sven Nierlein</name>
<email>sven@nierlein.de</email>
</author>
<published>2018-07-25T20:16:18Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=f11af14b6d68fd752cf74cd1ebb397688abbed7e'/>
<id>urn:sha1:f11af14b6d68fd752cf74cd1ebb397688abbed7e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fail with config -&gt;errstr() when undef read</title>
<updated>2018-05-24T01:01:21Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2018-05-24T01:01:21Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=301a3564e6b7cf716b75440c5333e688ea814873'/>
<id>urn:sha1:301a3564e6b7cf716b75440c5333e688ea814873</id>
<content type='text'>
The Config::Tiny parent class for Monitoring::Plugin::Config does not
necessarily raise an exception in $@/$EVAL_ERROR on a failed call to its
-&gt;read() method. Indeed, it does not in most cases, at least in the most
recent Config::Tiny.

If a file does not exist or for whatever other reason cannot actually be
read--such as permissions problems--Monitoring::Plugin ends up reporting
a "Missing config section" to the caller, which is misleading.

This information is available from the -&gt;errstr() method of the base
class, however, and an inspection of the code for the -&gt;read() method in
the parent class suggests the correct approach is to look for a return
of `undef` from the -&gt;read() method, and use the return value of
-&gt;errstr() as the reported error for -&gt;_die(). This commit adds such a
check.

To reproduce, given the following plugin `mptest`:

    use strict;
    use warnings;
    use Monitoring::Plugin qw(%ERRORS);
    my $mp = Monitoring::Plugin-&gt;new(
    	usage =&gt; '',
    );
    $mp-&gt;getopts;
    $mp-&gt;plugin_exit($ERRORS{OK}, 'Done!');

Running it without options of course works, like so:

    $ perl mptest
    MPTEST OK - Done!

However, prior to this patch, if we specify --extra-opts with a
nonexistent filename, we get a misleading error:

    $ perl mptest --extra-opts=@/nonexistent
    Invalid section 'mptest' in config file '/nonexistent'

With this patch included, the error is more accurate and helpful:

    $ perl mptest --extra-opts=@/nonexistent
    Failed to open file '/nonexistent' for reading: No such file or directory
</content>
</entry>
<entry>
<title>Remove "experimental" tag on "Message Methods"</title>
<updated>2018-03-04T20:59:29Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2018-03-04T20:56:22Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=77de65e149c519f551e03e11c9c26605c9866b72'/>
<id>urn:sha1:77de65e149c519f551e03e11c9c26605c9866b72</id>
<content type='text'>
From a maintainer, Sven Nierlein:
&gt; I'd say we can remove the "experimental" tag there. It had been there
&gt; for years now and i see no reason why we would change them.

Partly resolves #14.
</content>
</entry>
<entry>
<title>Remove "scalar" call entirely</title>
<updated>2017-12-16T01:09:16Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2017-12-16T01:09:16Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=da6fe80e84a20aaf405a89bd0203d9ce1abc097d'/>
<id>urn:sha1:da6fe80e84a20aaf405a89bd0203d9ce1abc097d</id>
<content type='text'>
Context with the lhs of the == operator forces this into scalar context
anyway, making this call redundant.
</content>
</entry>
<entry>
<title>Pass params validation by ref not copy</title>
<updated>2017-12-16T00:34:38Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2017-12-16T00:34:38Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=6518f384cc20561ddc0df32414a714164dd2eb95'/>
<id>urn:sha1:6518f384cc20561ddc0df32414a714164dd2eb95</id>
<content type='text'>
Since Params::Validate::validate() doesn't seem to actually mess with
this specification, may as well pass a reference rather than bother
copying the whole thing.
</content>
</entry>
<entry>
<title>Remove unneeded params around "scalar" call</title>
<updated>2017-12-16T00:30:52Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2017-12-16T00:30:52Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=afa636bc749f76aed77380d39269bceecdd879d2'/>
<id>urn:sha1:afa636bc749f76aed77380d39269bceecdd879d2</id>
<content type='text'>
Operator precedence allows leaving these out.
</content>
</entry>
<entry>
<title>Refactor positional arg parsing for Getopt::arg()</title>
<updated>2017-12-16T00:25:34Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2017-12-16T00:25:34Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=c3f2a7cd7313868166ba205e9eff2b8be6a36ea4'/>
<id>urn:sha1:c3f2a7cd7313868166ba205e9eff2b8be6a36ea4</id>
<content type='text'>
Define the expected order of parameters by key in an array, and then
apply hash slices to validate and assign the arguments including their
required flags in one swoop, again hinging on the parameter definitions
established in c1046ba.
</content>
</entry>
<entry>
<title>Change arg() param type detect to key exists check</title>
<updated>2017-12-16T00:08:44Z</updated>
<author>
<name>Tom Ryder</name>
<email>tom@sanctum.geek.nz</email>
</author>
<published>2017-12-16T00:08:44Z</published>
<link rel='alternate' type='text/html' href='https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=40d5fbea30c310004233ef4cd3e570c351c54233'/>
<id>urn:sha1:40d5fbea30c310004233ef4cd3e570c351c54233</id>
<content type='text'>
Use the parameter label definitions from commit c1046ba to simplify the
block of code that checks whether the first argument passed to arg() is
one of the known param keys, rather than using a regular expression with
alternating expression.

This is more compact, may be marginally faster, and will make adding new
parameters to this method more straightforward in future, avoiding the
situation corrected in commit 4aa2aee.
</content>
</entry>
</feed>
