diff --git a/centreon-plugins/centreon/plugins/script_custom/cli.pm b/centreon-plugins/centreon/plugins/script_custom/cli.pm index cefe245d3..79e7ed2cc 100644 --- a/centreon-plugins/centreon/plugins/script_custom/cli.pm +++ b/centreon-plugins/centreon/plugins/script_custom/cli.pm @@ -110,7 +110,8 @@ sub execute_command { command_path => defined($self->{option_results}->{command_path}) && $self->{option_results}->{command_path} ne '' ? $self->{option_results}->{command_path} : $options{command_path}, command_options => $command_options, timeout => $timeout, - no_quit => $options{no_quit} + no_quit => $options{no_quit}, + ssh_pipe => $options{ssh_pipe} ); } else { ($stdout, $exit_code) = centreon::plugins::misc::execute( diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm index a6cb0aaa3..a8c2c35ff 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/cpu.pm @@ -58,40 +58,21 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "hostname:s" => { name => 'hostname' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "command:s" => { name => 'command', default => 'show' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => 'performance -type cm' }, - "filter-name:s" => { name => 'filter_name' }, + 'filter-name:s' => { name => 'filter_name' } }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); - - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } -} - sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute( - output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options} + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "performance -type cm\n", + ssh_pipe => 1 ); + # Can have 4 columns also. #Location Busy Rate(%) Copy Residual Quantity(MB) @@ -107,13 +88,13 @@ sub manage_selection { foreach (split /\n/, $stdout) { next if ($_ !~ /^(CM.*?)\s{2,}(\d+)\s+\S+/); my ($cpu_name, $cpu_value) = ($1, $2); - + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $cpu_name !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "skipping '" . $cpu_name . "': no matching filter name."); next; } - + $self->{cpu}->{$cpu_name} = { display => $cpu_name, usage => $cpu_value }; } @@ -131,41 +112,10 @@ __END__ Check CPUs usage. +Command used: show performance -type cm + =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'performance -type cm'). - =item B<--filter-name> Filter by name (regexp can be used). diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm index 29ff25b76..5ba666b5c 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/physicaldisk.pm @@ -42,7 +42,7 @@ my $thresholds = { ['Broken', 'CRITICAL'], ['Not Exist', 'CRITICAL'], ['Unknown', 'UNKNOWN'] - ], + ] }; sub new { @@ -50,18 +50,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - "hostname:s" => { name => 'hostname' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "command:s" => { name => 'command', default => 'show' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => 'disks' }, - "filter:s@" => { name => 'filter' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "no-component:s" => { name => 'no_component' } + $options{options}->add_options(arguments => { + 'filter:s@' => { name => 'filter' }, + 'threshold-overload:s@' => { name => 'threshold_overload' }, + 'no-component:s' => { name => 'no_component' } }); $self->{no_components} = undef; @@ -71,10 +63,6 @@ sub new { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } $self->{filter} = []; foreach my $val (@{$self->{option_results}->{filter}}) { @@ -110,12 +98,11 @@ sub check_options { sub run { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "disks\n", + ssh_pipe => 1 + ); #Location Status Size Type Speed(rpm) Usage Health(%) #------------- ----------------------------- ------- ------------------- ---------- ------------------- --------- @@ -136,17 +123,23 @@ sub run { $self->{output}->output_add(long_msg => sprintf("Physical Disk '%s' status is '%s'", $disk_name, $disk_status)); my $exit = $self->get_severity(section => 'disk', value => $disk_status); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Physical Disk '%s' status is '%s'.", $disk_name, $disk_status)); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Physical Disk '%s' status is '%s'.", $disk_name, $disk_status) + ); } } - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("All %d physical disks are ok.", $total_components)); - + $self->{output}->output_add( + severity => 'OK', + short_msg => sprintf("All %d physical disks are ok.", $total_components) + ); + if (defined($self->{option_results}->{no_component}) && $total_components == 0) { - $self->{output}->output_add(severity => $self->{no_components}, - short_msg => 'No components are checked.'); + $self->{output}->output_add( + severity => $self->{no_components}, + short_msg => 'No components are checked.' + ); } $self->{output}->display(); @@ -174,7 +167,7 @@ sub check_filter { sub get_severity { my ($self, %options) = @_; my $status = 'UNKNOWN'; # default - + if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { if ($options{value} =~ /$_->{filter}/i) { @@ -189,7 +182,7 @@ sub get_severity { return $status; } } - + return $status; } @@ -201,41 +194,10 @@ __END__ Check Physical disks. +Command used: show disks + =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'disks'). - =item B<--filter> Exclude some parts (comma seperated list) diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm index da610c470..2e08e397a 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/portstats.pm @@ -28,11 +28,11 @@ use centreon::plugins::misc; sub set_counters { my ($self, %options) = @_; - + $self->{maps_counters_type} = [ { name => 'port', type => 1, cb_prefix_output => 'prefix_port_output', message_multiple => 'All ports are ok' } ]; - + $self->{maps_counters}->{port} = [ { label => 'read-iops', nlabel => 'port.io.read.usage.iops', set => { key_values => [ { name => 'read_iops' }, { name => 'display' } ], @@ -84,40 +84,20 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - "hostname:s" => { name => 'hostname' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "command:s" => { name => 'command', default => 'show' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => 'performance -type port' }, - "filter-name:s" => { name => 'filter_name' }, + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); - - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } -} - sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute( - output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options} + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "performance -type port\n", + ssh_pipe => 1 ); #Location IOPS(IOPS) Throughput(MB/s) @@ -136,7 +116,7 @@ sub manage_selection { $self->{output}->output_add(long_msg => "Skipping '" . $port_name . "': no matching filter name."); next; } - + $self->{port}->{$port_name} = { display => $port_name, read_iops => $port_read_iops, write_iops => $port_write_iops, @@ -159,41 +139,10 @@ __END__ Check Port statistics. +Command used: show performance -type port + =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'performance -type port'). - =item B<--filter-name> Filter by name (regexp can be used). diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm index 05b4c1637..3b98894de 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/psu.pm @@ -44,18 +44,10 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - 'hostname:s' => { name => 'hostname' }, - 'ssh-option:s@' => { name => 'ssh_option' }, - 'ssh-path:s' => { name => 'ssh_path' }, - 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' }, - 'timeout:s' => { name => 'timeout', default => 30 }, - 'command:s' => { name => 'command', default => 'show' }, - 'command-path:s' => { name => 'command_path' }, - 'command-options:s' => { name => 'command_options', default => 'enclosure-status -type all' }, - 'filter:s@' => { name => 'filter' }, - 'threshold-overload:s@' => { name => 'threshold_overload' }, - 'no-component:s' => { name => 'no_component' } + $options{options}->add_options(arguments => { + 'filter:s@' => { name => 'filter' }, + 'threshold-overload:s@' => { name => 'threshold_overload' }, + 'no-component:s' => { name => 'no_component' } }); $self->{no_components} = undef; @@ -65,10 +57,6 @@ sub new { sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); - - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } $self->{filter} = []; foreach my $val (@{$self->{option_results}->{filter}}) { @@ -104,13 +92,10 @@ sub check_options { sub run { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute( - output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options} + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "enclosure-status -type all\n", + ssh_pipe => 1 ); #Controller Enclosure #0 Information @@ -242,41 +227,10 @@ __END__ Check power supplies. +Command used: show enclosure-status -type all + =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'enclosure-status -type all'). - =item B<--filter> Exclude some parts (comma seperated list) diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm index f04211581..b898d943c 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/raidgroups.pm @@ -32,13 +32,6 @@ sub custom_threshold_output { return $self->{instance_mode}->get_severity(section => 'rg', value => $self->{result_values}->{status}); } -sub custom_status_calc { - my ($self, %options) = @_; - - $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_status'}; - return 0; -} - sub custom_usage_perfdata { my ($self, %options) = @_; @@ -86,6 +79,12 @@ sub custom_usage_calc { return 0; } +sub prefix_rg_output { + my ($self, %options) = @_; + + return "Raid Group '" . $options{instance_value}->{display} . "' "; +} + sub set_counters { my ($self, %options) = @_; @@ -96,7 +95,6 @@ sub set_counters { $self->{maps_counters}->{rg} = [ { label => 'status', threshold => 0, set => { key_values => [ { name => 'status' } ], - closure_custom_calc => $self->can('custom_status_calc'), output_template => 'Status : %s', output_error_template => 'Status : %s', output_use => 'status', closure_custom_perfdata => sub { return 0; }, @@ -114,29 +112,15 @@ sub set_counters { ]; } -sub prefix_rg_output { - my ($self, %options) = @_; - - return "Raid Group '" . $options{instance_value}->{display} . "' "; -} - sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - "hostname:s" => { name => 'hostname' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "command:s" => { name => 'command', default => 'show' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => 'raid-groups -csv' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - "filter-name:s" => { name => 'filter_name' }, - "filter-level:s" => { name => 'filter_level' }, + $options{options}->add_options(arguments => { + 'threshold-overload:s@' => { name => 'threshold_overload' }, + 'filter-name:s' => { name => 'filter_name' }, + 'filter-level:s' => { name => 'filter_level' } }); return $self; @@ -146,10 +130,6 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } - $self->{overload_th} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { if ($val !~ /^(.*?),(.*?),(.*)$/) { @@ -169,13 +149,10 @@ sub check_options { sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute( - output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options} + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "raid-groups -csv\n", + ssh_pipe => 1 ); #[RAID Group No.],[RAID Group Name],[RAID Level],[Assigned CM],[Status],[Total Capacity(MB)],[Free Capacity(MB)] @@ -215,8 +192,8 @@ sub manage_selection { my $thresholds = { rg => [ ['Available', 'OK'], - ['Spare in Use', 'WARNING'], - ], + ['Spare in Use', 'WARNING'] + ] }; sub get_severity { @@ -249,41 +226,10 @@ __END__ Check raid groups. +Command used: show raid-groups -csv + =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'raid-groups -csv'). - =item B<--threshold-overload> Set to overload default threshold values (syntax: section,status,regexp) diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm index b08ddfd80..98eae1551 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/mode/volumestats.pm @@ -89,7 +89,7 @@ sub set_counters { key_values => [ { name => 'write_response_time' }, { name => 'display' } ], output_template => 'Write Response Time : %d ms', perfdatas => [ - { label => 'write_response_time', value => 'write_response_time', template => '%d', + { label => 'write_response_time', template => '%d', unit => 'ms', min => 0, label_extra_instance => 1, instance_use => 'display' }, ], } @@ -138,40 +138,20 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - 'hostname:s' => { name => 'hostname' }, - 'ssh-option:s@' => { name => 'ssh_option' }, - 'ssh-path:s' => { name => 'ssh_path' }, - 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' }, - 'timeout:s' => { name => 'timeout', default => 30 }, - 'command:s' => { name => 'command', default => 'show' }, - 'command-path:s' => { name => 'command_path' }, - 'command-options:s' => { name => 'command_options', default => ' performance -type host-io' }, - 'filter-name:s' => { name => 'filter_name' } + $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' } }); return $self; } -sub check_options { - my ($self, %options) = @_; - $self->SUPER::check_options(%options); - - if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { - $self->{option_results}->{remote} = 1; - } -} - sub manage_selection { my ($self, %options) = @_; - my $stdout = centreon::plugins::misc::execute( - output => $self->{output}, - options => $self->{option_results}, - ssh_pipe => 1, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options} + my ($stdout) = $options{custom}->execute_command( + command => 'show', + command_options => "performance -type host-io\n", + ssh_pipe => 1 ); #Volume IOPS(IOPS) Throughput(MB/s) Response Time(msec.) Processing Time(msec.) Cache Hit Rate(%) @@ -201,6 +181,8 @@ sub manage_selection { next; } next if (/----|Name/i); + next if (/^CLI>/); + my $value = centreon::plugins::misc::trim($_); my @matches = split(/\s+/, $value); @@ -211,7 +193,7 @@ sub manage_selection { $self->{output}->output_add(long_msg => "Skipping '" . $matches[1] . "': no matching filter name.", debug => 1); next; } - + my %counters = (); for (my $i = 0; $i < scalar(@template_values); $i++) { $counters{$template_values[$i]->{label}} = $matches[$i + 2]; @@ -224,7 +206,7 @@ sub manage_selection { %counters }; } - + if (scalar(keys %{$self->{volume}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No volume found."); $self->{output}->option_exit(); @@ -237,57 +219,19 @@ __END__ =head1 MODE -Check Volume statistics. +Check volume statistics. + +Command used: show performance -type host-io =over 8 -=item B<--hostname> - -Hostname to query. - -=item B<--ssh-option> - -Specify multiple options like the user (example: --ssh-option='-l=centreon-engine' --ssh-option='-p=52'). - -=item B<--ssh-path> - -Specify ssh command path (default: none) - -=item B<--ssh-command> - -Specify ssh command (default: 'ssh'). Useful to use 'plink'. - -=item B<--timeout> - -Timeout in seconds for the command (Default: 30). - -=item B<--command> - -Command to get information (Default: 'show'). -Can be changed if you have output in a file. - -=item B<--command-path> - -Command path (Default: none). - -=item B<--command-options> - -Command options (Default: 'performance -type host-io'). - =item B<--filter-name> Filter by name (regexp can be used). -=item B<--warning-*> +=item B<--warning-*> B<--critical-*> -Threshold warning. -Can be: 'read-iops', 'write-iops', 'read-traffic', 'write-traffic', -'read-response-time', 'write-response-time', 'read-processing-time', 'write-processing-time', -'read-cache-hit-rate', 'write-cache-hit-rate'. - -=item B<--critical-*> - -Threshold critical. +Thresholds. Can be: 'read-iops', 'write-iops', 'read-traffic', 'write-traffic', 'read-response-time', 'write-response-time', 'read-processing-time', 'write-processing-time', 'read-cache-hit-rate', 'write-cache-hit-rate'. diff --git a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm index 9f7193f4d..0f6c09cd7 100644 --- a/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm +++ b/centreon-plugins/storage/fujitsu/eternus/dx/ssh/plugin.pm @@ -22,22 +22,23 @@ package storage::fujitsu::eternus::dx::ssh::plugin; use strict; use warnings; -use base qw(centreon::plugins::script_simple); +use base qw(centreon::plugins::script_custom); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $self->{version} = '1.0'; - %{$self->{modes}} = ( - 'physicaldisk' => 'storage::fujitsu::eternus::dx::ssh::mode::physicaldisk', - 'psu' => 'storage::fujitsu::eternus::dx::ssh::mode::psu', - 'raid-groups' => 'storage::fujitsu::eternus::dx::ssh::mode::raidgroups', - 'volume-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::volumestats', - 'cpu' => 'storage::fujitsu::eternus::dx::ssh::mode::cpu', - 'port-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::portstats', - ); + $self->{modes} = { + 'cpu' => 'storage::fujitsu::eternus::dx::ssh::mode::cpu', + 'physicaldisk' => 'storage::fujitsu::eternus::dx::ssh::mode::physicaldisk', + 'port-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::portstats', + 'psu' => 'storage::fujitsu::eternus::dx::ssh::mode::psu', + 'raid-groups' => 'storage::fujitsu::eternus::dx::ssh::mode::raidgroups', + 'volume-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::volumestats' + }; + + $self->{custom_modes}->{cli} = 'centreon::plugins::script_custom::cli'; return $self; }