[BACK]Return to check_email CVS log [TXT][DIR] Up to [local] / nagios / check_email

Diff for /nagios/check_email/check_email between version 1.1 and 1.2

version 1.1, 2006/08/29 23:28:49 version 1.2, 2006/09/27 19:54:27
Line 11 
Line 11 
 #  #
 # 11.15.2003 Version 1.0  # 11.15.2003 Version 1.0
 #  #
 # $RedRiver$  # $RedRiver: check_email,v 1.1 2006/08/29 22:28:49 andrew Exp $
   
 use POSIX;  use POSIX;
 use lib "/usr/local/libexec/nagios"  ;  use lib "/usr/local/libexec/nagios"  ;
Line 100 
Line 100 
 ### Actions go here  ### Actions go here
   
 my $subject = scalar localtime;  my $subject = scalar localtime;
 my $recieved_subject;  my $received_subject;
   
 $smtp_server ||= $hostname;  $smtp_server ||= $hostname;
 $pop_server ||= $hostname;  $pop_server ||= $hostname;
Line 137 
Line 137 
         foreach my $line ( @{ $lines } ) {          foreach my $line ( @{ $lines } ) {
                 #print $line;                  #print $line;
                 if ( $line =~ /^Subject:\s+(.*)$/o ) {                  if ( $line =~ /^Subject:\s+(.*)$/o ) {
                         $recieved_subject = $1;                          $received_subject = $1;
                         last;                          last;
                 }                  }
         }          }
Line 146 
Line 146 
 $pop->quit() || done('CRITICAL', "Couldn't quit from POP server $pop_server");  $pop->quit() || done('CRITICAL', "Couldn't quit from POP server $pop_server");
   
 #print "Subject:  $subject\n";  #print "Subject:  $subject\n";
 #print "Recieved: $recieved_subject\n";  #print "Received: $received_subject\n";
   
 if ($subject eq $recieved_subject) {  if (not defined $received_subject) {
           $state = "WARNING";
           $answer = "No subject line received";
   } elsif ($subject eq $received_subject) {
         $state = "OK";          $state = "OK";
         $answer = "Sent and recieved message correctly";          $answer = "Sent and received message correctly";
 } else {  } else {
         $state = "WARNING";          $state = "WARNING";
         $answer = "Subject lines did not match wrong message recieved";          $answer = "Subject lines did not match wrong message received";
 }  }
   
 done($state, $answer);  done($state, $answer);
Line 181 
Line 184 
         print "status of email flow on the target host.\n";          print "status of email flow on the target host.\n";
         print "It sends an e-mail to a test user, and then checks \n";          print "It sends an e-mail to a test user, and then checks \n";
         print "a POP account. Failing at any point during if there is \n";          print "a POP account. Failing at any point during if there is \n";
         print "a problem. It gives a WARNING if the mail is not recieved \n";          print "a problem. It gives a WARNING if the mail is not received \n";
         print "in time, and gives a CRITICAL if it cannot connect to any \n";          print "in time, and gives a CRITICAL if it cannot connect to any \n";
         print "services. Do not use an account that you want to recieve \n";          print "services. Do not use an account that you want to recieve \n";
         print "mail from. This program will delete ALL mail in the mailbox \n";          print "mail from. This program will delete ALL mail in the mailbox \n";

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>