diff --git a/Ceph/Config/userparameter_ceph.conf b/Ceph/Config/userparameter_ceph.conf index 157c8d1bebb4571a7696a9929804f9fcaacd92aa..713d8c774f36bbfd6ed70d66373dd80be65a2d62 100644 --- a/Ceph/Config/userparameter_ceph.conf +++ b/Ceph/Config/userparameter_ceph.conf @@ -1,4 +1,4 @@ -UserParameter=ceph.health,/etc/zabbix/scripts/ceph_health.sh +UserParameter=ceph.health[*],/etc/zabbix/scripts/cephHealth.pl $1 --status -s "clock skew" # Global UserParameter=ceph.global.objs[*],/etc/zabbix/scripts/cephUsage.pl $1 -o UserParameter=ceph.global.objsdeg[*],/etc/zabbix/scripts/cephHealth.pl $1 --od diff --git a/Ceph/Script/cephHealth.pl b/Ceph/Script/cephHealth.pl index 425b636a2819d8329419f853916b6dbeaf23a886..82ebd8d1d7aef18c293a4d6fc22cd5fbd5ec04aa 100755 --- a/Ceph/Script/cephHealth.pl +++ b/Ceph/Script/cephHealth.pl @@ -238,9 +238,18 @@ foreach my $_line (@_data) if (exists $statusHash{$fields[0]}) { $status = $statusHash{$fields[0]}; if ($status == 1) { -# if (@matchStr) { -# -# } + my $matchedStr = 1; + if (@matchStr) { + my @statusMsgs = split(/;/, $_line); + foreach my $aMsg (@statusMsgs) { + my $thisMatches = 0; + foreach my $aMatch (@matchStr) { + $thisMatches = 1 if ($aMsg =~ /$aMatch/); + } + $matchedStr = $matchedStr * $thisMatches; + } + $status = 0 if ($matchedStr); + } } } else { $status = 2;