Hi,
I wrote this little script to check to see if our Lotus Notes servers are
running, and from the command line it works fine if I type perl
notescheck.pl
When I invoke the script from a web page I get an error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, yo*@example.com and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.
More information about this error may be available in the server error log.
Here is the script:
#!/usr/bin/perl -w
#use strict;
use IO::Socket;
$hostName = notesserver;
my $host = shift || $hostName;
my $port = shift || 25;
my $sock = new
IO::Socket::INET(PeerAddr=>$host,PeerPort=>$port,P roto=>'tcp');
if($sock)
{
print "<script>
alert(\"Server notesserver is running...\");
history.back();
</script>";
exit;
}
else
{
print "<script>
alert(\"Server notesserver appears to be down...\");
history.back();
</script>";
exit;
}
close $sock or die "close: $!";
When I run the script from the console (perl notescheck.pl) I get the
following:
<script>
alert("Server RSLNM02 is running...");
history.back();
</script>[root@rts cgi-bin]#
....which tells me the script is running fine.
Heres the code from the web page:
<form action="/cgi-bin/notescheck.pl" method="post">
<input type="submit">
Can anyone tell me why this doesn't work?
Thanks,
Jason