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

File: [local] / nagios / check_rrd / bin / host2rrd (download)

Revision 1.1, Wed Jan 10 18:01:11 2007 UTC (17 years, 5 months ago) by andrew
Branch: MAIN

convert from a hostname to an rrd file

#!/usr/bin/perl -T
# $RedRiver$
########################################################################
# hostalias2filename *** figures out the filename for a wireless 
#                        customer to pass to a script.
# 
# 2007.01.10 #*#*# andrew fresh <andrew@mad-techies.org>
########################################################################
use strict;
use warnings;

use Data::Dumper;

%ENV = ();

use Getopt::Long;

my $basedir = '/var/www/wstationinfo';
my $Host;
my $RRD;

#Option checking
my $status = GetOptions(
	"host|H=s"	=> \$Host,
	"rrd|r=s"	=> \$RRD,
);

die "No host passes!" unless $Host
die "No RRD passed!"  unless $RRD;

my ($server, $client) = split /-/, $Host, 2;

my $filename = $basedir . '/' . $server . '/' . $Host. '-' . $RRD . '.rrd';

print $filename, "\n";