/[rrd-simple-monitoring]/bin/rrd-server.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /bin/rrd-server.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by dpavlin, Thu Jul 16 18:48:19 2009 UTC revision 3 by dpavlin, Thu Jul 16 19:59:49 2009 UTC
# Line 1  Line 1 
1  #!/bin/env perl  #!/usr/bin/perl
2  ############################################################  ############################################################
3  #  #
4  #   $Id: rrd-server.pl 1092 2008-01-23 14:23:51Z nicolaw $  #   $Id: rrd-server.pl 1092 2008-01-23 14:23:51Z nicolaw $
# Line 23  Line 23 
23    
24  BEGIN {  BEGIN {
25          # User defined constants          # User defined constants
26          use constant BASEDIR => '/home/nicolaw/webroot/www/rrd.me.uk';          use constant BASEDIR => '/var/www/rrd';
27          use constant THEME  => ('BACK#F5F5FF','SHADEA#C8C8FF','SHADEB#9696BE',          use constant THEME  => ('BACK#F5F5FF','SHADEA#C8C8FF','SHADEB#9696BE',
28                                  'ARROW#61B51B','GRID#404852','MGRID#67C6DE');                                  'ARROW#61B51B','GRID#404852','MGRID#67C6DE');
29  }  }
# Line 59  $VERSION = '1.43' || sprintf('%d', q$Rev Line 59  $VERSION = '1.43' || sprintf('%d', q$Rev
59  my %opt = ();  my %opt = ();
60  $Getopt::Std::STANDARD_HELP_VERSION = 1;  $Getopt::Std::STANDARD_HELP_VERSION = 1;
61  $Getopt::Std::STANDARD_HELP_VERSION = 1;  $Getopt::Std::STANDARD_HELP_VERSION = 1;
62  Getopt::Std::getopts('u:G:T:gthvVf?', \%opt);  Getopt::Std::getopts('r:u:G:T:gthvVf?', \%opt);
63    
64  $opt{g} ||= $opt{G};  $opt{g} ||= $opt{G};
65  $opt{t} ||= $opt{T};  $opt{t} ||= $opt{T};
# Line 67  $opt{t} ||= $opt{T}; Line 67  $opt{t} ||= $opt{T};
67  # Display help or version  # Display help or version
68  (VERSION_MESSAGE() && exit) if defined $opt{v};  (VERSION_MESSAGE() && exit) if defined $opt{v};
69  (HELP_MESSAGE() && exit) if defined $opt{h} || defined $opt{'?'} ||  (HELP_MESSAGE() && exit) if defined $opt{h} || defined $opt{'?'} ||
70          !(defined $opt{u} || defined $opt{g} || defined $opt{t});          !(defined $opt{u} || defined $opt{g} || defined $opt{t} || defined $opt{r});
71    
72  # cd to the righr location and define directories  # cd to the righr location and define directories
73  chdir BASEDIR || die sprintf("Unable to chdir to '%s': %s", BASEDIR, $!);  chdir BASEDIR || die sprintf("Unable to chdir to '%s': %s", BASEDIR, $!);
# Line 82  memoize('read_graph_data'); Line 82  memoize('read_graph_data');
82  memoize('basename');  memoize('basename');
83  memoize('graph_def');  memoize('graph_def');
84    
85    if ( my $hostname = $opt{r} ) {
86            warn "# refresh $hostname\n";
87            $opt{V} = 1;
88            create_thumbnails($rrd,\%dir,$hostname);
89            create_graphs($rrd,\%dir,$hostname);
90            exit;
91    }
92    
93  # Update the RRD if we've been asked to  # Update the RRD if we've been asked to
94  my $hostname = defined $opt{u} ? update_rrd($rrd,\%dir,$opt{u}) : undef;  my $hostname = defined $opt{u} ? update_rrd($rrd,\%dir,$opt{u}) : undef;
95    

Legend:
Removed from v.1  
changed lines
  Added in v.3

  ViewVC Help
Powered by ViewVC 1.1.26