+ minor fix on github stats
This commit is contained in:
parent
9cc179930c
commit
01cc973cdf
|
@ -26,6 +26,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::http;
|
use centreon::plugins::http;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
|
@ -79,8 +80,7 @@ sub run {
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($@) {
|
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}->output_add(long_msg => Data::Dumper::Dumper(), debug => 1);
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
@ -93,11 +93,14 @@ sub run {
|
||||||
short_msg => sprintf("%d forks - %d watchers - %d stars", $forks, $watchers, $stars));
|
short_msg => sprintf("%d forks - %d watchers - %d stars", $forks, $watchers, $stars));
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => 'forks',
|
$self->{output}->perfdata_add(label => 'forks',
|
||||||
value => $forks);
|
value => $forks,
|
||||||
|
min => 0);
|
||||||
$self->{output}->perfdata_add(label => 'watchers',
|
$self->{output}->perfdata_add(label => 'watchers',
|
||||||
value => $watchers);
|
value => $watchers,
|
||||||
|
min => 0);
|
||||||
$self->{output}->perfdata_add(label => 'stars',
|
$self->{output}->perfdata_add(label => 'stars',
|
||||||
value => $stars);
|
value => $stars,
|
||||||
|
min => 0);
|
||||||
|
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
|
@ -143,6 +146,8 @@ Specify password
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
|
Threshold for HTTP timeout (Default: 5)
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
Loading…
Reference in New Issue