こんにちは、SCSK株式会社の小寺崇仁です。
先日Zabbixの7.4がリリースされました。今回はicmppingretryについて検証したいと思います。
7.4の新機能につきましては、公式HPに記載がございます。

icmppingretryとは
公式HPでは以下の記載があります。
英語:A new icmppingretry simple check has been added to monitor host responses to ICMP ping with the ability to modify retries
翻訳:ICMP pingに対するホストの応答を監視し、再試行回数を変更するための新しいicmppingretryシンプルチェックが追加されました。
Ping監視で1回失敗した場合、間隔を狭くしてリトライする事ができるようです。
他の有償製品ではリトライをすることができるようで、問い合わせを多く頂いておりました機能になります。
アイテム作成
icmppingretryはアイテムキーのため、通常のPing監視で利用するicmppingとは別アイテムにする必要があります。
今までのicmppingキーにはない「retries」「backoff」が新しく設定できるようになっております。
逆に「interval」「packets」がなくなっております。細かいPingのオプションは指定できないようですね。
「reties」が再試行回数となっており、「backoff」で再試行間隔の係数を指定できるようです。
icmppingretry[<target>,<retries>,<backoff>,<size>,<timeout>,<options>]
The host accessibility by ICMP ping with retries.
Return value: 0 – ICMP ping fails; 1 – ICMP ping successful.Parameters:
- target – the host IP or DNS name;
- retries – the number of times an attempt at pinging a target will be made, not including the first try (0 or greater; default 1);
- backoff – the number by which the wait time is multiplied on each successive request (1.0-5.0 range; default 1.0);
- size – the packet size in bytes;
- timeout – the timeout in milliseconds;
- options – used for allowing redirect: if empty (default value), redirected responses are treated as target host down; if set to allow_redirect, redirected responses are treated as target host up.
今回は検証用にicmppingretryとicmppingのアイテムを作成して比較しようと思います。
名前 | Ping監視(icmpping) | Ping監視(icmppingretry) |
---|---|---|
タイプ | シンプルチェック | シンプルチェック |
アイテムキー | icmpping[,3,2000,64,3000] |
icmppingretry[,3,3,256,500]
|
監視間隔 | 60s | 60s |
icmpping[,3,2000,64,3000]の動作について
まずは、以前からあるicmmpingキーについて動作を確認していきます。
正常時
1回の監視で2秒間隔で3回パケットを送信します。1分間隔で繰り返します。
20:54:23.056236 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3048, seq 0, length 72 20:54:25.056876 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3048, seq 1, length 72 20:54:27.058276 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3048, seq 2, length 72 20:55:23.068729 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3055, seq 0, length 72 20:55:25.070759 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3055, seq 1, length 72 20:55:27.070773 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3055, seq 2, length 72
異常時
監視対象(192.168.1.1)をダウンさせてみます。
Zabbixから送信するパケットは正常時と変わらないことを確認します。
21:00:23.131611 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3112, seq 0, length 72 21:00:25.133447 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3112, seq 1, length 72 21:00:27.131777 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3112, seq 2, length 72 21:01:23.142971 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3134, seq 0, length 72 21:01:25.143041 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3134, seq 1, length 72 21:01:27.143408 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3134, seq 2, length 72
icmppingretry[,3,3,256,500]の動作について
次に新機能のicmppingretryについて確認いたします。
オプションは再試行回数3回、再試行間隔の係数は3、タイムアウト0.5秒になります。
正常時
1回の監視で1回だけICMPパケットを送信します。1分間隔で繰り返します。
icmppingキーでは細かく、回数や間隔を指定できていましたが、正常時は1回になるようです。
21:04:23.175696 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3166, seq 0, length 72 21:05:23.185637 IP ip-192-168-1-1.ap-northeast-1.compute.internal > ip-192-168-1-1.ap-northeast-1.compute.internal: ICMP echo request, id 3174, seq 0, length 72
異常時
監視対象をダウンさせてみると以下のパケットになります。
20:30:40.044485 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-10-0-2-194.ap-northeast-1.compute.internal: ICMP echo request, id 2428, seq 0, length 264 20:30:40.545097 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-10-0-2-194.ap-northeast-1.compute.internal: ICMP echo request, id 2428, seq 1, length 264 20:30:42.046686 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-10-0-2-194.ap-northeast-1.compute.internal: ICMP echo request, id 2428, seq 2, length 264 20:30:46.547698 IP ip-10-0-2-117.ap-northeast-1.compute.internal > ip-10-0-2-194.ap-northeast-1.compute.internal: ICMP echo request, id 2428, seq 3, length 264
再試行回数:3回
通常監視が「20:30:40.044485」に行われ、その後3回、「20:30:40.545097」「20:30:42.046686」「20:30:46.547698」と再試行を行っています。再試行の際は、idが同じ「2428」でseqが連番となっています。
再試行間隔の係数:3
再試行の間隔は以下の通りになります。
再試行1回目:0.5秒(20:30:40.0 – 20:30:40.5)
再試行2回目:1.5秒(20:30:40.5 – 20:30:42.0)
再試行3回目:4.5秒(20:30:42.0 – 20:30:46.5)
再試行の回数が増えるごとに、間隔が長くなっていることがわかるかと思います。
再試行1回目の0.5秒は、icmppingretryキーの引数で指定したタイムアウトの0.5秒になります。
再試行2回目の1.5秒は、1回目の間隔(0.5)×再試行間隔の係数(3)の1.5秒になります。
再試行3回目の4.5秒は、2回目の間隔(1.5)×再試行間隔の係数(3)の4.5秒になります。
まとめ
icmppingretryを使用することで、Ping疎通がNGの場合のみ、再試行することがZabbixでも実現できました。
ZabbixのPing監視の幅が広がったかと思います。 Zabbix is great!
※検証結果が間違っておりましたら、お知らせください
SCSK Plus サポート for Zabbix
★YouTubeに、SCSK Zabbixチャンネルを開設しました!★
★X(旧Twitter)に、SCSK Zabbixアカウントを開設しました!★