From 46e08280d9b3fcaff8290c0ab6070dae081f9823 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 12 Jul 2017 13:11:50 +0200 Subject: [PATCH] working on docker --- cloud/docker/restapi/mode/containerusage.pm | 8 ++++---- cloud/docker/restapi/mode/nodestatus.pm | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cloud/docker/restapi/mode/containerusage.pm b/cloud/docker/restapi/mode/containerusage.pm index df1c76e71..ef517ccaa 100644 --- a/cloud/docker/restapi/mode/containerusage.pm +++ b/cloud/docker/restapi/mode/containerusage.pm @@ -166,7 +166,7 @@ sub set_counters { per_second => 1, output_template => 'Read IOPs : %.2f', output_error_template => "Read IOPs : %s", perfdatas => [ - { label => 'read_iops', value => 'read_iops_per_second', template => '%.2f', + { label => 'read_iops', value => 'read_io_per_second', template => '%.2f', unit => 'iops', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, ], } @@ -176,7 +176,7 @@ sub set_counters { per_second => 1, output_template => 'Write IOPs : %.2f', output_error_template => "Write IOPs : %s", perfdatas => [ - { label => 'write_iops', value => 'write_iops_per_second', template => '%.2f', + { label => 'write_iops', value => 'write_io_per_second', template => '%.2f', unit => 'iops', min => 0, label_extra_instance => 1, instance_use => 'display_absolute' }, ], } @@ -293,8 +293,8 @@ sub manage_selection { $name .= '.' . $interface; $self->{containers_traffic}->{$name} = { display => $name, - traffic_in => $result->{$container_id}->{Stats}->{networks}->{$interface}->{rx_bytes}, - traffic_out => $result->{$container_id}->{Stats}->{networks}->{$interface}->{tx_bytes}, + traffic_in => $result->{$container_id}->{Stats}->{networks}->{$interface}->{rx_bytes} * 8, + traffic_out => $result->{$container_id}->{Stats}->{networks}->{$interface}->{tx_bytes} * 8, }; } } diff --git a/cloud/docker/restapi/mode/nodestatus.pm b/cloud/docker/restapi/mode/nodestatus.pm index 73bacbe68..3075f3fd3 100644 --- a/cloud/docker/restapi/mode/nodestatus.pm +++ b/cloud/docker/restapi/mode/nodestatus.pm @@ -96,7 +96,7 @@ sub new { $options{options}->add_options(arguments => { "warning-node-status:s" => { name => 'warning_node_status', default => '' }, - "critical-node-status:s" => { name => 'critical_node_status', default => '%{status} !~ /ready/ || %{manager_status} !~ /reachable/' }, + "critical-node-status:s" => { name => 'critical_node_status', default => '%{status} !~ /ready/ || %{manager_status} !~ /reachable|-/' }, }); return $self; @@ -138,7 +138,7 @@ sub manage_selection { $self->{nodes}->{$name} = { display => $name , status => $entry->{Status}, - manager_status => $entry->{ManagerStatus}, + manager_status => defined($entry->{ManagerStatus}) ? $entry->{ManagerStatus} : '-', }; } } @@ -166,7 +166,7 @@ Can used special variables like: %{display}, %{status}, %{manager_status}. =item B<--critical-node-status> -Set critical threshold for status (Default: '%{status} !~ /ready/ || %{manager_status} !~ /reachable/'). +Set critical threshold for status (Default: '%{status} !~ /ready/ || %{manager_status} !~ /reachable|-/'). Can used special variables like: %{display}, %{status}, %{manager_status}. =back