Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Linux / Zabbix – Simple ICMP Ping Checks

February 3, 2021 CentOSLinuxUbuntuWindows Server 2016

Zabbix – Simple ICMP Ping Checks

In this article we’ll show how to configure ICMP-based network device monitoring using ping in Zabbix. It is the easiest and the most popular task of agentless monitoring, when you want to check the availability of a remote server, website or network device from your monitoring server. Zabbix can send ICMP requests to the host, and if no answer is received, the response time is too long or a large percentage of packets are lost, it displays a warning on the dashboard. The ICMP protocol is mostly used to check the availability of network hosts. Ping and traceroute/tracert tools also work over ICMP protocol.

First of all, you must configure a firewall on the hosts you are going to monitor (allow icmp ping requests) and make sure that fping is installed and configured on your Zabbix server.

How to Open Ports for ICMP Ping on Windows Server and Linux?

By default, ICMP ping is allowed on Windows Server, but if is has been disabled on any reason, you can enable it using netsh or PowerShell. Run the command prompt as administrator and enter the following:

netsh advfirewall firewall add rule name="ICMP Allow“ protocol=icmpv4:8,any dir=in action=allow

Here is the same PowerShell command (built-in NetSecurity module is used):

Set-NetFirewallRule -Name FPS-ICMP-ERQ-In -Enabled True -Profile Any -Action Allow

The commands will create a firewall rule allowing inbound ICMP echo requests.

Inbound ICMP traffic is also allowed in modern Linux distros. If it is disabled on any reason, add these rules to iptables. Run the following commands under root/sudo:

# iptables -I INPUT -p icmp --icmp-type echo-request -j ACCEPT
# iptables -I OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT

Thus, you will add the rules allowing ICMP requests to the beginning of the iptables rule chain.

If you use firewalld to manage firewall rules, you can allow ICMP ping reply as follows:

# firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p icmp -s 0.0.0.0/0 -d 0.0.0.0/0 -j ACCEPT

How to Install Fping & Set Paths in Zabbix?

Fping is used in Zabbix to perform ICMP checks. In most Linux distros, the utility is preinstalled, so make sure that it exists in the operating system first. Go to your Zabbix server and run this command:

fping -v

If there is no such tool, install it using a package manager:

  • In Ubuntu: apt install fping
  • In CentOS, you will have to connect EPEL repository first and then install the tool: yum install fping

By default, the tool is installed in /usr/bin/fping. If there are any problems with fping, make sure that it is located in /usr/bin/fping. If it is in another directory, change the following lines in zabbix_server.conf by specifying the correct path to fping.

FpingLocation=/usr/bin/fping
Fping6Location=/usr/bin/fping6

ICMP Ping Template in Zabbix

By default, there is the Template Module ICMP Ping in Zabbix. (It may have a different name depending on a Zabbix version.) We will use it to monitor network hosts using ICMP ping. The template includes 3 checks:

  • ICMP ping – node availability over ICMP;
  • ICMP loss – percentage of lost packets;
  • ICMP response time – ICMP ping response time in milliseconds.

icmp checks in zabbix

Look at the Key column: icmpping, icmppngloss and icmppingse, these are built-in keys in Zabbix. They are Simple checks, it means that the Zabbix Agent is not used to perform them.

View the full list of Simple checks that don’t require Zabbix Agent installation: https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/simple_checks

The template contains 3 triggers that track the keys described above and their values.

zabix icmp triggers with severity

Some triggers, like High ICMP ping response time, use the template macros. You can change macro values in the Macros tab.

The values that will activate a trigger:

  • The package loss percentage of ICMP Ping Loss ($ICMP_LOSS_WARN) for the last 5 minutes is more than 20.
  • The Response Time value ($ICMP_RESPONSE_TIME_WARN) is over 150 milliseconds for the last 5 minutes.

template icmp ping macros on zabbix

Create Host in Zabbix and Connect the ICMP Ping Template

In this article I will configure monitoring of a host running Windows Server. Let’s add this host to zabbix. Go to Configuration -> Hosts -> Create Host.

Enter a host name, select a group and enter an IP address of your host in Agent interfaces.

adding new agentless host to zabbix

Note. Zabbix groups help to sort hosts. A group name does not affect monitoring.

Open the Templates tab, click Select and choose Template Module ICMP Ping.

link a template module icmp ping to zabbix host

Click Add in the template selection form and Add to finish host creation.

zabbix link new templates

All templates connected to the host are displayed in the Templates column.

zabbix host with linked templates

Then check how the monitoring works. Go to Monitoring -> Latest data, click Select next to Hosts and select the host you have just created.

The latest data received from the host are displayed in the Last Value column.

Also, you can view a graph for a specific value, like the ICMP Response time. Click Graph.

zabbix icmp availability graph

In case of any problems, you will see a notification on Zabbix dashboard.

zabbix ismp alert on dashboard

ICMP ping is the easiest basic check of your network device availability. If you want to get more data about your device, you can configure device monitoring using Zabbix Agent, SNMP or other protocols.

0 comment
1
Facebook Twitter Google + Pinterest
previous post
Using TSADMIN.msc and TSCONFIG.msc Snap-Ins on Windows Server 2016 RDS Host
next post
How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

Related Reading

How to Sign a PowerShell Script (PS1) with...

February 25, 2021

How to Shadow (Remote Control) a User’s RDP...

February 22, 2021

Configuring PowerShell Script Execution Policy

February 18, 2021

Configuring Proxy Settings on Windows Using Group Policy...

February 17, 2021

Updating Group Policy Settings on Windows Domain Computers

February 16, 2021

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • How to Sign a PowerShell Script (PS1) with a Code Signing Certificate?

    February 25, 2021
  • Change the Default Port Number (TCP/1433) for a MS SQL Server Instance

    February 24, 2021
  • How to Shadow (Remote Control) a User’s RDP session on RDS Windows Server 2016/2019?

    February 22, 2021
  • Configuring PowerShell Script Execution Policy

    February 18, 2021
  • Configuring Proxy Settings on Windows Using Group Policy Preferences

    February 17, 2021
  • Updating Group Policy Settings on Windows Domain Computers

    February 16, 2021
  • Managing Administrative Shares (Admin$, IPC$, C$, D$) in Windows 10

    February 11, 2021
  • Packet Monitor (PktMon) – Built-in Packet Sniffer in Windows 10

    February 10, 2021
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10

    February 5, 2021
  • How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

    February 4, 2021

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Configure MariaDB Master-Master/Slave Replication?
  • Using iPerf to Test Network Speed and Bandwidth (Throughput)
  • How to Mount Google Drive or OneDrive in Linux?
  • Hyper-V Boot Error: The Image’s Hash and Certificate Are not Allowed
  • Adding VLAN Interface in CentOS/Fedora/RHEL
  • Configuring High Performance NGINX and PHP-FPM Web Server
  • KVM: How to Expand or Shrink a Virtual Machine Disk Size?
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top