Commit 2f5ccfca authored by ueli heuer's avatar ueli heuer 👾
Browse files

Remove Probe ping_*; the newer prob ping46_… is working better!

parent 3d127868
#!/usr/bin/perl -w
#
# Copyright (c) 2004 ... 2013 Ueli Heuer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# $Id$
use Net::Ping;
use Time::HiRes;
use strict;
use vars qw( $ping_name_mod );
my $pingname_timeout = 1; # sollte nicht <= MAX value sein
my $pingname_count = 5;
my $pingname_delay = 0;
sub ping_name ($$$$) {
my ($host,$timeout_,$count_,$delay_,$dummy) = @_;
my ($timeout,$count,$delay,$avgtime,$min,$max,$loss,$p,$ret,$duration,$ip,$n,$time,$i);
if ($timeout_ > 0 ) { $timeout = $timeout_; } else { $timeout = $pingname_timeout; }
if ($count_ > 0 ) { $count = $count_; } else { $count = $pingname_count; }
if ($delay_ > 0 ) { $delay = $delay_; } else { $delay = $pingname_delay; }
$loss = 1; # 100%
$p = Net::Ping->new("icmp",$timeout,'32');
$p->source_verify(0);
$p->hires(1);
$avgtime = $time = $min = $max = $n = 0;
# just ping to see if host is 'alive';
($ret, $duration, $ip) = $p->ping($host, 2*$timeout);
if ($ret) {
# if ( $duration > $timeout ) { $timeout = 2*$timeout; }
for ( $i=0;$i<$count;$i++ ) {
if ($delay) { sleep($delay); }
($ret, $duration,$ip) = $p->ping($ip, $timeout);
if ($ret) {
$n++;
$time += $duration;
$max = $duration > $max ? $duration : $max;
if ($min > 0 ) {
$min = $duration < $min ? $duration : $min;
} else {
$min = $duration;
}
}
}
if ( $n > 0 ) {
$avgtime = $time / $n;
}
$loss = 1 - $n/$count;
}
$p->close();
if ($avgtime == 0 ) { $avgtime = 'U'; }
if ($max == 0 ) { $max = 'U'; }
if ($min == 0 ) { $min = 'U'; }
return ($avgtime,$loss,$max,$min);
}
$ping_name_mod = 1;
This diff is collapsed.
-- MySQL dump 10.17 Distrib 10.3.18-MariaDB, for debian-linux-gnu (x86_64)
-- MySQL dump 10.17 Distrib 10.3.20-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: murray Database: dvg_maillink
-- ------------------------------------------------------
......@@ -147,7 +147,7 @@ CREATE TABLE `dvg_device` (
KEY `activ` (`activ`),
KEY `probe_id` (`probe_id`),
KEY `host_id` (`host_id`)
) ENGINE=MyISAM AUTO_INCREMENT=18694 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=18695 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -173,7 +173,7 @@ CREATE TABLE `dvg_device_link` (
KEY `device_index` (`device_id`),
KEY `start_time` (`start_time`),
KEY `stop_time` (`stop_time`)
) ENGINE=MyISAM AUTO_INCREMENT=7058 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='connects a link to a device';
) ENGINE=MyISAM AUTO_INCREMENT=7065 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='connects a link to a device';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -194,7 +194,7 @@ CREATE TABLE `dvg_device_param` (
PRIMARY KEY (`id`),
KEY `device_id` (`device_id`),
KEY `oid_param_id` (`oid_param_id`)
) ENGINE=MyISAM AUTO_INCREMENT=103489 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=103773 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -230,14 +230,14 @@ CREATE TABLE `dvg_device_traffic` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dev_id` int(11) NOT NULL DEFAULT 0,
`module_id` int(10) unsigned NOT NULL DEFAULT 7,
`time` int(11) DEFAULT NULL,
`time` int(11) NOT NULL DEFAULT 0,
`in_octets` bigint(20) unsigned NOT NULL DEFAULT 0,
`out_octets` bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `dev_id` (`dev_id`),
KEY `time` (`time`),
KEY `module_id` (`module_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2466494 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=57077 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -277,7 +277,7 @@ CREATE TABLE `dvg_device_traffic_month` (
KEY `startdate` (`startdate`),
KEY `stopdate` (`stopdate`),
KEY `link_id` (`link_id`)
) ENGINE=MyISAM AUTO_INCREMENT=330292 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci PACK_KEYS=1 COMMENT='traffic summary per month';
) ENGINE=MyISAM AUTO_INCREMENT=330617 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci PACK_KEYS=1 COMMENT='traffic summary per month';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -291,14 +291,14 @@ CREATE TABLE `dvg_device_traffic_old` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dev_id` int(11) NOT NULL DEFAULT 0,
`module_id` int(10) unsigned NOT NULL DEFAULT 7,
`time` int(11) NOT NULL DEFAULT 0,
`time` int(11) DEFAULT NULL,
`in_octets` bigint(20) unsigned NOT NULL DEFAULT 0,
`out_octets` bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `dev_id` (`dev_id`),
KEY `time` (`time`),
KEY `module_id` (`module_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2733334 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=3086458 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -318,7 +318,7 @@ CREATE TABLE `dvg_device_value` (
`time` int(11) unsigned NOT NULL DEFAULT 0,
UNIQUE KEY `id` (`id`),
KEY `device_arg_index` (`device_id`,`arg_id`)
) ENGINE=MyISAM AUTO_INCREMENT=122599 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=122603 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -573,7 +573,7 @@ CREATE TABLE `dvg_hardware` (
KEY `start_date` (`start_date`),
KEY `stop_date` (`stop_date`),
KEY `eos_date` (`eos_date`,`eol_date`)
) ENGINE=MyISAM AUTO_INCREMENT=111 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=113 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -733,11 +733,12 @@ CREATE TABLE `dvg_host_interface` (
`macaddr` tinytext COLLATE utf8_unicode_ci DEFAULT NULL,
`last_check` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `host_id_interface_id` (`interface_id`,`host_id`),
KEY `interface_id` (`interface_id`),
KEY `interface` (`if_name`),
KEY `host_id` (`host_id`),
KEY `device_id` (`device_id`)
) ENGINE=MyISAM AUTO_INCREMENT=420 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Interface-Names, -Ids of the Hosts';
) ENGINE=MyISAM AUTO_INCREMENT=425 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Interface-Names, -Ids of the Hosts';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -950,7 +951,7 @@ CREATE TABLE `dvg_link` (
KEY `name` (`name`),
KEY `allow_access` (`allow_access`),
KEY `radius_id` (`radius_id`)
) ENGINE=MyISAM AUTO_INCREMENT=5756 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='User Link';
) ENGINE=MyISAM AUTO_INCREMENT=5759 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='User Link';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -1421,7 +1422,7 @@ CREATE TABLE `dvg_sysObjectID` (
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sysObjectID` (`sysObjectID`)
) ENGINE=MyISAM AUTO_INCREMENT=1482 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='sysObjectID of the vendors';
) ENGINE=MyISAM AUTO_INCREMENT=1483 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='sysObjectID of the vendors';
/*!40101 SET character_set_client = @saved_cs_client */;
--
......@@ -1511,4 +1512,4 @@ CREATE TABLE `dvg_vrf` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-12-27 20:55:12
-- Dump completed on 2020-01-01 13:39:00
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment