X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=inline;f=clearadm%2Fsystems.cgi;h=18419f462e294ad1f8069edc52b80be03d6fdf6f;hb=8dcb2450e3bc6dfef59fd76db79c615ce8d8cb8b;hp=4346c936fd5b2f8dc5a79370530be79046540748;hpb=81cbd130706633b1c19ff59371c2ef61d80c562b;p=clearscm.git
diff --git a/clearadm/systems.cgi b/clearadm/systems.cgi
index 4346c93..18419f4 100755
--- a/clearadm/systems.cgi
+++ b/clearadm/systems.cgi
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/local/bin/perl
=pod
@@ -48,7 +48,7 @@ use warnings;
use FindBin;
use Getopt::Long;
-use CGI qw (:standard :cgi-lib *table start_Tr end_Tr start_td end_td);
+use CGI qw(:standard :cgi-lib *table start_Tr end_Tr start_td end_td);
use CGI::Carp 'fatalsToBrowser';
use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
@@ -65,7 +65,7 @@ my $subtitle = 'Systems Status: All Systems';
my $clearadm;
-sub DisplaySystems () {
+sub DisplaySystems() {
display start_table {cellspacing => 1, class => 'main'};
display start_Tr;
@@ -80,7 +80,7 @@ sub DisplaySystems () {
display th {class => 'labelCentered'}, 'Load Avg';
display end_Tr;
- foreach ($clearadm->FindSystem) {
+ for ($clearadm->FindSystem) {
my %system = %{$_};
$system{alias} = setField $system{alias}, 'N/A';
@@ -174,7 +174,7 @@ sub DisplaySystems () {
my $lastheardfromClass = 'dataCentered';
my $lastheardfromData = $system{lastheardfrom};
- unless ($clearadm->SystemAlive (%system)) {
+ unless ($clearadm->SystemAlive(%system)) {
$lastheardfromClass = 'dataCenteredAlert';
$lastheardfromData = a {
href => "alertlog.cgi?system=$system{name}",
@@ -189,16 +189,21 @@ sub DisplaySystems () {
display td {class => $classRightTop}, "$load{loadavg} ",
font {class => 'dim' }, "
$load{timestamp}";
display td {class => $classRightTop}, $system{loadavgThreshold};
+
+ my $image = $system{loadavgsmall}
+ ? "data:image/png;base64,$system{loadavgsmall}"
+ : "plotloadavg.cgi?system=$system{name}&tiny=1";
+
display td {class => $class},
a {
href =>
"plot.cgi?type=loadavg&system=$system{name}&scaling=Hour&points=24"
}, img {
- src => "plotloadavg.cgi?system=$system{name}&tiny=1",
+ src => $image,
border => 0,
};
display end_Tr;
- } # foreach
+ } # for
display end_table;
@@ -213,7 +218,7 @@ sub DisplaySystems () {
} # DisplaySystems
# Main
-GetOptions (
+GetOptions(
usage => sub { Usage },
verbose => sub { set_verbose },
debug => sub { set_debug },
@@ -286,4 +291,4 @@ Please report problems to Andrew DeFaria .
Copyright (c) 2010, ClearSCM, Inc. All rights reserved.
-=cut
\ No newline at end of file
+=cut