R
robertchen117
#!/usr/bin/perl
use CGI;
print "Content-type: text/html\n\n";
$no_connected = 0;
$no_unkown = 0;
$no_unreachable = 0;
$no_disconnected= 0;
$no_unavailable= 0;
$total = 0;
$others = 0;
printf("-----------------------------------------------------------------------
\n");
printf("%s total hosts\n", $total);
printf("%6s hosts connected\n", $no_connected);
printf("%6s hosts unreachable\n", $no_unreachable);
printf("%6s hosts unkown\n", $no_unkown);
printf("%6s hosts disconnected\n", $no_disconnected);
printf("%6s hosts unavailable\n", $no_unavailable);
printf("%6s hosts others status\n", $others);
printf("-----------------------------------------------------------------------
\n");
put in my apache, and access the cgi, the result is:
use CGI;
print "Content-type: text/html\n\n";
$no_connected = 0;
$no_unkown = 0;
$no_unreachable = 0;
$no_disconnected= 0;
$no_unavailable= 0;
$total = 0;
$others = 0;
printf("-----------------------------------------------------------------------
\n");
printf("%s total hosts\n", $total);
printf("%6s hosts connected\n", $no_connected);
printf("%6s hosts unreachable\n", $no_unreachable);
printf("%6s hosts unkown\n", $no_unkown);
printf("%6s hosts disconnected\n", $no_disconnected);
printf("%6s hosts unavailable\n", $no_unavailable);
printf("%6s hosts others status\n", $others);
printf("-----------------------------------------------------------------------
\n");
put in my apache, and access the cgi, the result is: