#!/usr/bin/perl use strict; use warnings; use CGI; #use GD; $ENV{"PATH"} = qq(/opt/SUNWsamfs/sbin:/usr/bin); #sub image #{ my $imgtype = qw(gif); my $imgpath = qq(/var/apache/htdocs/images/logo.gif); # open (IMAGE, $imgpath) or die $!; # print "Pragma: no-cache\n"; # print "Content-type: image/$imgtype\n\n"; # # while (read(IMAGE, my $buffer, 16_384) ) # { # print $buffer; # } # # close (IMAGE); #} my $q1 =new CGI; print $q1->header( -type => "image/gif"); while (read(IMAGE, my $buffer, 16_384) ) { print $buffer; my $q =new CGI; print $q->header, $q->start_html('OHIS ASM server: stkv440'), # Header $q->h1({-style=>'Color:blue'},'ASM Tape Pool Status:'), # Body open (ARC, "archiver -lv |") or die $!; my $flag=0; while () { if (/(?i)allsets/) { $flag=1; } if ($flag==1) { if (/(?i)total space available:/) { print "

$_"; } else { print "

$_"; } } } close (ARC); close (IMAGE); $q->end_html; } __BEGIN_DATA__ ASM Tape Pool Status: allsets back.1 media: sf Volumes: STK000 Total space available: 58.8G back.2 media: sf Volumes: STK005 Total space available: 58.8G clinical1.1