Ping script on Linux and Auto-discovery on zabbix3.xx

Source: Internet
Author: User

Sometimes we need to ping some addresses on Linux to determine if the address is occupied

First, write the shell script

The script is as follows:

#!/bin/bashfor i in 192.168.16.     {1..255} do (ping $i-C 2 >/dev/null 2>&1 [$?-eq 0] && echo "$i is Alive" ) &done

The effect is as follows

Second, the use of fping

Fping needs to be installed separately, it can ping a group of addresses,-G to specify a set of addresses, such as

Fping-g 192.168.16.1 192.168.16.200


Represents all the addresses between these two addresses.


-A option indicates that the alive is printed out of the host
[Email protected]:/tmp$fping-a-G 192.168.16.0/24 2>/dev/null
192.168.16.1
192.168.16.2
192.168.16.128
192.168.16.129

-u option to print out the unreachable host
[Email protected]:/tmp$Fping-u-G 192.168.16.0/24 2>/dev/null
192.168.16.3
192.168.16.4
192.168.16.5
...< ...
192.168.16.254

The effect is as follows:

Iii. Use of Nmap

NMAP-SP 192.168.99.0/24

The effect is as follows:

Iv. Automatic discovery using Zabbix

Because the ping host may not be allowed, because there is a terminal server on the firewall on Ping,zabbix can configure the Autodiscover rule, you can find the state of the host through PING,SSH, to determine the host address

Whether it is occupied

The effect is as follows:

Ping script on Linux and Auto-discovery on zabbix3.xx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.