我有一个脚本,用于构建 icinga2 的配置。网络很大,多个/13就很大。当我运行脚本时,我不断收到 RTTVAR 已增长到超过 2.3 秒,减少到 2.0 错误。我尝试提高 gc_thresh 并分解子网。我已经浏览了谷歌的一些信息,但似乎找不到解决办法。如果有人有任何想法,我将非常感激。我使用的是 Ubuntu 16.04
我的脚本:
# Find devices and create IP list
i=72
while [ $i -lt 255 ]
do
echo "$(date) - Scanning xx.$i.0.0/16" >> files/scan.log
nmap -sn --host-timeout 5 xx.$i.0.0/16 -oG - | awk '/Up$/{print $2}' >> files/ip-list
let i=i+1
done
Run Code Online (Sandbox Code Playgroud)
我的/etc/sysctl.conf
# Force gc to clean-up quickly
net.ipv4.neigh.default.gc_interval = 3600
# Set ARP cache entry timeout
net.ipv4.neigh.default.gc_stale_time = 3600
# Setup DNS threshold for arp
net.ipv4.neigh.default.gc_thresh3 = 8192 …Run Code Online (Sandbox Code Playgroud) 我有两个数组:
my @name = (bob, bob, dave, john, john, mary, mary, mary);
my @cost = (5, 7, 4, 4, 4, 6, 3 , 4);
Run Code Online (Sandbox Code Playgroud)
我想将它们映射在一起,所以输出就是:
bob 12
dave 4
john 8
mary 13
Run Code Online (Sandbox Code Playgroud)
数组的变化虽然所以我不能使用引用.我如何组@cost通过@name,并添加值@cost?