diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-07-11 17:00:41 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-07-11 17:00:41 +0200 |
commit | 818785f1d6c9d0d05d8d37e7efbfa0a25541d99a (patch) | |
tree | 8105bf6f13311c727d55c85a9d53db63dffcc045 | |
parent | 32163a706e469763c72646f696a313b917e45420 (diff) | |
download | bcfg2-tools-818785f1d6c9d0d05d8d37e7efbfa0a25541d99a.tar.gz bcfg2-tools-818785f1d6c9d0d05d8d37e7efbfa0a25541d99a.tar.bz2 bcfg2-tools-818785f1d6c9d0d05d8d37e7efbfa0a25541d99a.zip |
hosts-state: critical only for bad hosts, stale hosts = WARNING
-rwxr-xr-x | hosts-state | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hosts-state b/hosts-state index 80f0a64..6b405aa 100755 --- a/hosts-state +++ b/hosts-state @@ -60,10 +60,14 @@ while(<$reports>) { print("$short_host\tBcfg2\t$status\t$msg | $perf\n\x17"); } -if ($summary->{bad} > 0 or $summary->{stale} > 0) { +if ($summary->{bad} > 0) { $summary->{msg} = 'CRITICAL'; $summary->{status} = 2; } +elsif ($summary->{stale} > 0) { + $summary->{msg} = 'WARNING'; + $summary->{status} = 1; +} print("vm-bcfg2\tBcfg2 Status\t$summary->{status}\t$summary->{msg} | clean=$summary->{clean};;;0 bad=$summary->{bad};;;0 stale=$summary->{stale};;;0\n\x17"); |