In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Background:
To record the previously written shell script, you need to sort out the speed of each network card of each host. The name of the network card is bond0 to bond3. You can use the ethtool bond1 command to check the speed of the corresponding network card. Because there are dozens of hosts, consider using the shell script to query.
Specific ideas:
Query the speed command of single host and single network card:
Ethtool bond1 | grep SpeedSpeed: 20000Mb/s
Query all bond network card rate commands of a single host, and output the network card name and the corresponding network card rate:
For i in {0.3}; do echo bond$i `/ usr/sbin/ethtool bond$i 2 > / dev/null | grep Speed`; donebond0bond1 Speed: 20000Mb/sbond2 Speed: 20000Mb/sbond3 Speed: 2000Mb/s
To query all bond Nic rate commands of a remote host, you can use ssh-tt to remotely execute commands:
Ssh-tt user@192.168.1.1 "command"
All the IP to be queried are in the / etc/hosts file
File format:
192.168.1.1 compute-1
192.168.1.2 compute-2
Filter out the IP of 192 network segments
Cat / etc/hosts | grep 192 | cut-d'-F1
Use expect to enter passwords automatically
Complete script: #! / bin/bashcat / etc/hosts | grep 192 | while read linedoecho $lineip= `echo $line | cut-d''- f1` / usr/bin/expect
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.