Advertisement
Guest User

GarciaPL

a guest
Jul 7th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1. sub sendEmail {
  2.     my ($to, $from, $subject, $message) = @_;
  3.     my $sendmail = '/usr/lib/sendmail';
  4.     open(MAIL, "|$sendmail -oi -t");
  5.     print MAIL "From: $from\n";
  6.     print MAIL "To: $to\n";
  7.     print MAIL "Subject: $subject\n\n";
  8.     print MAIL "$message\n";
  9.     close(MAIL);
  10. }
  11.  
  12. sendEmail("receiveremail\@domain.com", "myemail\@domain.com", "Nagios Error", "Cannot receive NRPE output from host 10.100.5.6");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement