cat mainriinfo.cgi #!/usr/bin/perl use strict; use warnings; use Net::SSH2::Perl; my $user = "root"; my $password = "adxyusc12"; my @hosts = qw(172.23.12.110); foreach my $host (@hosts){ my $cmd = "/usr/bin/uptime"; my $ssh = Net::SSH2::Perl->new( $host, port => 22); $ssh->login($user,$password); my($out) = $ssh->cmd($cmd); my ($time,$uptime) = (split /\s+/,$out)[1,3]; chop $uptime; print "$host has been up $uptime\n"; } print < Hello

Script Finished

END #### [Wed Jul 20 11:45:40 2016] [error] [client 172.17.17.43] (8)Exec format error: exec of '/var/www/html/mainriinfo.cgi' failed, referer: http://172.23.12.110/getriinfo.html [Wed Jul 20 11:45:40 2016] [error] [client 172.17.17.43] Premature end of script headers: mainriinfo.cgi, referer: http://172.23.12.110/getriinfo.html