icmppingで値が正常に取得出来ません。

お世話になっております。

シンプルチェックを使ってicmppingから実行結果を
取得しようとした所、値が0のままで正常な値が取得出来ません。

OS  :  CENTOS 5.3
Zabbix:  1.8.1 (ソースからインストール)
fping : fping-2.4-1.b2.2.el5.rf (rpm)

○現象:icmppingの結果が up(0)となり
正常な取得が出来ない。

○原因と思われる箇所
ログレベルを4にして実行すると、fpingで扱えない
オプションのため、エラーになっている箇所があります。

-sオプションが-Sで実行されているのが原因のようです。

念のためですが、fpingの権限については(1.8マニュアルから)
shell> chown root:zabbix /usr/sbin/fping
shell> chmod 775 /usr/sbin/fping (一応775でテスト)
shell> chmod ug+s /usr/sbin/fping

を実行し、現在のステータスは
[root@hostname01p sbin]# ls -al |grep fping
-rwsr-sr-x 1 root zabbix 35320 3月 16 2009 fping

です。
アイテムの状態
△キー :icmpping
△データ型:整数

古いfpingのRPMや、ソースからインストールで対応出来るなら
実施したいと思うのですが、参考にどのバージョンのfpingを
使っているか教えて頂けると幸いです。

以下はログです。

19899:20100413:100428.202 In get_pinger_hosts()
19899:20100413:100428.203 In DCinit_nextchecks()
19899:20100413:100428.203 In DCconfig_get_poller_items() poller_type:3 poller_num:0
19899:20100413:100428.203 End of DCconfig_get_poller_items():1
19899:20100413:100428.203 In substitute_simple_macros (data:'icmpping')
19899:20100413:100428.203 In add_icmpping_item() addr=172.18.90.103 count=3 interval=0 size=0 timeout=0
19899:20100413:100428.203 In DCflush_nextchecks()
19899:20100413:100428.203 End of get_pinger_hosts():1
19899:20100413:100428.203 In process_pinger_hosts()
19899:20100413:100428.203 In add_pinger_host() addr=172.18.90.103
19899:20100413:100428.203 In do_ping(hosts_count:1)
19899:20100413:100428.203 In process_ping() [hosts_count:1]
19899:20100413:100428.203 /tmp/zabbix_server_19899.pinger
19899:20100413:100428.203 172.18.90.103
19899:20100413:100428.203 /usr/sbin/fping -q -C3 -S192.168.3.105 2>&1 </tmp/zabbix_server_19899.pinger
19899:20100413:100428.206 Update IP [/usr/sbin/fping: invalid option -- S]
19899:20100413:100428.206 Update IP []
19899:20100413:100428.206 Update IP [Usage: /usr/sbin/fping [options] [targets...]]
19899:20100413:100428.206 Update IP [ -a show targets that are alive]
19899:20100413:100428.206 Update IP [ -A show targets by address]
19899:20100413:100428.206 Update IP [ -b n amount of ping data to send, in bytes (default 56)]
19899:20100413:100428.206 Update IP [ -B f set exponential backoff factor to f]
19899:20100413:100428.206 Update IP [ -c n count of pings to send to each target (default 3)]
19899:20100413:100428.206 Update IP [ -C n same as -c, report results in verbose format]
19899:20100413:100428.207 Update IP [ -e show elapsed time on return packets]
19899:20100413:100428.207 Update IP [ -f file read list of targets from a file ( - means stdin) (only if no -g specified)]
19899:20100413:100428.207 Update IP [ -g generate target list (only if no -f specified)]
19899:20100413:100428.207 Update IP [ (specify the start and end IP in the target list, or supply a IP netmask)]
19899:20100413:100428.207 Update IP [ (ex. /usr/sbin/fping -g 192.168.1.0 192.168.1.255 or /usr/sbin/fping -g 192.168.1.0/24)]
19899:20100413:100428.207 Update IP [ -i n interval between sending ping packets (in millisec) (default 25)]
19899:20100413:100428.207 Update IP [ -l loop sending pings forever]
19899:20100413:100428.207 Update IP [ -m ping multiple interfaces on target host]
19899:20100413:100428.207 Update IP [ -n show targets by name (-d is equivalent)]
19899:20100413:100428.207 Update IP [ -p n interval between ping packets to one target (in millisec)]
19899:20100413:100428.207 Update IP [ (in looping and counting modes, default 1000)]
19899:20100413:100428.207 Update IP [ -q quiet (don't show per-target/per-ping results)]
19899:20100413:100428.207 Update IP [ -Q n same as -q, but show summary every n seconds]
19899:20100413:100428.207 Update IP [ -r n number of retries (default 3)]
19899:20100413:100428.207 Update IP [ -s print final stats]
19899:20100413:100428.207 Update IP [ -t n individual target initial timeout (in millisec) (default 500)]
19899:20100413:100428.207 Update IP [ -u show targets that are unreachable]
19899:20100413:100428.207 Update IP [ -v show version]
19899:20100413:100428.207 Update IP [ targets list of targets to check (if no -f specified)]
19899:20100413:100428.207 Update IP []
19899:20100413:100428.207 End of process_ping()
19899:20100413:100428.207 End of do_ping():SUCCEED

コメント表示オプション

お好みのコメント表示方法を選び「設定の保存」をクリックすると変更が反映されます。
ユーザー TNK の写真

-Sオプションは、ソース(送信元)のIPアドレスを指定するもののようです。
大元のソースファイルには、そのオプションが無いようですが、Debianでそのようなパッチを作成してリリースしているのを確認しました。
stableだとlennyですが、ソースは以下のURLから落とせるようです。
http://packages.debian.org/lenny/fping

実際に、CentOS上でコンパイルして確認まではできていません。

--- 追記 ---
fping_2.4b2-to-ipv6.orig.tar.gz
fping_2.4b2-to-ipv6-15.diff.gz
の2ファイルを取得して、以下のような手順でfpingのインストールはできました。
-Sオプションも使えるようです。

<code>
# tar zxvf fping_2.4b2-to-ipv6.orig.tar.gz
# gunzip fping_2.4b2-to-ipv6-15.diff.gz
# cd fping-2.4b2_to-ipv6
# patch -p1 < ../fping_2.4b2-to-ipv6-15.diff
# ./configure
# make
# make install
</code>

ユーザー Ozisama の写真

ソースファイルから
頂いた手順でのインストールを実施してみたところ、稼動しました。
-Sオプションも確認しております。

動かなかったらZABBIXのソースのicmpping.cを削ろうかと
思っていたので助かりました。

ありがとうございました。

この後、RPM版も試してみます。
:-D

○○○追記○○○

(元)fping-2.4-1.b2.2.el5.rf.i386.rpm
これにUvhで
fping-2.4b2-7.el5.JP.i386.rpm
をアップデートしてみましたが、-Sオプションは
動作しませんでした。(ivhでも同じ)

やり方が間違っているのでしょうか?

ユーザー kodai の写真

こんにちは。

Ubuntuで確認したのですが、ソースIPを指定する-Sオプションがありますね。TNKさんの通り、どうもDebian独自のパッチが当たってるらしく、ZABBIX-JPで配布しているfpingのパッケージ(ベースはFedoraパッケージ)は上記のパッチは当たっていないので-Sオプションが使えずに問題が発生しているようです。

ただ、ちょっとやっかいなのはfping本家の最新バージョンを確認したところ-Sオプションは別のオプションで使われているようで、今後の互換性を考えるとどう対応するか悩ましいところです。

時間を見つけてZabbix SIAにも報告してみようと思います。

ユーザー kodai の写真

こんにちは。

先ほどZABBIX-JP配布のfpingパッケージをアップデートしました。
http://www.zabbix.jp/modules/news/article.php?storyid=184

こちらをご利用頂ければSourceIPを指定した際にも問題なく監視できることを確認しております。

ユーザー KAZ の写真

Ozisamaさん

ZABBIX-JPのDownloadから下記を取ってきてrpm Uvhで入れてみて下さい。一応、CentOS5.4 + Zabbix1.8.1では動作できてます。

↓ZABBIX-JPのfpingダウンロードURL
[url=http://www.zabbix.jp/binaries/relatedpkgs/rhel5/i386/fping-2.4b2-7.el5.JP.i386.rpm]fping-2.4b2-7.el5.JP.i386.rpm[/url]