jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [apps/] [platform/] [common.pm] - Rev 13 Go to most recent revision

Compare with Previous - Blame - Download


package HotSaNICmod::common;

sub version {
  ($VERSION = '$Revision: 1.8 $') =~ s/.*(\d+\.\d+).*/$1/;
  return "common.pm $VERSION";
  }

sub configure {
  %MODULECONFIG=HotSaNICparser::get_moduleconfig(".",(APP=>"array"));
  foreach (@{$MODULECONFIG{APP}}) { if ( ~/SNMP/ ) { $MODULECONFIG{USE_SNMP}=1; last; } }
  return %MODULECONFIG;
  }

sub get_names {
  my $entry=shift || ",";
  my $host="";
  my $community="";
  
  my ($item,$description)=split /,/,$entry;
  if( index($item, "SNMP:") >= 0) { (undef,$host,$community,$item) = split /:/, $item; }
  if ($host ne "") { $name="$host:$item"; }
  else { $name=$item; }
  ($dbname=$name) =~ s/:/_/g;
  ($file=$name) =~ s/[.:]/_/g;

  return ($host,$community,$item,$dbname,$name,$file,$description);
  }

1;


Powered by WebSVN 2.2.1