Ignore:
Timestamp:
Jan 11, 2019, 11:06:09 AM (6 years ago)
Author:
g7moreau
Message:
  • Can force check sleeping host
File:
1 edited

Legend:

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

    r381 r382  
    1717use strict;
    1818use warnings;
    19 use version; our $VERSION = version->declare('0.10.7');
     19use version; our $VERSION = version->declare('0.10.8');
    2020
    2121use CGI;
     
    368368         my $downtime = downtime($host_stat->last_state_change);
    369369         my $color = alertcolor('CRITICAL', $downtime);
    370          $htmlpage .= " <tr style='background:$color'>\n";
    371          $htmlpage .= "  <td class='hoop'><a href=\"$config->{'nagios-server'}{'status-cgi'}?host=" . uri_encode($hostname) . "\">$hostname</a></td>\n";
     370         my $stylecolor = "style='background:$color;'";
     371         $htmlpage .= " <tr>\n";
     372         $htmlpage .= "  <td $stylecolor>" . "<a href=\"$cgi_script_name?check=" . uri_encode($hostname) . '">&#8623;</a></td>' . "\n";
     373         $htmlpage .= "  <td $stylecolor class='hoop'><a href=\"$config->{'nagios-server'}{'status-cgi'}?host=" . uri_encode($hostname) . "\">$hostname</a></td>\n";
    372374         my @host_service;
    373375         for my $srv ($log->list_services_on_host($host)) {
    374             push @host_service, $log->service($host, $srv)->service_description;
     376            my $service = $log->service($host, $srv)->service_description;
     377            push @host_service, $service;
     378            if ($cgi_check eq $hostname) {
     379               $now++;
     380               printf $nagios_cmd "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%lu\n", $now, $hostname, $service, $now;
     381               }
    375382            }
    376          $htmlpage .= "  <td><small>" . join(', ', @host_service) . "</small></td>\n";
    377          $htmlpage .= "  <td style='text-align:right;'>$downtime days</td>\n";
     383         $htmlpage .= "  <td $stylecolor><small>" . join(', ', @host_service) . "</small></td>\n";
     384         $htmlpage .= "  <td $stylecolor style='text-align:right;'>$downtime days</td>\n";
     385         $htmlpage .= "  <td class='checking'></td>\n" if $cgi_check eq $hostname;
    378386         $htmlpage .= " </tr>\n";
    379387         }
Note: See TracChangeset for help on using the changeset viewer.