Commit 2bd075d7 authored by Fulvio Galeazzi's avatar Fulvio Galeazzi
Browse files

2018-04-04: FG; Updated cephHealth, now relying on Perl script.

parent d0bfe224
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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment