#!/usr/bin/perl -T # $RedRiver: host2rrd,v 1.1 2007/01/10 18:01:11 andrew Exp $ ######################################################################## # hostalias2filename *** figures out the filename for a wireless # customer to pass to a script. # # 2007.01.10 #*#*# andrew fresh ######################################################################## 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";