From ae052ccec954608401f6c1e6a391d61ecc3797a2 Mon Sep 17 00:00:00 2001 From: Heuzef Date: Fri, 20 Sep 2019 10:59:21 +0200 Subject: [PATCH] Add more color --- Check.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Check.pm b/Check.pm index 29b73b2..33a1ee6 100644 --- a/Check.pm +++ b/Check.pm @@ -34,7 +34,7 @@ sub action foreach my $host ( GetUserHosts(1) ) { my($fullDur, $incrCnt, $incrAge, $fullSize, $fullRate, $reasonHilite, - $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors); + $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor); my($shortErr); my @Backups = $bpc->BackupInfoRead($host); my $fullCnt = $incrCnt = 0; @@ -96,6 +96,11 @@ sub action $fullSize = sprintf("%.2f", $fullSize / 1024); $incrAge = " " if ( $incrAge eq "" ); $lastXferErrors = $Backups[@Backups-1]{xferErrs} if ( @Backups ); + if ( $lastXferErrors == 0 ) { + $lastXferErrorsColor = "MediumSeaGreen"; + } else { + $lastAgeColor = "Tomato"; + } $reasonHilite = $Conf{CgiStatusHilightColor}{$Status{$host}{reason}} || $Conf{CgiStatusHilightColor}{$Status{$host}{state}}; if ( $Conf{BackupsDisable} == 1 ) { @@ -127,8 +132,8 @@ sub action $str = <${HostLink($host)} - $fullAge - $incrAge + >$fullAge + >$incrAge $lastAge $lastXferErrors ???