permission denied using rsh (security not an issue)
Hi all,
I am using a perl script that connects to hosts on a local network to monitor host activity. It uses rsh to connect to each host which in turn runs several commands. However i am getting permission denied when trying to connect even though .rhosts file on each host is set up to allow all hosts, and hosts.equiv file also set up correctly.
the code that rsh's is as follows
foreach $host (@hosts) {
print FH "<H3><A NAME\=\"$host\">$host\</A\></H3>";
print FH "<P>";
$cmd="hostname && vmstat && top -n 1 | head -n 20 && df -k";
foreach $host (@hosts) {
print FH "<TABLE BORDER=0>";
@result=`rsh $host -l root -K $cmd`;
foreach $line (@result) {
if ( $line =~/9[0-9]\%\s*\>\// ) {
$count++;
print FH "<TR><TD> <A NAME\=\"$count\"><FONT COLOR\=\"RED\"\>$line</FONT\></A></TD></TR>";
@hosts is an array that holds all the hostnames on the network. To say im almost pulling my hair out at this stage is an understatement. Any help would be appreciated. i did get something to work at one stage but it only ran the commands on the machine that the perl script is running from. this script displays all the results from each machine in a web browser btw.
cheers in advance, Singist
|