1 | 1 | simandl | #!/usr/bin/env perl |
2 | | | |
3 | | | # $Id: checknames.pl,v 1.3 2004/06/02 23:19:58 bernisys Exp $ |
4 | | | |
5 | | | # include PERL libraries |
6 | | | use warnings; |
7 | | | use diagnostics; |
8 | | | |
9 | | | # include HotSaNIC libraries |
10 | | | use lib "../../lib"; |
11 | | | use HotSaNICparser; |
12 | | | use lib "./platform"; |
13 | | | use common; |
14 | | | |
15 | | | if (@ARGV) { |
16 | | | my $setting=shift @ARGV; |
17 | | | |
18 | | | my %MODULECONFIG=HotSaNICmod::common::configure(); |
19 | | | |
20 | | | if ( (defined $MODULECONFIG{$setting}) and (ref $MODULECONFIG{$setting} eq "ARRAY") ) { |
21 | | | foreach my $entry (@{$MODULECONFIG{$setting}}) { |
22 | | | my ($host,$community,$item,$dbname,$name,$file,$description,@other)=HotSaNICmod::common::get_names($entry,@ARGV); |
23 | | | print "$entry\n"; |
24 | | | printf "%12s: %-20s %s\n","HOST",$host,""; |
25 | | | printf "%12s: %-20s %s\n","COMMUNITY",$community,""; |
26 | | | printf "%12s: %-20s %s\n","ITEM",$item,"raw name"; |
27 | | | printf "%12s: %-20s %s\n","DBNAME",$dbname,"./rrd/$dbname.rrd"; |
28 | | | printf "%12s: %-20s %s\n","NAME",$name,"$name - last <time> (Day YYYY-MM-DD hh:mm)"; |
29 | | | printf "%12s: %-20s %s\n","FILE",$file,"$file-<time>.<ext>"; |
30 | | | printf "%12s: %-20s %s\n","DESCRIPTION",$description,""; |
31 | | | if (@other) { foreach (@other) { printf "%12s: %-20s %s\n","(OTHER)",$_,""; } } |
32 | | | print "\n"; |
33 | | | } |
34 | | | } |
35 | | | else { print "\"$setting\" does not exist or is not an array-type\n\n"; } |
36 | | | } |
37 | | | else { print "usage: checknames.pl ENTRY\n\n"; } |