5 =head1 NAME $RCSfile: getTimestamp.cgi,v $
7 Get a list of timestamps startTimestamp or endTimestamp elementID
15 Andrew DeFaria <Andrew@ClearSCM.com>
23 Mon Dec 13 09:13:27 EST 2010
27 $Date: 2011/01/20 14:34:24 $
33 Usage getTimestamp.cgi: system=<system> elementID=<elementID>
34 [filesytem=<filesystem>] [scaling=<scaling>]
37 <system>: Name of the system defined in the Clearadm database to
38 retrieve the timestamps for.
39 <elementID>: Element's ID name. Must be one of startTimestamp or
40 endTimeStamp. This is needed by makeTimestampDropdown to
41 determine whether to default the dropdown to Earliest or
43 [<filesystem>]: If specified then we look at clearadm.filesystem otherwise
44 we look at clearadm.loadavg.
45 <scaling>: Currently one of Minute, Hour, Day or Month. Specifies how
46 Clearadm::GetLoadavg|GetFS will scale the data returned.
50 Retrieve a list of timestamps for a given system/filesystem and put out a web
51 page that specifies the <select> dropdown representing the timestamps. If
52 filesystem is specified then we retrieve information about filesystem snapshots
53 in clearadm.fs, otherwise we retrieve information about loadavg snapshots in
54 clearadm.loadavg for the given system. Data is scaled by scaling and elementID
55 is used to determine if we should make 'Earliest' or 'Latest' the default. This
56 script is intended to be called by AJAX to fill in a dropdown list on a web page
57 in response to JavaScript action on another dropdown (a system dropdown or an
67 use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
73 use CGI qw (:standard :cgi-lib);
77 error "System not specified", 1
80 error "ElementID not specified", 1
81 unless $opts{elementID};
83 error 'ElementID must be either "startTimestamp" or "endTimestamp"', 1
84 unless $opts{elementID} eq 'startTimestamp' or $opts{elementID} eq 'endTimestamp';
86 my $default = $opts{elementID} eq 'startTimestamp' ? 'Earliest' : 'Latest';
88 my $clearadm = Clearadm->new;
90 heading undef, 'short';
92 my $name = $opts{elementID} eq 'startTimestamp'
94 : $opts{elementID} eq 'endTimestamp'
98 if ($opts{filesystem}) {
99 display makeTimeDropdown
109 display makeTimeDropdown
124 =head1 CONFIGURATION AND ENVIRONMENT
126 DEBUG: If set then $debug is set to this level.
128 VERBOSE: If set then $verbose is set to this level.
130 TRACE: If set then $trace is set to this level.
138 =head2 ClearSCM Perl Modules
151 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearadm.pm">Clearadm</a><br>
152 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/ClearadmWeb.pm">ClearadmWeb</a><br>
153 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
158 =head1 BUGS AND LIMITATIONS
160 There are no known bugs in this script
162 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
164 =head1 LICENSE AND COPYRIGHT
166 Copyright (c) 2010, ClearSCM, Inc. All rights reserved.