Changeset 247
- Timestamp:
- Jun 25, 2018, 11:32:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nagios-velvice/velvice.cgi
r246 r247 118 118 display: inline; 119 119 } 120 .bold td {120 td.bold { 121 121 font-weight: bold; 122 122 } … … 157 157 open $nagios_cmd, '>>', $config->{'nagios-cmd'} or die "Can't open file filename: $!"; 158 158 159 my @oomkiller = ();159 # my @oomkiller = (); 160 160 my %sshdown = (); 161 my @aptuptodate = ();161 # my @aptuptodate = (); 162 162 my %cmdafter = (); 163 163 my $after; … … 212 212 } 213 213 214 push @aptuptodate, $hostname if $service eq 'APT UPTODATE';215 push @oomkiller, $hostname if $service eq 'OOM Killer' and $status ne 'PENDING';214 # push @aptuptodate, $hostname if $service eq 'APT UPTODATE'; 215 # push @oomkiller, $hostname if $service eq 'OOM Killer' and $status ne 'PENDING'; 216 216 for my $srv_name (keys %{$config->{'service'}}) { 217 217 my $srv_regex = $config->{'service'}{$srv_name}{'regex'}; … … 253 253 } 254 254 255 if (@oomkiller or @aptuptodate or $after) { 255 # if (@oomkiller or @aptuptodate or $after) { 256 if ($after) { 256 257 require Nagios::Object::Config; 257 258 my $parser = Nagios::Object::Config->new(); … … 261 262 my @action = grep !exists $sshdown{$_}, @{$cmdafter{$srv_name}}; 262 263 if (@action) { 263 my $srv_title = $config->{'service'}{$srv_name}{'title'} || $srv_name;264 $htmlpage .= "<h2> Action:$srv_title</h2>\n";264 my $srv_title = $config->{'service'}{$srv_name}{'title'} || "Action: $srv_name"; 265 $htmlpage .= "<h2>$srv_title</h2>\n"; 265 266 $htmlpage .= "<pre>\n"; 266 267 my $remote_action = $config->{'service'}{$srv_name}{'command'}; … … 277 278 } 278 279 279 @oomkiller = grep !exists $sshdown{$_}, @oomkiller;280 if (@oomkiller) {281 $htmlpage .= "<h2>OOM Killer</h2>\n";282 $htmlpage .= "<pre>\n";283 if (@oomkiller == 1) {284 $htmlpage .= " ssh";285 }286 else {287 $htmlpage .= " tssh -c 'sudo rm /var/lib/nagios3/nagios_oom_killer.log'";288 }289 for my $host (@oomkiller) {290 my $object = $parser->find_object("$host", "Nagios::Host");291 $htmlpage .= ' ' . hostmapping($object->address =~ s/\..*$//r);292 }293 $htmlpage .= " 'sudo rm /var/lib/nagios3/nagios_oom_killer.log'" if (@oomkiller == 1);294 $htmlpage .= "</pre>\n";295 }296 297 @aptuptodate = grep !exists $sshdown{$_}, @aptuptodate;298 if (@aptuptodate) {299 $htmlpage .= "<h2>APT UPTODATE</h2>\n";300 $htmlpage .= "<pre>\n";301 if (@aptuptodate == 1) {302 $htmlpage .= " ssh";303 }304 else {305 $htmlpage .= " tssh";306 }307 for my $host (@aptuptodate) {308 my $object = $parser->find_object("$host", "Nagios::Host");309 $htmlpage .= ' ' . hostmapping($object->address =~ s/\..*$//r);310 }311 $htmlpage .= "</pre>\n";312 }280 # @oomkiller = grep !exists $sshdown{$_}, @oomkiller; 281 # if (@oomkiller) { 282 # $htmlpage .= "<h2>OOM Killer</h2>\n"; 283 # $htmlpage .= "<pre>\n"; 284 # if (@oomkiller == 1) { 285 # $htmlpage .= " ssh"; 286 # } 287 # else { 288 # $htmlpage .= " tssh -c 'sudo rm /var/lib/nagios3/nagios_oom_killer.log'"; 289 # } 290 # for my $host (@oomkiller) { 291 # my $object = $parser->find_object("$host", "Nagios::Host"); 292 # $htmlpage .= ' ' . hostmapping($object->address =~ s/\..*$//r); 293 # } 294 # $htmlpage .= " 'sudo rm /var/lib/nagios3/nagios_oom_killer.log'" if (@oomkiller == 1); 295 # $htmlpage .= "</pre>\n"; 296 # } 297 # 298 # @aptuptodate = grep !exists $sshdown{$_}, @aptuptodate; 299 # if (@aptuptodate) { 300 # $htmlpage .= "<h2>APT UPTODATE</h2>\n"; 301 # $htmlpage .= "<pre>\n"; 302 # if (@aptuptodate == 1) { 303 # $htmlpage .= " ssh"; 304 # } 305 # else { 306 # $htmlpage .= " tssh"; 307 # } 308 # for my $host (@aptuptodate) { 309 # my $object = $parser->find_object("$host", "Nagios::Host"); 310 # $htmlpage .= ' ' . hostmapping($object->address =~ s/\..*$//r); 311 # } 312 # $htmlpage .= "</pre>\n"; 313 # } 313 314 } 314 315 }
Note: See TracChangeset
for help on using the changeset viewer.