#!/bin/sh # -*- perl -*- if [ -d "/opt/.zeus_vault" -o -f "/etc/zxtm-version" ] ; then ZEUSHOME=/opt/zeus export ZEUSHOME fi exec $ZEUSHOME/perl/miniperl -wx $0 ${1+"$@"} if 0; #!/usr/bin/perl -w #line 12 # Historical Activity graph generator # # Copyright (C) Zeus Technology 2006 BEGIN { $ENV{"PATH"} = "$ENV{PATH}:/bin:/usr/bin"; ($ENV{"ZEUSHOME"}) = ( $ENV{"ZEUSHOME"} =~ m@^(.*)$@ ); # Untaint unshift @INC, "$ENV{ZEUSHOME}/zxtmadmin/lib/perl", "$ENV{ZEUSHOME}/perl"; } use Zeus::Execute qw( execute ); use Zeus::ZXTM::Statd qw( LineGraph ); use strict; sub Usage($) { my $fh = shift; print $fh < $time * 60, type => $type, index => $index, objects => $objects, axistype => $axistype, ); if( !$error ) { my $graph = "$ENV{ZEUSHOME}/zxtmadmin/bin/graph.line"; my( $exit, $stdout, $stderr ) = execute( "$graph --size ${w}x${h}", $data ); if( $exit == 0 ) { if( $output eq '-' ) { print $stdout; } else { open FILE, ">$output" or die "Failed to open '$output' for writing: $!\n"; print FILE $stdout; close FILE; } if( scalar keys %$linecolours ) { print STDERR "Line colours:\n\n"; foreach my $key( keys %$linecolours ) { print STDERR "$$linecolours{$key}: $key\n"; } } exit ( 0 ); } else { $error = $stderr; } } $error =~ s/\.\s+/\n/g; print STDERR "$error\n"; exit 1;