in reply to capture output and email on linux

Assuming that you trust the contents of the "netapps" file (who has write permission on that?), and you don't have any worries about using rsh instead of ssh (which is what I would use) -- and assuming that the local host is a *n*x box of some sort with its own mailer daemon -- here is a simple way:
my $recipient = "somebody@somewhere.dom"; while (<IN>) { chomp; system( "rsh $_ snapmirror status | mail $recipient" ); }
The default behavior of rsh (or ssh) is to attach the remote process's STDOUT to the local process STDOUT (in this case, the STDOUT of the shell being spawned by "system()"), so you can pipe the output of the rsh'ed command to some other (local) process on the same command line.

Replies are listed 'Best First'.
Re^2: capture output and email on linux
by JSchmitz (Canon) on Jun 09, 2005 at 18:57 UTC
    I think you mean single ticks:
    my $recipient = 'somebody@somewhere.com';
    Perl will gripe about double quotes in that instance -
    cheers -

    Jeffery