我有一個腳本,我用它來爲icinga2構建一個配置。網絡很大,多/ 13的大。當我運行腳本時,我一直在使RTTVAR增長到超過2.3秒,減少到2.0錯誤。我試過提高我的gc_thresh並打破子網。我通過谷歌的小信息潛水,似乎無法找到解決辦法。如果有人有任何想法,我會很感激。我在Ubuntu 16.04Nmap - RTTVAR已經增長到超過2.3秒,減少到2.0
我的腳本:
# 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
我的/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
net.ipv4.neigh.default.gc_thresh2 = 4096
net.ipv4.neigh.default.gc_thresh1 = 2048
編輯:添加主機超時5 -n
不知道...也許你可以把某種nmap參數設置爲提高性能......也許--host-timeout或-max-retries可以幫助你。 – OscarAkaElvis
我現在就試試吧! – cflinspach
關於您放置的nmap參數... -n可以避免DNS解析...但是如果您不需要將-sn放入-n我認爲它不起作用... – OscarAkaElvis