jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [apps/] [platform/] [common.pm] - Blame information for rev 18

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::common;
2 
3sub version {
4 ($VERSION = '$Revision: 1.8 $') =~ s/.*(\d+\.\d+).*/$1/;
5 return "common.pm $VERSION";
6 }
7 
8sub configure {
9 %MODULECONFIG=HotSaNICparser::get_moduleconfig(".",(APP=>"array"));
10 foreach (@{$MODULECONFIG{APP}}) { if ( ~/SNMP/ ) { $MODULECONFIG{USE_SNMP}=1; last; } }
11 return %MODULECONFIG;
12 }
13 
14sub get_names {
15 my $entry=shift || ",";
16 my $host="";
17 my $community="";
18 
19 my ($item,$description)=split /,/,$entry;
20 if( index($item, "SNMP:") >= 0) { (undef,$host,$community,$item) = split /:/, $item; }
21 if ($host ne "") { $name="$host:$item"; }
22 else { $name=$item; }
23 ($dbname=$name) =~ s/:/_/g;
24 ($file=$name) =~ s/[.:]/_/g;
25 
26 return ($host,$community,$item,$dbname,$name,$file,$description);
27 }
28 
291;
30 

Powered by WebSVN 2.2.1