clean(plugin): some mode missing + update check_plugins script (#3337)
This commit is contained in:
parent
30a51a32b8
commit
bc45db33fc
|
@ -40,14 +40,13 @@ sub new {
|
|||
'oraclejvmgc' => 'apps::kingdee::eas::mode::oraclejvmgc',
|
||||
'ibmjvmgc' => 'apps::kingdee::eas::mode::ibmjvmgc',
|
||||
'ormrpc' => 'apps::kingdee::eas::mode::ormrpc',
|
||||
'easlicense' => 'apps::kingdee::eas::mode::easlicense',
|
||||
'activeusers' => 'apps::kingdee::eas::mode::activeusers',
|
||||
'oracleversion' => 'apps::kingdee::eas::mode::oracleversion',
|
||||
'oraclesession' => 'apps::kingdee::eas::mode::oraclesession',
|
||||
'oracletable' => 'apps::kingdee::eas::mode::oracletable',
|
||||
'oraclerecyclebin' => 'apps::kingdee::eas::mode::oraclerecyclebin',
|
||||
'oracleksqltemptable' => 'apps::kingdee::eas::mode::oracleksqltemptable',
|
||||
'oracleredolog' => 'apps::kingdee::eas::mode::oracleredolog',
|
||||
'oracleredolog' => 'apps::kingdee::eas::mode::oracleredolog'
|
||||
);
|
||||
|
||||
$self->{custom_modes}{api} = 'apps::kingdee::eas::custom::api';
|
||||
|
|
|
@ -38,10 +38,9 @@ sub new {
|
|||
'exceptions' => 'cloud::azure::management::applicationinsights::mode::exceptions',
|
||||
'external-calls' => 'cloud::azure::management::applicationinsights::mode::externalcalls',
|
||||
'io-operations' => 'cloud::azure::management::applicationinsights::mode::iooperations',
|
||||
'health' => 'cloud::azure::management::applicationinsights::mode::health',
|
||||
'memory' => 'cloud::azure::management::applicationinsights::mode::memory',
|
||||
'page-views' => 'cloud::azure::management::applicationinsights::mode::pageviews',
|
||||
'requests' => 'cloud::azure::management::applicationinsights::mode::requests',
|
||||
'requests' => 'cloud::azure::management::applicationinsights::mode::requests'
|
||||
};
|
||||
|
||||
$self->{custom_modes}->{azcli} = 'cloud::azure::custom::azcli';
|
||||
|
|
|
@ -38,6 +38,22 @@ sub check_directory {
|
|||
closedir $dh;
|
||||
}
|
||||
|
||||
sub check_custommode {
|
||||
my (%options) = @_;
|
||||
|
||||
my $cmodes = `$options{bin} --plugin=$options{plugin} --list-custommode`;
|
||||
if ($cmodes !~ /Custom Modes Available:\n(.*)/ms) {
|
||||
print " mode: $options{mode}, result=$cmodes";
|
||||
return ;
|
||||
}
|
||||
|
||||
foreach my $cmode (split /\n/, $1) {
|
||||
$cmode =~ s/\s+//g;
|
||||
my $result = `$options{bin} --plugin=$options{plugin} --custommode=$cmode --mode=$options{mode}`;
|
||||
print " mode: $options{mode}, custommode: $cmode, result=$result";
|
||||
}
|
||||
}
|
||||
|
||||
my $plugin = "$FindBin::Bin/../centreon_plugins.pl";
|
||||
check_directory("$FindBin::Bin/..");
|
||||
|
||||
|
@ -49,11 +65,17 @@ foreach my $plugin_path (@$plugins) {
|
|||
foreach my $mode (split /\n/, $1) {
|
||||
$mode =~ s/\s+//g;
|
||||
my $result = `$plugin --plugin=$plugin_path --mode=$mode`;
|
||||
print " mode: $mode, result=$result";
|
||||
if ($result =~ /Need to specify '--custommode'/i) {
|
||||
check_custommode(bin => $plugin, plugin => $plugin_path, mode => $mode);
|
||||
} else {
|
||||
print " mode: $mode, result=$result";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print "error: $modes\n";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
|
|
@ -203,9 +203,6 @@ sub manage_selection {
|
|||
}
|
||||
|
||||
if (scalar(keys %{$self->{quota}}) <= 0) {
|
||||
if ($exit_code != 0) {
|
||||
$self->{output}->output_add(long_msg => "command output:" . $stdout);
|
||||
}
|
||||
$self->{output}->add_option_msg(short_msg => "No quota found (filters or command issue)");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue