2010-10-21 Junichi Satoh <junichi@rworks.jp>
* lib/PandoraFMS/NetworkServer.pm: Deleted FreeBSD specific SNMPGET definition. It is the same as Linux. * lib/PandoraFMS/Tools.pm: Added FreeBSD specific Ping function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3438 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d1cd0d4e09
commit
703c0d01f4
|
@ -1,3 +1,10 @@
|
|||
2010-10-21 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* lib/PandoraFMS/NetworkServer.pm: Deleted FreeBSD specific SNMPGET
|
||||
definition. It is the same as Linux.
|
||||
|
||||
* lib/PandoraFMS/Tools.pm: Added FreeBSD specific Ping function.
|
||||
|
||||
2010-10-20 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/ReconServer.pm: Pass the recon task group_id and
|
||||
|
|
|
@ -274,12 +274,7 @@ sub pandora_snmp_get_command ($$$$$$$$$) {
|
|||
$output = "";
|
||||
}
|
||||
|
||||
# Need to implement
|
||||
elsif ($OSNAME eq "freebsd"){
|
||||
$output = "";
|
||||
}
|
||||
|
||||
# by default LINUX calls
|
||||
# by default LINUX/FreeBSD calls
|
||||
else {
|
||||
if ($snmp_version ne "3"){
|
||||
$output = `$snmpget_cmd -v $snmp_version -r $snmp_retries -t $snmp_timeout -OUevqt -c '$snmp_community' $snmp_target $snmp_oid 2>/dev/null`;
|
||||
|
|
|
@ -586,9 +586,16 @@ sub pandora_ping ($$) {
|
|||
$output = "";
|
||||
}
|
||||
|
||||
# Need to implement
|
||||
elsif ($OSNAME eq "freebsd"){
|
||||
$output = "";
|
||||
my $ping_command = "ping";
|
||||
|
||||
if ($host =~ /\d+:|:\d+/ ) {
|
||||
$ping_command = "ping6";
|
||||
}
|
||||
|
||||
# Ping the host
|
||||
`$ping_command -q -i $pa_config->{'networktimeout'} -n -c $pa_config->{'icmp_checks'} $host >/dev/null 2>&1`;
|
||||
return ($? == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
# by default LINUX calls
|
||||
|
@ -650,9 +657,23 @@ sub pandora_ping_latency ($$) {
|
|||
$output = "";
|
||||
}
|
||||
|
||||
# Need to implement
|
||||
elsif ($OSNAME eq "freebsd"){
|
||||
$output = "";
|
||||
my $ping_command = "ping";
|
||||
|
||||
if ($host =~ /\d+:|:\d+/ ) {
|
||||
$ping_command = "ping6";
|
||||
}
|
||||
|
||||
# Ping the host
|
||||
my @output = `$ping_command -q -i $pa_config->{'networktimeout'} -n -c $pa_config->{'icmp_checks'} $host 2>/dev/null`;
|
||||
|
||||
# Something went wrong
|
||||
return 0 if ($? != 0);
|
||||
|
||||
# Parse the output
|
||||
my $stats = pop (@output);
|
||||
return 0 unless ($stats =~ m/([\d\.]+)\/([\d\.]+)\/([\d\.]+)\/([\d\.]+) +ms/);
|
||||
return $2;
|
||||
}
|
||||
|
||||
# by default LINUX calls
|
||||
|
|
Loading…
Reference in New Issue