Skip to main content

Hi,

I am trying to monitor a website.

If I use that plugin plugin apps::protocols::http::plugin to check response then the option --cookies-file=/tmp/lwp_cookies.dat works nicely. But when I use the same --cookies-file=/tmp/lwp_cookies.dat with --mode=expected-content, then I get error:

Use of uninitialized value $old[0] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[1] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[2] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[3] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[4] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[5] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[6] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[7] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[8] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

Use of uninitialized value $old[9] in join or string at /usr/share/perl5/vendor_perl/HTTP/Headers.pm line 89.

OK: HTTP test(s) | 'size'=1939B;;;0; 'time'=0.076s;;;0;

My command is: /usr/lib/centreon/plugins//centreon_protocol_http.pl --plugin apps::protocols::http::plugin  --urlpath= --hostname=egggxxx.com --mode=expected-content --port=8443 --proto=https --expected-string='Remote' --cookies-file=/tmp/lwp_cookies.dat

Am I doing something wrong, or this is purely plugin issue?

Hi ​@katska,

First, given the final output message of the plugin (OK: HTTP test(s) | 'size'=1939B;;;0; 'time'=0.076s;;;0;), I suppose that despite the warnings, the plugin is able to reach the page and to find the expected content in it. In addition to that, these warning messages are sent to STDERR, so they should not appear in the monitoring info in Resource Status, so these messages should have no impact for you, you may safely ignore them.

 

Then, these warning messages are not produced by our plugin but by the LWP library, which is a Perl standard library. You may avoid using LWP by adding --http-backend=curl to the command and see if the behaviour differs.

 

Another option: what happens if you remove the --cookies-file=/tmp/lwp_cookies.dat option? Does it break the command?


Hi,

 

Thanks for the explanation!

  1. if I remove that --cookies-file option, I get error: UNKNOWN: 302 Found 
  2. But if I add that --http-backend=curl, then the command works nicely and does not show those Use of uninitialized value $old errors

So I will add that --http-backend=curl  to my command and then those errors will not “scare” me every time I see then and make me think something is wrong :)

Thanks for the help!