version 1.3, 2007/03/20 23:40:20 |
version 1.4, 2007/03/20 23:56:29 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: host2rrd,v 1.2 2007/01/10 18:05:31 andrew Exp $ |
# $RedRiver: host2rrd,v 1.3 2007/03/20 22:40:20 andrew Exp $ |
######################################################################## |
######################################################################## |
# hostalias2filename *** figures out the filename for a wireless |
# hostalias2filename *** figures out the filename for a wireless |
# customer to pass to a script. |
# customer to pass to a script. |
|
|
my $Host; |
my $Host; |
my $Host_Suffix = ''; |
my $Host_Suffix = ''; |
my $RRD; |
my $RRD; |
|
my $Host_To_Lower; |
|
|
#Option checking |
#Option checking |
my $status = GetOptions( |
my $status = GetOptions( |
|
|
"suffix|S=s" => \$Host_Suffix, |
"suffix|S=s" => \$Host_Suffix, |
"rrd|r=s" => \$RRD, |
"rrd|r=s" => \$RRD, |
"path|p=s" => \$basedir, |
"path|p=s" => \$basedir, |
|
"tolower|l" => \$Host_To_Lower, |
); |
); |
|
|
|
|
die "No host passes!" unless $Host; |
die "No host passes!" unless $Host; |
die "No RRD passed!" unless $RRD; |
die "No RRD passed!" unless $RRD; |
|
|
|
if ($Host_To_Lower) { |
|
$Host = lc $Host; |
|
} |
|
|
|
|
my ($server, $client) = split /-/, $Host, 2; |
my ($server, $client) = split /-/, $Host, 2; |