Annotation of nagios/check_rrd/bin/host2rrd, Revision 1.1
1.1 ! andrew 1: #!/usr/bin/perl -T
! 2: # $RedRiver$
! 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:
! 28: die "No host passes!" unless $Host
! 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>