//use the ip adresses of these interfaces for crawling $actual_crawl_cycle = Crawling::getActualCrawlCycle()['id']; echo "Crawling routers {$router_offset}-{$router_limit} (offset-limit) with the following options:\n"; echo "\tping_count: {$ping_count}\n"; echo "\tping_timeout: {$ping_timeout}\n"; echo "\tcrawl_timeout: {$crawl_timeout}\n"; echo "\tnetwork_connection_ipv6_interface: {$network_connection_ipv6_interface}\n"; echo "\tinterfaces_used_for_crawling: "; foreach ($interfaces_used_for_crawling as $iface) { echo $iface; } echo "\n"; echo "\tactual_crawl_cycle: " . $actual_crawl_cycle . "\n"; //fetch all routers that need to be crawled by a crawler. Respect offset and limit! $routerlist = new Routerlist(false, false, "crawler", false, false, false, false, false, (int) $router_offset, (int) $router_limit, "router_id", "asc"); foreach ($routerlist->getRouterlist() as $key => $router) { echo $key + 1 . ". crawling Router " . $router->getHostname() . " (" . $router->getRouterId() . ")\n"; foreach ($interfaces_used_for_crawling as $name) { echo "\tFetching IP-Addresses of interface " . $name . "\n"; $networkinterface = new Networkinterface(false, $router->getRouterId(), $name); if ($networkinterface->fetch()) { $iplist = new Iplist($networkinterface->getNetworkinterfaceId()); foreach ($iplist->getIplist() as $ip) { echo "\t\tWorking with " . $ip->getIp() . "\n"; $xml_array = array(); $ping = false; $return = array(); if ($ip->getNetwork()->getIpv() == 6) { $command = "ping6 -c {$ping_count} -w " . ($ping_count + 1) * $ping_timeout . " -W {$ping_timeout} -I {$network_connection_ipv6_interface} " . $ip->getIp(); } elseif ($ip->getNetwork()->getIpv() == 4) { $command = "ping -c {$ping_count} -w " . ($ping_count + 1) * $ping_timeout . " -W {$ping_timeout} " . $ip->getIp();
<?php require_once 'runtime.php'; require_once ROOT_DIR . '/lib/core/Routerlist.class.php'; require_once ROOT_DIR . '/lib/core/crawling.class.php'; $smarty->assign('message', Message::getMessage()); $_GET['crawl_method'] = isset($_GET['crawl_method']) ? $_GET['crawl_method'] : false; $_GET['status'] = isset($_GET['status']) ? $_GET['status'] : false; $_GET['hardware_name'] = isset($_GET['hardware_name']) ? $_GET['hardware_name'] : false; $_GET['firmware_version'] = isset($_GET['firmware_version']) ? $_GET['firmware_version'] : false; $_GET['batman_advanced_version'] = isset($_GET['batman_advanced_version']) ? $_GET['batman_advanced_version'] : false; $_GET['kernel_version'] = isset($_GET['kernel_version']) ? $_GET['kernel_version'] : false; $routerlist = new Routerlist(false, false, $_GET['crawl_method'], $_GET['status'], $_GET['hardware_name'], $_GET['firmware_version'], $_GET['batman_advanced_version'], $_GET['kernel_version'], 0, -1); $smarty->assign('routerlist', $routerlist->getRouterlist()); $smarty->display("header.tpl.html"); $smarty->display("routerlist.tpl.html"); $smarty->display("footer.tpl.html");