Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

May 10, 2023 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 Increase Size of Disk Partition in...

October 5, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

Redirect HTTP to HTTPS in IIS (Windows Server)

September 7, 2023

Add an Additional Domain Controller to an Existing...

September 6, 2023

How to Install an SSL Certificate on IIS...

September 5, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Configure MariaDB Master-Master/Slave Replication?
  • How to Mount Google Drive or OneDrive in Linux?
  • KVM: How to Expand or Shrink a Virtual Machine Disk Size?
  • Adding VLAN Interface in CentOS/Fedora/RHEL
  • Install and Configure SNMP on RHEL/CentOS/Fedor
  • Configuring High Performance NGINX and PHP-FPM Web Server
  • Installing PowerShell Core on Linux Distros
Footer Logo

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


Back To Top