Ignore:
Timestamp:
Jan 5, 2019, 8:55:36 AM (6 years ago)
Author:
g7moreau
Message:
  • Change color to CRITICAL for host if one critical alert
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nagios-velvice/velvice.cgi

    r378 r380  
    77#
    88# velvice.cgi
    9 # Copyright (C) 2014-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
     9# Copyright (C) 2014-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    1010#
    1111# Need NagiosStatus http://exchange.nagios.org/directory/Addons/APIs/Perl/NagiosStatus-2Epm/details
     
    1717use strict;
    1818use warnings;
    19 use version; our $VERSION = version->declare('0.10.6');
     19use version; our $VERSION = version->declare('0.10.7');
    2020
    2121use CGI;
     
    153153      $hostcount{$host} ||= {count => 0, color => $color, status_id => $status_id, downtime => $downtime};
    154154      $hostcount{$host}->{'count'}++;
    155       if (($status_id >= $hostcount{$host}->{'status_id'}) and ($downtime < $hostcount{$host}->{'downtime'})) {
     155      if (($status_id > $hostcount{$host}->{'status_id'})
     156            or (($status_id == $hostcount{$host}->{'status_id'}) and ($downtime < $hostcount{$host}->{'downtime'}))) {
    156157         $hostcount{$host}->{'downtime'}  = $downtime;
    157158         $hostcount{$host}->{'status_id'} = $status_id;
Note: See TracChangeset for help on using the changeset viewer.