+ minor fix on github stats

This commit is contained in:
garnier-quentin 2016-01-08 10:51:47 +01:00
parent 9cc179930c
commit 01cc973cdf
1 changed files with 10 additions and 5 deletions

View File

@ -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