diff --git a/cloud/cadvisor/restapi/custom/api.pm b/cloud/cadvisor/restapi/custom/api.pm index 8cf9530da..8396e5e13 100644 --- a/cloud/cadvisor/restapi/custom/api.pm +++ b/cloud/cadvisor/restapi/custom/api.pm @@ -46,7 +46,7 @@ sub new { 'hostname:s@' => { name => 'hostname' }, 'port:s' => { name => 'port', default => 8080 }, 'proto:s' => { name => 'proto', default => 'http' }, - 'path:s' => { name => 'path', default => '/containers/docker/' }, + 'api-path:s' => { name => 'api_path', default => '/containers/docker/' }, 'credentials' => { name => 'credentials' }, 'username:s' => { name => 'username' }, 'password:s' => { name => 'password' }, @@ -114,7 +114,7 @@ sub internal_api_list_nodes { my $response = $self->{http}->request( hostname => $options{node_name}, - url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{path}, + url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{api_path}, unknown_status => '', critical_status => '', warning_status => ''); my $nodes; eval { @@ -156,7 +156,7 @@ sub internal_api_list_containers { my $response = $self->{http}->request( hostname => $options{node_name}, - url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{path}, + url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{api_path}, unknown_status => '', critical_status => '', warning_status => ''); my $containers = []; my $containers_ids; @@ -212,7 +212,7 @@ sub internal_api_get_container_stats { my ($self, %options) = @_; my $response = $self->{http}->request( hostname => $options{node_name}, - url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{path} . '/' . $options{container_id}, + url_path => '/api/' . $self->{option_results}->{api_version} . $self->{option_results}->{api_path} . '/' . $options{container_id}, unknown_status => '', critical_status => '', warning_status => ''); my $container_stats; my $full_container_stats; @@ -337,7 +337,7 @@ Port used (Default: 8080) Specify https if needed (Default: 'http') -=item B<--path> +=item B<--api-path> Path used (Default: '/containers/docker') diff --git a/cloud/cadvisor/restapi/mode/containerusage.pm b/cloud/cadvisor/restapi/mode/containerusage.pm index 69645d999..3d665dab5 100644 --- a/cloud/cadvisor/restapi/mode/containerusage.pm +++ b/cloud/cadvisor/restapi/mode/containerusage.pm @@ -133,7 +133,7 @@ sub set_counters { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { diff --git a/cloud/cadvisor/restapi/mode/diskio.pm b/cloud/cadvisor/restapi/mode/diskio.pm index 7d39900ea..c41536386 100644 --- a/cloud/cadvisor/restapi/mode/diskio.pm +++ b/cloud/cadvisor/restapi/mode/diskio.pm @@ -59,7 +59,7 @@ sub set_counters { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { diff --git a/cloud/cadvisor/restapi/mode/nodestatus.pm b/cloud/cadvisor/restapi/mode/nodestatus.pm index 6575d110f..b62574a2c 100644 --- a/cloud/cadvisor/restapi/mode/nodestatus.pm +++ b/cloud/cadvisor/restapi/mode/nodestatus.pm @@ -80,7 +80,7 @@ sub set_counters { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { diff --git a/cloud/cadvisor/restapi/mode/traffic.pm b/cloud/cadvisor/restapi/mode/traffic.pm index 1a39fef5a..f86890e22 100644 --- a/cloud/cadvisor/restapi/mode/traffic.pm +++ b/cloud/cadvisor/restapi/mode/traffic.pm @@ -66,7 +66,7 @@ sub set_counters { sub new { my ($class, %options) = @_; - my $self = $class->SUPER::new(package => __PACKAGE__, %options); + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { @@ -118,7 +118,7 @@ sub manage_selection { name => $name, }; - my $name = defined($self->{option_results}->{use_name}) ? $name : $container_id; + $name = defined($self->{option_results}->{use_name}) ? $name : $container_id; if (defined($first_stat->{network}->{interfaces})) { foreach my $interface_index (0..(scalar(@{$first_stat->{network}->{interfaces}}) - 1)) { $self->{containers_traffic}->{$name} = {