トップ 一覧 検索 ヘルプ RSS ログイン

zabbixの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
*zabbix 導入
*zabbix インストール記録1
*zabbix インストール記録2
*zabbix バージョンアップ1
*zabbix 旧情報

!!!サイト
!http://www.zabbix.com/ 本家
!http://www.zabbix.jp/

!!!記事
!!統合監視ツールZABBIX事始め 
*著者:ZABBIX-JP  寺島 広大
!第5回:ZABBIXの便利な付加機能とアラートメールの日本語化
*http://www.thinkit.co.jp/free/article/0611/19/5/

!ZABBIX-JPのyumリポジトリ利用方法
*http://www.zabbix.jp/modules/bwiki/index.php?ZABBIX-JP%A4%CEyum%A5%EA%A5%DD%A5%B8%A5%C8%A5%EA%CD%F8%CD%D1%CA%FD%CB%A1

*Red Hat Enterprise Linux 4/ CentOS 4
 # rpm -ivh http://www.zabbix.jp/binaries/relatedpkgs/rhel4/i386/zabbix-jp-release-4-5.noarch.rpm

*Red Hat Enterprise Linux 5 / CentOS 5
 # rpm -ivh http://www.zabbix.jp/binaries/relatedpkgs/rhel5/i386/zabbix-jp-release-5-5.noarch.rpm

*Red Hat Enterprise Linux 6 / CentOS 6
 # rpm -ivh http://www.zabbix.jp/binaries/relatedpkgs/rhel6/i386/zabbix-jp-release-6-5.noarch.rpm
**直接 rpm で http:// を指定すると、以下のエラー。なんで?
 curl: (22) The requested URL returned error: 404 
**wget して rpm でインストール

*yum レポジトリ情報をインストール後
 yum search zabbix

!agentd と agent との違い
*What's the difference between 'zabbix agent' and 'zabbix agent (active)'?
*http://www.zabbix.com/forum/archive/index.php/t-1068.html
*agentd : regular check (通常チェック)
**zabbix-server からの要求を受け付けて処理する
*agent : active check (自発チェック)
**agent が zabbix-server に接続し、情報収集が必要な項目リストを取得
**定期的に zabbix-server にデータを送信する
**zabbix-server側から起動する処理がない
**zabbix-server側での処理が軽減され、1.5倍から2倍 処理能力が上がる

!ネットワークトラフィックの値が取れません。/ ZABBIX-JP
*http://www.zabbix.jp/modules/newbb/viewtopic.php?topic_id=1030&forum=6
""Windowsは画面上に表示されている設定名と、内部で持っているパフォーマンスカウンタのパス文字列が異なるということがあります
 typeperf -qx



!Database growth after 2.2.1 Update / ZABBIX Forums
*https://www.zabbix.com/forum/showthread.php?t=43771&highlight=housekeeper
*jhenry
""Have you looked at the new housekeeper settings in 2.2? It's not controlled by the server config file anymore. Go to Administration -> General and then change the dropdown at top right to Housekeeping. You'll probably find that housekeeping is disabled or running less frequently than before and that's why the DB is growing.

*和訳
""2.2 の新しいHouseKeeper設定は確認しましたか?
""サーバ設定ファイルでは設定できなくなりました。
""管理->一般設定を出して右上のドロップダウンメニューから「データの保存期間」に変更します。
""データの削除設定は停止になっているか、間隔が長くなっているのでデータベースのファイルが肥大してるのでしょう。

!!!メモ
!zabbix_agentd が起動しない
 Can't allocate shared memory for collector. [Cannot allocate memory]
*共有メモリが足りない
*再起動しない場合
 # sysctl -w kern.ipc.shmall=32768
 # sysctl -w kern.ipc.shmmax=134217728
 # sysctl -w kern.ipc.semmap=256
*その他 FreeBSD のメモを参照

!Red Hat rpm レポジトリ
*http://cvs.fedora.redhat.com/cgi-bin/viewcvs.cgi/rpms/zabbix/?root=extras&sortby=rev#dirlist
!ポート番号
*zabbix-agent LISTENポート: 10050
*zabbix-server LISTENポート: 10051

!mysql 最適化
*7ヵ月運用
*MySQL / InnoDB
*history 最適化 '''10時間!!!'''
 mysql> optimize table history;
 +----------------+----------+----------+----------+
 | Table          | Op       | Msg_type | Msg_text |
 +----------------+----------+----------+----------+
 | zabbix.history | optimize | status   | OK       |
 +----------------+----------+----------+----------+
 1 row in set (9 hours 48 min 17.82 sec)
*history_uint 最適化
 mysql> optimize table history_uint;
 +---------------------+----------+----------+----------+
 | Table               | Op       | Msg_type | Msg_text |
 +---------------------+----------+----------+----------+
 | zabbix.history_uint | optimize | status   | OK       |
 +---------------------+----------+----------+----------+
 1 row in set (55 min 20.94 sec)
*analyze は秒単位で終了

!Windows に zabbix_agent をサービス登録
*zabbix_agentd.exe を準備、Win32 と x64 用がある
*C:\Program Files\zabbix\zabbix_agentd.exe にコピー
*zabbix_agentd.conf を準備
*C:\zabbix_agentd.conf にコピー
**conf を他のディレクトリに配置しても、サービス起動時に警告が出てダメだった。
*サービス登録
 zabbix_agentd.exe -i -c "C:\zabbix_agentd.conf"
*サービスの管理画面から ZABBIX Agent を起動
!!!日本語対応
*1.1 で日本語対応した。
*1.4 では一部が日本語表示されている。
*機能追加や変更に対する和訳がそろっていない。
!JavaScript での popup_menu での文字化け (1.4.2)
*http://www.zabbix.com/forum/showthread.php?t=8049
*zabbix 文字化け調査
!マップ表示での文字化け (1.4.2)
*php-gd の ImageString を利用しているため、ASCIIしか表示できない。
*ImageTTFText?? を使用すると文字化けを解消できた。
!メールでの文字化け (1.4.2)
*php ソースでは、日本語に utf-8 を使っている
*メールにはトリガの名称がDBに登録された名称で送られてくる。
*初期トリガは英語で登録されている。
*日本語で登録した場合、utf-8 で登録された。
*utf-8 で起動するとJISの日本語メール送信をするスクリプト sendjpmessage を, 上記の記事から引用し用意した。
*zabbix のメディアに登録した。フルパス指定する。
*日本語でのメール通知できた。
!zabbix-1.4.2 野良RPM作成
*{{ref zabbix-agent-1.4.2-3.x86_64.rpm}}
*CentOS-4.5 x86_64 で作成
*Red Hat より spec ファイルを取得, RHEL-4
*zabbix-1.4.2
*自宅 p4dc で作成
*jabber 対応削除 --with-jabberを zabbix.spec から除去
*RHEL-4 の curl バージョンが低いため、zabbix-server の web-monitor が無効になっている。
!zabbix でテンプレートの内容がホストのアイテムに反映されない場合の対応
*ホストからテンプレートを切断し保存
*再度、ホストとテンプレートを接続
!日本語が文字化けする ImageString 関数についての調査
*ImageString 関数が記述されている zabbix のファイル
 # grep -irl imagestring /opt/zabbix/php | grep -v -e orig -e diff
 /opt/zabbix/php/include/classes/graph.inc.php
 /opt/zabbix/php/include/config.inc.php
 /opt/zabbix/php/vtext.php
 /opt/zabbix/php/chart4.php
 /opt/zabbix/php/chart5.php
 /opt/zabbix/php/chart_sla.php
 /opt/zabbix/php/map.php
*ファイルの依存関係
,ファイル,依存
,include/classes/graph.inc.php,include/items.inc.php include/hosts.inc.php
,include/config.inc.php,classes 多数
,vtext.php,include/config.inc.php
,chart4.php,include/config.inc.php include/triggers.inc.php include/page_header.php
,chart5.php,include/config.inc.php include/services.inc.php include/page_header.php
,chart_sla.php,include/config.inc.php include/services.inc.php include/page_header.php
,map.php,include/config.inc.php include/maps.inc.php include/page_header.php

!windows 系マシンを perf_counter で監視する場合
*typeperf で文字列を確認する。
 typeperf -qx
*特に Intel 製 NIC の場合
*「Intel(R)」は「Intel[R]」で登録する
*「/」は「_」
*複数NICの場合の「#」は「_」




!!!参考情報
!!php
!画像系文字化け修正
*imagestring
**文字列を水平に描画する
**bool imagestring ( resource image, int font, int x, int y, string sring, int color )
*imagettftext
**TrueType フォントを使用してテキストを画像に書き込む
**array imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text )
*imagettfbbox
**TypeType フォントを使用したテキストの bounding box を生成する
**array imagettfbbox ( float size, float angle, string fontfile, string text )

!No more flapping. Define triggers the smart way. / zabbix weblog
*http://blog.zabbix.com/no-more-flapping-define-triggers-the-smart-way/1488/
* take advantage of the min() function.
*(和訳) min() を使いましょう
 {Oracle DB1:system.cpu.load.min(5m)} > 2
*Eliminating flapping and false alarms – hysteresis.
* Zabbix supports a {TRIGGER.VALUE} macro, which returns the current trigger status as an integer (0 – ok, 1 – problem) and can be used directly in trigger expressions.
*(和訳) 現在のトリガの状況を整数で取得し、トリガの条件式で利用できます。
 ({TRIGGER.VALUE}=0 & {Oracle DB1:system.cpu.load.last()} > 2)
 |
 ({TRIGGER.VALUE}=1 & {Oracle DB1:system.cpu.load.last()} > 1)