diff --git a/apps/github/mode/stats.pm b/apps/github/mode/stats.pm index 12a8fc354..957a06a14 100644 --- a/apps/github/mode/stats.pm +++ b/apps/github/mode/stats.pm @@ -26,6 +26,7 @@ use strict; use warnings; use centreon::plugins::http; use JSON; +use Data::Dumper; sub new { my ($class, %options) = @_; @@ -79,8 +80,7 @@ sub run { }; if ($@) { - use Data::Dumper; - $self->{output}->add_option_msg(short_msg => "Cannot decode json response"); + $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->output_add(long_msg => Data::Dumper::Dumper(), debug => 1); $self->{output}->option_exit(); } @@ -93,11 +93,14 @@ sub run { short_msg => sprintf("%d forks - %d watchers - %d stars", $forks, $watchers, $stars)); $self->{output}->perfdata_add(label => 'forks', - value => $forks); + value => $forks, + min => 0); $self->{output}->perfdata_add(label => 'watchers', - value => $watchers); + value => $watchers, + min => 0); $self->{output}->perfdata_add(label => 'stars', - value => $stars); + value => $stars, + min => 0); $self->{output}->display(); $self->{output}->exit(); @@ -143,6 +146,8 @@ Specify password =item B<--timeout> +Threshold for HTTP timeout (Default: 5) + =back =cut