This queue is for tickets about the Nagios-Plugin-WWW-Mechanize CPAN distribution.

Report information
The Basics
Id:
57641
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
jlmartinez [...] capside.com
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
(no value)
Fixed in:
(no value)



Subject: Announce as nagios-plugin
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1012
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2601-1319747008-612.57641-0-0@rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 462
On Wed May 19 14:18:40 2010, JLMARTIN wrote:
Show quoted text
> my $ua = lc($np->shorname) . '/' . $np->version . " > (nagios-plugin-www-mechanize ${Nagios::Plugin::WWW::Mechanize::VERSION})"
You know, reading the docs, it mentions if $opts{mech} is specified and is an object. By declaring your own WWW::Mechanize object, you can specify your own UserAgent: my $mech = WWW::Mechanize->new( agent => 'wonderbot 1.01' ); Nagios::Plugin::WWW::Mechanize->new( mech => \$mech )


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.