jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [ping/] [platform/] [common.pm] - Blame information for rev 24

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::common;
2 
3sub version {
4 ($VERSION = '$Revision: 1.3 $') =~ s/.*(\d+\.\d+).*/$1/;
5 return "common.pm $VERSION";
6 }
7 
8sub configure {
9 my $num=0;
10 foreach (@_) {
11 ($var,$value)=HotSaNICparser::parse_line($_);
12 if ($var eq "PARALLEL") { $MODARGS{PARALLEL}=$value; }
13 if ($var eq "INTERVAL") { $MODARGS{INTERVAL}=$value; }
14 if ($var eq "SYSPING") { $MODARGS{SYSPING}=$value; }
15 if ($var eq "PROTOCOL") { $MODARGS{PROTOCOL}=$value; }
16 if ($var eq "HOST") {
17 my ($ip,$name)=split(/,/,$value);
18 $MODARGS{"HOST:$ip"}=$name;
19 }
20 }
21 
22# apply default values if needed
23 if ( (!defined $MODARGS{PROTOCOL}) || ( index("tcpicmp",$MODARGS{PROTOCOL}) <0) ) { $MODARGS{PROTOCOL}="icmp"; }
24 
25# check requirements
26#
27 eval { require Net::Ping; };
28 if ($@) {
29 HotSaNICmod::dupe_control("warn",$ARGS{"MODNAME"},"$0: Perlmodule Net::Ping not installed - falling back to system's ping command.");
30 $MODARGS{SYSPING}=1;
31 }
32 return %MODARGS
33 }
34 
351;
36 

Powered by WebSVN 2.2.1