[BACK]Return to host2rrd CVS log [TXT][DIR] Up to [local] / nagios / check_rrd / bin

Annotation of nagios/check_rrd/bin/host2rrd, Revision 1.2

1.1       andrew      1: #!/usr/bin/perl -T
1.2     ! andrew      2: # $RedRiver: host2rrd,v 1.1 2007/01/10 18:01:11 andrew Exp $
1.1       andrew      3: ########################################################################
                      4: # hostalias2filename *** figures out the filename for a wireless
                      5: #                        customer to pass to a script.
                      6: #
                      7: # 2007.01.10 #*#*# andrew fresh <andrew@mad-techies.org>
                      8: ########################################################################
                      9: use strict;
                     10: use warnings;
                     11:
                     12: use Data::Dumper;
                     13:
                     14: %ENV = ();
                     15:
                     16: use Getopt::Long;
                     17:
                     18: my $basedir = '/var/www/wstationinfo';
                     19: my $Host;
                     20: my $RRD;
                     21:
                     22: #Option checking
                     23: my $status = GetOptions(
                     24:        "host|H=s"      => \$Host,
                     25:        "rrd|r=s"       => \$RRD,
                     26: );
                     27:
1.2     ! andrew     28: die "No host passes!" unless $Host;
1.1       andrew     29: die "No RRD passed!"  unless $RRD;
                     30:
                     31: my ($server, $client) = split /-/, $Host, 2;
                     32:
                     33: my $filename = $basedir . '/' . $server . '/' . $Host. '-' . $RRD . '.rrd';
                     34:
                     35: print $filename, "\n";

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>