SOURCES: check_id-pilet.pl - if no active tickets found, state it as critical

glen glen at pld-linux.org
Wed Jun 18 08:38:11 CEST 2008


Author: glen                         Date: Wed Jun 18 06:38:11 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- if no active tickets found, state it as critical

---- Files affected:
SOURCES:
   check_id-pilet.pl (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/check_id-pilet.pl
diff -u SOURCES/check_id-pilet.pl:1.2 SOURCES/check_id-pilet.pl:1.3
--- SOURCES/check_id-pilet.pl:1.2	Tue Jun 17 12:41:29 2008
+++ SOURCES/check_id-pilet.pl	Wed Jun 18 08:38:06 2008
@@ -85,6 +85,8 @@
 		push(@tickets, { type => $td{type}, start => parse_date($td{start}), end => parse_date($td{end}) });
 	}
 
+	$p->nagios_exit(WARN, "No tickets found") unless @tickets;
+
 	sub parse_time {
 		my $str = $_[0];
 		my ($v, $m) = ($str =~ /^(\d+)([smhd])?$/);
@@ -117,7 +119,7 @@
 			$p->nagios_exit(OK, "Ticket '$t->{type}' expires on $tm");
 		}
 	}
-	$p->nagios_exit(UNKNOWN, "Unable to parse verbose ticket information");
+	$p->nagios_exit(CRITICAL, "No active tickets found");
 }
 
 $p->nagios_exit(OK, "Ticket $id valid") if $t =~ /^Isikul isikukoodiga \Q$id\E on olemas hetkel kehtiv ID-pilet\.$/;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/check_id-pilet.pl?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list