Commit bbea6e54 authored by Clemens John's avatar Clemens John

Move hard coded crawl range to db config

Signed-off-by: Clemens John's avatarClemens John <clemens.john@floh1111.de>
parent 8101f3f9
......@@ -56,6 +56,7 @@ if(Permission::checkPermission(PERM_ROOT)) {
$smarty->assign('hours_to_keep_history_table', ConfigLine::configByName('hours_to_keep_history_table'));
$smarty->assign('crawl_cycle_length_in_minutes', ConfigLine::configByName('crawl_cycle_length_in_minutes'));
$smarty->assign('crawl_interfaces', ConfigLine::configByName('crawl_interfaces'));
$smarty->assign('crawl_range', ConfigLine::configByName('crawl_range'));
$smarty->assign('router_status_interface_whitelist', ConfigLine::configByName('router_status_interface_whitelist'));
......@@ -81,6 +82,7 @@ if(Permission::checkPermission(PERM_ROOT)) {
Config::writeConfigLine('hours_to_keep_history_table', $_POST['hours_to_keep_history_table']);
Config::writeConfigLine('crawl_cycle_length_in_minutes', $_POST['crawl_cycle_length_in_minutes']);
Config::writeConfigLine('crawl_interfaces', $_POST['crawl_interfaces']);
Config::writeConfigLine('crawl_range', $_POST['crawl_range']);
Config::writeConfigLine('router_status_interface_whitelist', $_POST['router_status_interface_whitelist']);
$message[] = array('Die Daten wurden gespeichert.', 1);
......
......@@ -137,7 +137,7 @@
mkdir(ROOT_DIR."/logs/");
}
$range=15;
$range = ConfigLine::configByName("crawl_range"));
$routers_count = Router_old::countRouters();
for ($i=0; $i<=$routers_count; $i+=$range) {
//start an independet crawl process for each $range routers to crawl routers simultaniously
......
......@@ -43,7 +43,7 @@
echo " ping_timeout: $ping_timeout\n";
echo " crawl_timeout: $crawl_timeout\n";
echo " network_connection_ipv6_interface: $network_connection_ipv6_interface\n";
echo " interfaces_used_for_crawling: "; foreach($crawl_interfaces as $iface) echo $iface." "; echo "\n";
echo " crawl_interfaces: "; foreach($crawl_interfaces as $iface) echo $iface." "; echo "\n";
echo " actual_crawl_cycle: ".$actual_crawl_cycle."\n";
//fetch all routers that need to be crawled by a crawler. Respect offset and limit!
......
......@@ -7,8 +7,9 @@
<p>Stunden nach denen Crawl Daten gelöscht werden sollen:<br><input name="hours_to_keep_mysql_crawl_data" type="text" size="30" value="{$hours_to_keep_mysql_crawl_data}"></p>
<p>Stunden nach denen die History gelöscht werden soll:<br><input name="hours_to_keep_history_table" type="text" size="30" value="{$hours_to_keep_history_table}"></p>
<p>Länge eines Crawl Zyklus in Minuten:<br><input name="crawl_cycle_length_in_minutes" type="text" size="30" value="{$crawl_cycle_length_in_minutes}"></p>
<p>Crawl Interfaces:<br><input name="crawl_interfaces" type="text" size="30" value="{$crawl_interfaces}"></p>
<p>Router Status Interface Whitelist:<br><input name="router_status_interface_whitelist" type="text" size="30" value="{$router_status_interface_whitelist}"></p>
<p>Interfaces die gecrawled werden:<br><input name="crawl_interfaces" type="text" size="30" value="{$crawl_interfaces}"></p>
<p>Anzahl Router je Crawl-Prozess:<br><input name="crawl_range" type="text" size="30" value="{$crawl_range}"></p>
<p>Routerstatus Interface Whitelist:<br><input name="router_status_interface_whitelist" type="text" size="30" value="{$router_status_interface_whitelist}"></p>
<p><input type="submit" value="Absenden"></p>
</form>
\ No newline at end of file
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