Subject: | Announce as nagios-plugin |
Hi,
Plugins that use Nagios::Plugin::WWW::Mechanize announce their user
agent as "WWW-Mechanize/X.XX". It would be nice that
Nagios::Plugin::WWW::Mechanize would set the user agent to something
related to the plugin, instead, like:
"plugin-name/X.XX (nagios-plugin-www-mechanize x.xx)" where:
plugin-name is the shortname of the plugin
X.XX is the version that it reports via plugin -V
x.xx is the version of Nagios::Plugin::WWW::Mechanize
For the moment I'm doing something like this after calling ->getopts
my $ua = $np->opts->_revision . " (nagios-plugin-www-mechanize
${Nagios::Plugin::WWW::Mechanize::VERSION})";
$np->mech->agent($ua);
I'm breaking encapsulation because I didn't find a way to get the
version of the plugin. I wanted it to be something like:
my $ua = lc($np->shorname) . '/' . $np->version . "
(nagios-plugin-www-mechanize ${Nagios::Plugin::WWW::Mechanize::VERSION})"
It would be nice if Nagios::Plugin::WWW::Mechanize would handle it for
"free" ;)
Cheers,
Jose Luis Martinez