Hope that helps!#!/usr/bin/perl # Use the modules here! use strict; use warnings; BEGIN { $|=1; print "Content-type: text/html\n\n"; use CGI::Carp qw(fatalsToBrowser); } $kjarnavelar = "9"; $i = "0"; $rbports = "0"; $oraports = "0"; @host = ("x00802","x00803","x00804","x00902","x00903","x00904","xb0011 +2","xb00113","xb00114"); foreach $host (@host) { $rbport = `/usr/bin/telnet $host 1367 |egrep -v "Trying|Connec +|Escape"`; $rbarray[$i] = "$rbport"; $oracle = `/usr/bin/telnet $host 1371 |egrep -v "Trying|Connec +|Escape"`; $oraarray[$i] = "$oracle"; $oraports = $oraports+$oracle; $rbports = $rbports+$rbport; $i++; } print "<HTML>"; print "<TABLE BORDER=1>"; print "<TR><TD><B>Host</TD><TD><B>RB Ports Active</TD><TD><B>Oracle Po +rts Active</TD></TR>"; for($start=0;$start<=$kjarnavelar;$start++) { print "<TR><TD>$host[$start]</TD><TD>$rbarray[$start]</TD><TD> +$oraarray[$start]</TD></TR>"; } print "</TABLE>"; print "<TABLE BORDER=1>"; print "<TR><TD><B>Samtals RB Port</TD><TD><B>Samtals Oracle Port</TD>< +/TR>"; print "<TR><TD>$rbports</TD><TD>$oraports</TD></TR>"; print "</TABLE>"; print "</HTML>";
In reply to Re: CGI script returns no values in browser but is ok on command line?
by wazzuteke
in thread CGI script returns no values in browser but is ok on command line?
by gudmo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |