Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub sendEmail {
- my ($to, $from, $subject, $message) = @_;
- my $sendmail = '/usr/lib/sendmail';
- open(MAIL, "|$sendmail -oi -t");
- print MAIL "From: $from\n";
- print MAIL "To: $to\n";
- print MAIL "Subject: $subject\n\n";
- print MAIL "$message\n";
- close(MAIL);
- }
- 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