Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Workaround Cern for Amanda status

by providencia (Pilgrim)
on Apr 15, 2000 at 23:34 UTC ( #7740=sourcecode: print w/replies, xml ) Need Help??
Category: Archiving/Backup utilities
Author/Contact Info My website
E-mail me
Description: This was created because the webserver is ancient that runs
the internal operations page and cannot run cgi as it's owner
So I couldn't create this as cgi(that's what our previous web-
master told me). So this program runs as root and still
gives the same information.

It's a specific solution to a specific problem, but you never know
who may find it useful.
#!/usr/bin/perl -w
#What the script does:
#Checks the status of the tape drive
#Then places that information into an html file.
# only without having to worry about the fact that
# the webserver can't run the command as it's owner. (CERN)
#   May not be a problem with Apache.
#   Comments and script written April 14, 2000

use strict;
#Sucking the output from amcheck and placing it in
#the varialble $status.
open (AMCHECK, "/your_path_to_amcheck/amcheck -s SETNAME |");
my $status = join "",<AMCHECK>;
close (AMCHECK);

#This displays the time
# placement is important here because
# it gets the time right after the status was retrieved
# more precise output than stating when the script was run as in $^T
my $time = localtime(time);

#The $color changes depending on TRUE : FALSE
my $color = $status =~ /error/i ? "#FFBBBB" : "#BBFFBB";
chomp ($status);

#Opening the tape-status.html file for writing
open (STATUS,">/your_path_to_status_page/tape-status.html");

#Print html to a file
print STATUS <<EOF;
<TITLE>Tape Drive Status</TITLE>
<FONT SIZE="+3" FACE="impact">Tape Drive Status</FONT>
<FONT COLOR ="red"><STRONG>Tape Check Last Run</STRONG>
<TD BGCOLOR="$color">
<FONT SIZE="+1">
close (STATUS);

#system("system_command") forks another process and is costly.
#It's nice of perl to have SOOOO many alternatives.
chmod 0666, "/path_to_this_page_again/tape-status.html";
Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://7740]
[SuicideJunkie]: talexb Apgrade is the highest point it will reach. They're informing you that it will all be downhill from here until the software hits a PEgrade, or impacts the terrain depending on the details of the orbit.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-07-25 18:19 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (376 votes). Check out past polls.