mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-30 00:55:18 +02:00
add function in catalog
This commit is contained in:
parent
f3241cbc29
commit
b395c824bd
@ -25,7 +25,7 @@ use warnings;
|
|||||||
use Exporter;
|
use Exporter;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT_OK = qw(catalog_status_threshold);
|
our @EXPORT_OK = qw(catalog_status_threshold catalog_status_calc);
|
||||||
|
|
||||||
sub catalog_status_threshold {
|
sub catalog_status_threshold {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
@ -59,6 +59,16 @@ sub catalog_status_threshold {
|
|||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub catalog_status_calc {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
foreach (keys %{$options{new_datas}}) {
|
||||||
|
if (/^$self->{instance}_(.*)/) {
|
||||||
|
$self->{result_values}->{$1} = $options{new_datas}->{$_};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user