package HotSaNICmod::common; sub version { ($VERSION = '$Revision: 1.3 $') =~ s/.*(\d+\.\d+).*/$1/; return "common.pm $VERSION"; } sub configure { my $num=0; foreach (@_) { ($var,$value)=HotSaNICparser::parse_line($_); if ($var eq "PARALLEL") { $MODARGS{PARALLEL}=$value; } if ($var eq "INTERVAL") { $MODARGS{INTERVAL}=$value; } if ($var eq "SYSPING") { $MODARGS{SYSPING}=$value; } if ($var eq "PROTOCOL") { $MODARGS{PROTOCOL}=$value; } if ($var eq "HOST") { my ($ip,$name)=split(/,/,$value); $MODARGS{"HOST:$ip"}=$name; } } # apply default values if needed if ( (!defined $MODARGS{PROTOCOL}) || ( index("tcpicmp",$MODARGS{PROTOCOL}) <0) ) { $MODARGS{PROTOCOL}="icmp"; } # check requirements # eval { require Net::Ping; }; if ($@) { HotSaNICmod::dupe_control("warn",$ARGS{"MODNAME"},"$0: Perlmodule Net::Ping not installed - falling back to system's ping command."); $MODARGS{SYSPING}=1; } return %MODARGS } 1;
hotsanic |
Subversion Repositories: |
Line No. | Rev | Author | Line |
---|