mirror of
				https://github.com/centreon/centreon-plugins.git
				synced 2025-10-31 03:13:49 +01:00 
			
		
		
		
	indent + manage no vm running
This commit is contained in:
		
							parent
							
								
									9cf9e3d165
								
							
						
					
					
						commit
						90aa222b5e
					
				| @ -213,8 +213,10 @@ sub connector_response_status { | ||||
| 
 | ||||
|     if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { | ||||
|         $self->{output}->output_add(long_msg => $self->{result}->{extra_message}, debug => 1); | ||||
|         $self->{output}->output_add(severity => $status, | ||||
|                                     short_msg => $self->{result}->{short_message}); | ||||
|         $self->{output}->output_add( | ||||
|             severity => $status, | ||||
|             short_msg => $self->{result}->{short_message} | ||||
|         ); | ||||
|         $self->{output}->display(); | ||||
|         $self->{output}->exit(); | ||||
|     } | ||||
|  | ||||
| @ -155,14 +155,17 @@ sub manage_selection { | ||||
|     my ($self, %options) = @_; | ||||
| 
 | ||||
|     $self->{datastore} = {}; | ||||
|     my $response = $options{custom}->execute(params => $self->{option_results}, | ||||
|         command => 'datastoreiops'); | ||||
|     my $response = $options{custom}->execute( | ||||
|         params => $self->{option_results}, | ||||
|         command => 'datastoreiops' | ||||
|     ); | ||||
| 
 | ||||
|     if ($response->{code} == 200) { | ||||
|         $self->{output}->output_add(severity => 'OK', | ||||
|                                     short_msg => $response->{short_message}); | ||||
|         $self->{output}->output_add( | ||||
|             severity => 'OK', | ||||
|             short_msg => $response->{short_message} | ||||
|         ); | ||||
|         return ; | ||||
|          | ||||
|     } | ||||
| 
 | ||||
|     foreach my $ds_id (keys %{$response->{data}}) { | ||||
|  | ||||
| @ -135,20 +135,20 @@ sub new { | ||||
|     bless $self, $class; | ||||
|      | ||||
|     $options{options}->add_options(arguments => { | ||||
|         "vm-hostname:s"         => { name => 'vm_hostname' }, | ||||
|         "filter"                => { name => 'filter' }, | ||||
|         "scope-datacenter:s"    => { name => 'scope_datacenter' }, | ||||
|         "scope-cluster:s"       => { name => 'scope_cluster' }, | ||||
|         "scope-host:s"          => { name => 'scope_host' }, | ||||
|         "filter-description:s"  => { name => 'filter_description' }, | ||||
|         "filter-os:s"           => { name => 'filter_os' }, | ||||
|         "filter-uuid:s"         => { name => 'filter_uuid' }, | ||||
|         "display-description"   => { name => 'display_description' }, | ||||
|         "datastore-name:s"      => { name => 'datastore_name' }, | ||||
|         "filter-datastore:s"    => { name => 'filter_datastore' }, | ||||
|         "unknown-status:s"      => { name => 'unknown_status', default => '%{connection_state} !~ /^connected$/i or %{power_state}  !~ /^poweredOn$/i' }, | ||||
|         "warning-status:s"      => { name => 'warning_status', default => '' }, | ||||
|         "critical-status:s"     => { name => 'critical_status', default => '' }, | ||||
|         'vm-hostname:s'        => { name => 'vm_hostname' }, | ||||
|         'filter'               => { name => 'filter' }, | ||||
|         'scope-datacenter:s'   => { name => 'scope_datacenter' }, | ||||
|         'scope-cluster:s'      => { name => 'scope_cluster' }, | ||||
|         'scope-host:s'         => { name => 'scope_host' }, | ||||
|         'filter-description:s' => { name => 'filter_description' }, | ||||
|         'filter-os:s'          => { name => 'filter_os' }, | ||||
|         'filter-uuid:s'        => { name => 'filter_uuid' }, | ||||
|         'display-description'  => { name => 'display_description' }, | ||||
|         'datastore-name:s'     => { name => 'datastore_name' }, | ||||
|         'filter-datastore:s'   => { name => 'filter_datastore' }, | ||||
|         'unknown-status:s'     => { name => 'unknown_status', default => '%{connection_state} !~ /^connected$/i or %{power_state}  !~ /^poweredOn$/i' }, | ||||
|         'warning-status:s'     => { name => 'warning_status', default => '' }, | ||||
|         'critical-status:s'    => { name => 'critical_status', default => '' }, | ||||
|     }); | ||||
|      | ||||
|     return $self; | ||||
| @ -165,8 +165,18 @@ sub manage_selection { | ||||
|     my ($self, %options) = @_; | ||||
| 
 | ||||
|     $self->{vm} = {}; | ||||
|     my $response = $options{custom}->execute(params => $self->{option_results}, | ||||
|         command => 'datastorevm'); | ||||
|     my $response = $options{custom}->execute( | ||||
|         params => $self->{option_results}, | ||||
|         command => 'datastorevm' | ||||
|     ); | ||||
| 
 | ||||
|     if ($response->{code} == 200) { | ||||
|         $self->{output}->output_add( | ||||
|             severity => 'OK', | ||||
|             short_msg => $response->{short_message} | ||||
|         ); | ||||
|         return ; | ||||
|     } | ||||
| 
 | ||||
|     foreach my $vm_id (keys %{$response->{data}}) { | ||||
|         my $vm_name = $response->{data}->{$vm_id}->{name}; | ||||
| @ -262,14 +272,9 @@ Can used special variables like:  %{connection_state}, %{power_state} | ||||
| Set critical threshold for status (Default: ''). | ||||
| Can used special variables like:  %{connection_state}, %{power_state} | ||||
| 
 | ||||
| =item B<--warning-*> | ||||
| =item B<--warning-*> B<--critical-*> | ||||
| 
 | ||||
| Threshold warning. | ||||
| Can be: 'max-total-latency', 'read', 'write'. | ||||
| 
 | ||||
| =item B<--critical-*> | ||||
| 
 | ||||
| Threshold critical. | ||||
| Thresholds. | ||||
| Can be: 'max-total-latency', 'read', 'write'. | ||||
| 
 | ||||
| =back | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user