mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-26 23:24:27 +02:00
+ Enhance processcount mode to manage empty values (now you have to use regexp and '^$' syntax for empty)
This commit is contained in:
parent
1962a1c94e
commit
b30c944491
@ -157,10 +157,10 @@ sub run {
|
|||||||
# $options{snmp} = snmp object
|
# $options{snmp} = snmp object
|
||||||
$self->{snmp} = $options{snmp};
|
$self->{snmp} = $options{snmp};
|
||||||
|
|
||||||
my $oid2check_filter;
|
my $oid2check_filter = 'status';
|
||||||
# To have a better order
|
# To have a better order
|
||||||
foreach (('name', 'path', 'args', 'status')) {
|
foreach (('name', 'path', 'args', 'status')) {
|
||||||
if (defined($self->{option_results}->{'process_' . $_})) {
|
if (defined($self->{option_results}->{'process_' . $_}) && $self->{option_results}->{'process_' . $_} ne '') {
|
||||||
$oid2check_filter = $_;
|
$oid2check_filter = $_;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ sub run {
|
|||||||
push @{$more_oids}, $oid_hrSWRunPerfCPU;
|
push @{$more_oids}, $oid_hrSWRunPerfCPU;
|
||||||
}
|
}
|
||||||
foreach (keys %$oids) {
|
foreach (keys %$oids) {
|
||||||
if ($_ ne $oid2check_filter && defined($self->{option_results}->{'process_' . $_})) {
|
if ($_ ne $oid2check_filter && defined($self->{option_results}->{'process_' . $_}) && $self->{option_results}->{'process_' . $_} ne '') {
|
||||||
push @{$more_oids}, $oids->{$_};
|
push @{$more_oids}, $oids->{$_};
|
||||||
$mores_filters->{$_} = 1;
|
$mores_filters->{$_} = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user