From aafc47368ff64cc5520c3760a5f51f68fdad7f1e Mon Sep 17 00:00:00 2001 From: Shini31 Date: Wed, 8 Jun 2016 11:29:31 +0200 Subject: [PATCH] update doc --- .../cloud/openstack/restapi/mode/hypervisor.pm | 15 ++++++++++----- .../cloud/openstack/restapi/mode/instance.pm | 17 +++++++++++------ .../openstack/restapi/mode/listhypervisors.pm | 2 +- .../openstack/restapi/mode/listinstances.pm | 7 +++++-- .../openstack/restapi/mode/listvolumes.pm | 9 ++++++--- .../cloud/openstack/restapi/mode/network.pm | 15 ++++++++------- .../cloud/openstack/restapi/mode/port.pm | 17 ++++++++++------- .../cloud/openstack/restapi/mode/volume.pm | 18 +++++++++++++----- 8 files changed, 64 insertions(+), 36 deletions(-) diff --git a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm index 0e0235556..8f1ad7284 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/hypervisor.pm @@ -55,7 +55,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "hypervisor-id:s" => { name => 'hypervisor_id' }, @@ -254,14 +253,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,WARNING,^down$)' + =back OPENSTACK OPTIONS: @@ -272,6 +273,10 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--hypervisor-id> + +Set Hypervisor's ID + =back =cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm index c2d04433c..1057cae41 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/instance.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/instance.pm @@ -63,7 +63,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "instance-id:s" => { name => 'instance_id' }, @@ -198,7 +197,7 @@ __END__ =head1 MODE -List OpenStack instances through Compute API V2 +Monitor instance status through Compute API V2 JSON OPTIONS: @@ -262,14 +261,16 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^STOPPED$)' + =back OPENSTACK OPTIONS: @@ -280,6 +281,10 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--instance-id> + +Set Instance's ID + =back =cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm index 5e0e250a9..658e1910a 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listhypervisors.pm @@ -254,7 +254,7 @@ Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') =item B<--exlude> -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) +Exclude specific instance's state (comma seperated list) (Example: --exclude=disabled) =item B<--timeout> diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm index 25decf343..a3836c5ff 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listinstances.pm @@ -139,6 +139,7 @@ sub api_request { } my $instancename = $val->{name}; $self->{instance_infos}->{$instancename}->{id} = $val->{id}; + $self->{instance_infos}->{$instancename}->{zone} = $val->{'OS-EXT-AZ:availability_zone'}; $self->{instance_infos}->{$instancename}->{compute} = $val->{'OS-EXT-SRV-ATTR:host'}; $self->{instance_infos}->{$instancename}->{osname} = $val->{'OS-EXT-SRV-ATTR:instance_name'}; $self->{instance_infos}->{$instancename}->{state} = $instancestate; @@ -148,7 +149,7 @@ sub api_request { sub disco_format { my ($self, %options) = @_; - my $names = ['name', 'id', 'compute', 'osname', 'state']; + my $names = ['name', 'id', 'zone', 'compute', 'osname', 'state']; $self->{output}->add_disco_format(elements => $names); } @@ -161,6 +162,7 @@ sub disco_show { foreach my $instancename (keys %{$self->{instance_infos}}) { $self->{output}->add_disco_entry(name => $instancename, id => $self->{instance_infos}->{$instancename}->{id}, + zone => $self->{instance_infos}->{$instancename}->{zone}, compute => $self->{instance_infos}->{$instancename}->{compute}, osname => $self->{instance_infos}->{$instancename}->{osname}, state => $self->{instance_infos}->{$instancename}->{state}, @@ -175,9 +177,10 @@ sub run { $self->api_request(); foreach my $instancename (keys %{$self->{instance_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , compute = %s, osname = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, compute = %s, osname = %s, state = %s]", $instancename, $self->{instance_infos}->{$instancename}->{id}, + $self->{instance_infos}->{$instancename}->{zone}, $self->{instance_infos}->{$instancename}->{compute}, $self->{instance_infos}->{$instancename}->{osname}, $self->{instance_infos}->{$instancename}->{state})); diff --git a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm index 7bd5b31f7..530a2c424 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/listvolumes.pm @@ -125,6 +125,7 @@ sub api_request { foreach my $val (@{$webcontent->{volumes}}) { my $volumename = $val->{name}; $self->{volumes_infos}->{$volumename}->{id} = $val->{id}; + $self->{volumes_infos}->{$volumename}->{zone} = $val->{availability_zone}; $self->{volumes_infos}->{$volumename}->{size} = $val->{size}; $self->{volumes_infos}->{$volumename}->{type} = $val->{ivolume_type}; $self->{volumes_infos}->{$volumename}->{state} = $val->{status}; @@ -134,7 +135,7 @@ sub api_request { sub disco_format { my ($self, %options) = @_; - my $names = ['name', 'id', 'type', 'size', 'state']; + my $names = ['name', 'id', 'zone', 'type', 'size', 'state']; $self->{output}->add_disco_format(elements => $names); } @@ -147,6 +148,7 @@ sub disco_show { foreach my $volumename (keys %{$self->{volumes_infos}}) { $self->{output}->add_disco_entry(name => $volumename, id => $self->{volumes_infos}->{$volumename}->{id}, + zone => $self->{volumes_infos}->{$volumename}->{zone}, size => $self->{volumes_infos}->{$volumename}->{size}."Gb", type => $self->{volumes_infos}->{$volumename}->{type}, state => $self->{volumes_infos}->{$volumename}->{state}, @@ -161,9 +163,10 @@ sub run { $self->api_request(); foreach my $volumename (keys %{$self->{volumes_infos}}) { - $self->{output}->output_add(long_msg => sprintf("%s [id = %s , size = %sGb, type = %s, state = %s]", + $self->{output}->output_add(long_msg => sprintf("%s [id = %s, zone = %s, size = %sGb, type = %s, state = %s]", $volumename, $self->{volumes_infos}->{$volumename}->{id}, + $self->{volumes_infos}->{$volumename}->{zone}, $self->{volumes_infos}->{$volumename}->{size}, $self->{volumes_infos}->{$volumename}->{type}, $self->{volumes_infos}->{$volumename}->{state})); @@ -184,7 +187,7 @@ __END__ =head1 MODE -List OpenStack instances through Compute API V2 +List OpenStack volumes through Block Storage API V2 JSON OPTIONS: diff --git a/centreon-plugins/cloud/openstack/restapi/mode/network.pm b/centreon-plugins/cloud/openstack/restapi/mode/network.pm index 71dde5f42..b97807980 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/network.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/network.pm @@ -57,7 +57,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "network-id:s" => { name => 'network_id' }, "threshold-overload:s@" => { name => 'threshold_overload' }, @@ -255,23 +254,25 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^BUILD$)' + =back OPENSTACK OPTIONS: =over 8 -=item B<--tenant-id> +=item B<--network-id> -Set Tenant's ID +Set Network's ID =back diff --git a/centreon-plugins/cloud/openstack/restapi/mode/port.pm b/centreon-plugins/cloud/openstack/restapi/mode/port.pm index 6cb6ab783..ac17a3aa1 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/port.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/port.pm @@ -257,24 +257,27 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) =back +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^N\/A$)' + +=back + OPENSTACK OPTIONS: =over 8 -=item B<--tenant-id> +=item B<--port-id> -Set Tenant's ID +Set Port's ID =back -=cut diff --git a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm index 219e87771..7f9fb8b3d 100644 --- a/centreon-plugins/cloud/openstack/restapi/mode/volume.pm +++ b/centreon-plugins/cloud/openstack/restapi/mode/volume.pm @@ -64,7 +64,6 @@ sub new { "password:s" => { name => 'password' }, "ssl:s" => { name => 'ssl', }, "header:s@" => { name => 'header' }, - "exclude:s" => { name => 'exclude' }, "timeout:s" => { name => 'timeout' }, "tenant-id:s" => { name => 'tenant_id' }, "volume-id:s" => { name => 'volume_id' }, @@ -261,16 +260,20 @@ Specify SSL version (example : 'sslv3', 'tlsv1'...) Set HTTP headers (Multiple option. Example: --header='Content-Type: xxxxx') -=item B<--exlude> - -Exclude specific instance's state (comma seperated list) (Example: --exclude=Paused,Running,Off,Exited) - =item B<--timeout> Threshold for HTTP timeout (Default: 3) =back +=item B<--threshold-overload> + +Set to overload default threshold values (syntax: section,status,regexp) +It used before default thresholds (order stays). +Example: --threshold-overload='status,CRITICAL,^deleting$)' + +=back + OPENSTACK OPTIONS: =over 8 @@ -279,6 +282,11 @@ OPENSTACK OPTIONS: Set Tenant's ID +=item B<--volume-id> + +Set Volume's ID + =back =cut +