Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Then i run this script on a cron and piped the result to a file which i tailed to be shown in my terminal. Now it's difficult to notice if the resulting A record changed. I have to be glued to the terminal all the time. I was thinking maybe, if the result is not as expected, the script can email and notify me. Is that possible? Thanks..! n0jp7#!/usr/bin/perl -w use strict; open(INPUT_FILE, "<HOSTLIST>") or die "Cannot open: $!"; my @array = <INPUT_FILE>; close(INPUT_FILE) or die "Cannot close: $!"; for my $line (@array) { my @output = `dig A $line`; print("="x50,"\n"); print ("@output\n\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Send Email If Result of Dig command
by Lotus1 (Vicar) on Sep 10, 2018 at 12:49 UTC | |
|
Re: Send Email If Result of Dig command
by PeterKaagman (Beadle) on Sep 10, 2018 at 11:23 UTC |