ja:documentation:pandorafms:monitoring:06_web_monitoring

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:monitoring:06_web_monitoring [2024/07/19 22:38] – [ウェブの応答時間チェック] junichija:documentation:pandorafms:monitoring:06_web_monitoring [2025/02/14 08:27] (現在) – [インストールと設定] junichi
行 51: 行 51:
 </code> </code>
  
-<WRAP center round info 60%>\\ +<WRAP center round info 60%>
-Pandora FMS has protection against [[https://en.wikipedia.org/wiki/Cross-site_request_forgery|CSRF]] and it may happen that the web checks, when debugged, you get this message:\\ +
-''Cannot verify the origin of the request'' \\ +
-Please take this protection into account when considering the use of "[[:en:documentation:03_monitoring:13_user_monitorization#introduction|WUX monitoring]]". </WRAP>+
  
-<WRAP center round info 60%>\\ +Pandora FMS has protection against CSRF and it may happen that web checks, when debugged, get this message: ''Cannot verify the origin of the request'' Take this protection into account when considering the use of "[[:en: documentation:pandorafms:monitoring:13_user_monitorization#introduction|WUX Monitoring]]"
-Pandora FMS は [[https://en.wikipedia.org/wiki/Cross-site_request_forgery|CSRF]] に対して保護されており、デバッグ時に Web チェックで次のメッセージが表示される場合があります:\\ + 
-''Cannot verify the origin of the request'' \\ +</WRAP> 
-[[:ja:documentation:03_monitoring:13_user_monitorization#概要|WUX 監視]] の使用を検討する際には、この保護を考慮に入れてください</WRAP>+ 
 +<WRAP center round info 60%> 
 + 
 +Pandora FMS は [[https://en.wikipedia.org/wiki/Cross-site_request_forgery|CSRF]] に対して保護されており、デバッグ時に Web チェックで ''Cannot verify the origin of the request'' というメッセージが表示される場合があります 
 +[[:ja:documentation:pandorafms:monitoring:13_user_monitorization#概要|WUX 監視]] の使用を検討する際には、この保護を考慮に入れてください。 
 + 
 +</WRAP
 + 
 +<wrap #ks1_3 />
  
 ==== ウェブモジュールの作成方法 ==== ==== ウェブモジュールの作成方法 ====
行 192: 行 197:
 </WRAP> </WRAP>
  
-==== プロキシ経由でのウェブチェック ==== 
-ウェブチェックは、プロキシ経由でも行うことができます。プロキシを設定するには、//拡張オプション(Advanced options)// をクリックすると表示される、//プロキシURL(Proxy URL)// フィールドにプロキシの URL を設定する必要があります。 
  
-例えば、URL は次のようになります。 
- 
-  http://proxy.domain.com:8080 
- 
-認証が必要なプロキシの場合は、次のように ''my-user'' にユーザ名、''my_pwd'' にパスワードを指定します。 
- 
-  http://my_user:my_pwd@proxy.domain.com:8080 
- 
-{{ wiki:Goliat_proxy_conf.png?700 }} 
- 
-==== Webコンテンツの取得 ==== 
- 
-Sometimes monitoring does not consist of finding out whether a specific Web site is working or how long it takes, but to get a real time value, such as the total number of modules registered in the same PFMS server [[:en:documentation:08_technical_reference:02_annex_externalapi#get_total_modules|through the API]]. For this example a module called **Remote HTTP module to retrieve numeric data** will be used with the appropriate regular expression: 
- 
-特定の Web サイトが稼動しているか、どれくらい時間がかかっているかを知りたいわけではなく、[[:ja:documentation:08_technical_reference:02_annex_externalapi#get_total_modules|API を通して]]Pandora FMS サーバに登録されたモジュール数などのコンテンツの内容を確認したい場合もあります。そのためには、適切な正規表現で **Remote HTTP module to retrieve numeric data** モジュールを利用します。 
- 
-<code> 
- 
-task_begin 
-get http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=internal_API&pass=1234&op=get&op2=total_modules&id=0 
-get_content \d+ 
-task_end 
- 
-</code> 
- 
-出力は次のようになります。 
- 
-{{  :wiki:pfms-creating_web_modules-goliat_server-img_100.png  }} 
- 
-It is also possible to specify a more complex regular expression for collecting data from more complex HTTP responses with the ''get_content_advanced'' configuration token. In this **didactic** example, the year is obtained in the footer of Pandora FMS official documentation (and stored in a string data type, **Remote HTTP module to retrieve string data**):{{  :wiki:pfms-creating_web_modules-goliat_server-img_110.png  }} 
- 
-また、より複雑な HTTP 応答からのデータを収集するための正規表現を設定トークン ''get_content_advanced'' で指定することもできます。この**実践的な**例では、Pandora FMS 公式ドキュメントのフッターから年を取得します(また、文字列データタイプ **Remote HTTP module to retrieve string data** で保存します: {{  :wiki:pfms-creating_web_modules-goliat_server-img_110.png  }} 
- 
-<code> 
-task_begin 
-get https://pandorafms.com/manual/ 
-get_content_advanced \(c\) ([\d]+) Pandora FMS\(tm\) </span> 
-task_end 
- 
-</code> 
- 
-{{  :wiki:pfms-creating_web_modules-goliat_server-img_120.png  }}Note that the inverse interval has been used: if a string **other than** ''2022'' is received, the module will go into critical. 
- 
-{{  :wiki:pfms-creating_web_modules-goliat_server-img_120.png  }}しきい値の反転が使用されていることに注意してください。''2022'' 以外の文字列を受信すると、モジュールは障害状態になります。 
- 
-<WRAP center round important 75%> 
- 
-  * The part of the regular expression defined in ''get_content_advanced''  must be enclosed in brackets. 
-  * If the text to be looked for contains parentheses, you must escape the characters by means of the backslash ''\''. 
- 
-</WRAP> 
- 
-<WRAP center round important 75%> 
-  * ''get_content_advanced'' に定義する正規表現は、カッコでくくらなければいけません。 
-  * 検索するテキストにカッコが含まれている場合は、バックスラッシュ ''\'' を使用して文字をエスケープする必要があります。 
-</WRAP> 
- 
-{{  :wiki:pfms-creating_web_modules-goliat_server-img_130.png  }} 
- 
-To configure the thresholds that will trigger warning or critical status, use the module configuration to verify that the received string matches what is expected. 
- 
-警告または障害状態のしきい値を設定するには、モジュールの設定を使用して、受信した文字列が期待どおりのものであることを確認します。 
  
 ==== ウェブページのフォームのチェック ==== ==== ウェブページのフォームのチェック ====
行 320: 行 261:
 {{ wiki:goliat_full_sample.jpg?800 }} {{ wiki:goliat_full_sample.jpg?800 }}
  
-==== WEB リクエトの動作 ==== +==== サーバステータスコードの確認 ====
-拡張プロパィのフィルドは他のイプのモジュルのフィールと似ていますが、WEB チェックではいくつか異なるフィールドがあります。+
  
-**タイムアウト(Timeout)**+To check the server status code of a website, select the type of module <wrap :en>**Remote HTTP module to check server status code**</wrap>:
  
-これはリクエストのタイムアウトで。こ時間超えるとリクエストは破棄されます+ウェブサイトのサーバステースコードを確認るには、モジュール種類選択します <wrap :en>**Remote HTTP module to check server status code**</wrap>:
  
 +<code>
 +task_begin
 +head https://pandorafms.com
 +task_end
  
-**エージェントブラウザID(Agent browser id)**+</code>
  
- これは、特定のページが一部の Web ブラウザのみを受け入れる場合に使用する Web ブラウザの識別子です。(詳細は、https://www.zytrax.com/tech/web/browser_ids.htm を参照してください)+  * It is important to use the ''head''  parameter to obtain the status code. 
 +  * In server configuration, in section [[:en:documentation:pandorafms:installation:04_configuration#web_engine|web_engine]] ''curl'' must be typed in.
  
 +  * ステータス コードを取得するには、''head'' パラメータを使用することが重要です。
 +  * サーバ設定のセクション [[:ja:documentation:pandorafms:installation:04_configuration#web_engine|web_engine]] に ''curl'' と入力する必要があります。
  
-**リクエスト(Requests)** +<wrap #ks1_7 />
- +
- Pandora FMS は、このパラメータで示された回数だけチェックを繰り返します。 チェックの 1つが失敗した場合、障害とみなされます。モジュール内のチェックの数に応じて、一定数のページが取得されます。 つまり、モジュールが 3つのチェックで構成されている場合は、3ページがダウンロードされ、リクエストフィールドに値が設定されている場合は、ダウンロード数はその数を掛け合わせた数になります。 モジュールが処理を完了するのにかかる合計時間を把握するには、これを覚えておくことが重要です。 +
- +
-**リトライ(Retries)** +
- +
-成功するまで **リクエスト(Request)** を実行する数です。例: +
- +
-  * リトライ = 2、リクエスト = 1: 最初のテストに失敗すると、もう一度実行し、2回目で成功すると、正常と判断します。 +
-  * リトライ = 1、リクエスト = 2: 2回のチェックを実行します。しかし一方の失敗で、障害と判断します。+
  
 ==== HTTP の簡単な認証 ==== ==== HTTP の簡単な認証 ====
行 491: 行 429:
  
  
-==== HTTPS モニタリング ==== 
-Goliat は HTTP と HTTPS の両方をチェックできます。 HTTPS を利用しているセキュリティで保護されたウェブサイトのチェックを行うには、その URL にプロトコルを組み込むだけです。 
- 
-<code> 
-task_begin 
-get https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&ss=1&scc=1&ltmpl=default&ltmplcache=2 
-cookie 1 
-resource 0 
-check_string Google 
-task_end 
-</code> 
  
 ==== 拡張オプション ==== ==== 拡張オプション ====
行 513: 行 440:
  task_end  task_end
 </code> </code>
 +
 +<wrap #ks1_8_2 />
  
 === ウェブチェックのデバッグ === === ウェブチェックのデバッグ ===
行 541: 行 470:
  
 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
 +
 +===== (OBSOLETE) =====
 +
 +==== プロキシ経由でのウェブチェック ====
 +ウェブチェックは、プロキシ経由でも行うことができます。プロキシを設定するには、//拡張オプション(Advanced options)// をクリックすると表示される、//プロキシURL(Proxy URL)// フィールドにプロキシの URL を設定する必要があります。
 +
 +例えば、URL は次のようになります。
 +
 +  http://proxy.domain.com:8080
 +
 +認証が必要なプロキシの場合は、次のように ''my-user'' にユーザ名、''my_pwd'' にパスワードを指定します。
 +
 +  http://my_user:my_pwd@proxy.domain.com:8080
 +
 +{{ wiki:Goliat_proxy_conf.png?700 }}
 +
 +==== Webコンテンツの取得 ====
 +
 +Sometimes monitoring does not consist of finding out whether a specific Web site is working or how long it takes, but to get a real time value, such as the total number of modules registered in the same PFMS server [[:en:documentation:08_technical_reference:02_annex_externalapi#get_total_modules|through the API]]. For this example a module called **Remote HTTP module to retrieve numeric data** will be used with the appropriate regular expression:
 +
 +特定の Web サイトが稼動しているか、どれくらい時間がかかっているかを知りたいわけではなく、[[:ja:documentation:08_technical_reference:02_annex_externalapi#get_total_modules|API を通して]]Pandora FMS サーバに登録されたモジュール数などのコンテンツの内容を確認したい場合もあります。そのためには、適切な正規表現で **Remote HTTP module to retrieve numeric data** モジュールを利用します。
 +
 +<code>
 +
 +task_begin
 +get http://127.0.0.1/pandora_console/include/api.php?apipass=1234&user=internal_API&pass=1234&op=get&op2=total_modules&id=0
 +get_content \d+
 +task_end
 +
 +</code>
 +
 +出力は次のようになります。
 +
 +{{  :wiki:pfms-creating_web_modules-goliat_server-img_100.png  }}
 +
 +It is also possible to specify a more complex regular expression for collecting data from more complex HTTP responses with the ''get_content_advanced'' configuration token. In this **didactic** example, the year is obtained in the footer of Pandora FMS official documentation (and stored in a string data type, **Remote HTTP module to retrieve string data**):{{  :wiki:pfms-creating_web_modules-goliat_server-img_110.png  }}
 +
 +また、より複雑な HTTP 応答からのデータを収集するための正規表現を設定トークン ''get_content_advanced'' で指定することもできます。この**実践的な**例では、Pandora FMS 公式ドキュメントのフッターから年を取得します(また、文字列データタイプ **Remote HTTP module to retrieve string data** で保存します: {{  :wiki:pfms-creating_web_modules-goliat_server-img_110.png  }}
 +
 +<code>
 +task_begin
 +get https://pandorafms.com/manual/
 +get_content_advanced \(c\) ([\d]+) Pandora FMS\(tm\) </span>
 +task_end
 +
 +</code>
 +
 +{{  :wiki:pfms-creating_web_modules-goliat_server-img_120.png  }}Note that the inverse interval has been used: if a string **other than** ''2022'' is received, the module will go into critical.
 +
 +{{  :wiki:pfms-creating_web_modules-goliat_server-img_120.png  }}しきい値の反転が使用されていることに注意してください。''2022'' 以外の文字列を受信すると、モジュールは障害状態になります。
 +
 +<WRAP center round important 75%>
 +
 +  * The part of the regular expression defined in ''get_content_advanced''  must be enclosed in brackets.
 +  * If the text to be looked for contains parentheses, you must escape the characters by means of the backslash ''\''.
 +
 +</WRAP>
 +
 +<WRAP center round important 75%>
 +  * ''get_content_advanced'' に定義する正規表現は、カッコでくくらなければいけません。
 +  * 検索するテキストにカッコが含まれている場合は、バックスラッシュ ''\'' を使用して文字をエスケープする必要があります。
 +</WRAP>
 +
 +{{  :wiki:pfms-creating_web_modules-goliat_server-img_130.png  }}
 +
 +To configure the thresholds that will trigger warning or critical status, use the module configuration to verify that the received string matches what is expected.
 +
 +警告または障害状態のしきい値を設定するには、モジュールの設定を使用して、受信した文字列が期待どおりのものであることを確認します。
 +
 +==== WEB リクエストの動作 ====
 +拡張プロパティのフィールドは他のタイプのモジュールのフィールドと似ていますが、WEB チェックではいくつかの異なるフィールドがあります。
 +
 +**タイムアウト(Timeout)**
 +
 +これはリクエストのタイムアウトです。この時間を超えるとリクエストは破棄されます。
 +
 +
 +**エージェントブラウザID(Agent browser id)**
 +
 + これは、特定のページが一部の Web ブラウザのみを受け入れる場合に使用する Web ブラウザの識別子です。(詳細は、https://www.zytrax.com/tech/web/browser_ids.htm を参照してください)
 +
 +
 +**リクエスト(Requests)**
 +
 + Pandora FMS は、このパラメータで示された回数だけチェックを繰り返します。 チェックの 1つが失敗した場合、障害とみなされます。モジュール内のチェックの数に応じて、一定数のページが取得されます。 つまり、モジュールが 3つのチェックで構成されている場合は、3ページがダウンロードされ、リクエストフィールドに値が設定されている場合は、ダウンロード数はその数を掛け合わせた数になります。 モジュールが処理を完了するのにかかる合計時間を把握するには、これを覚えておくことが重要です。
 +
 +**リトライ(Retries)**
 +
 +成功するまで **リクエスト(Request)** を実行する数です。例:
 +
 +  * リトライ = 2、リクエスト = 1: 最初のテストに失敗すると、もう一度実行し、2回目で成功すると、正常と判断します。
 +  * リトライ = 1、リクエスト = 2: 2回のチェックを実行します。しかし一方の失敗で、障害と判断します。
 +
 +==== HTTPS モニタリング ====
 +Goliat は HTTP と HTTPS の両方をチェックできます。 HTTPS を利用しているセキュリティで保護されたウェブサイトのチェックを行うには、その URL にプロトコルを組み込むだけです。
 +
 +<code>
 +task_begin
 +get https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=zpwhtygjntrz&ss=1&scc=1&ltmpl=default&ltmplcache=2
 +cookie 1
 +resource 0
 +check_string Google
 +task_end
 +</code>
  
  • ja/documentation/pandorafms/monitoring/06_web_monitoring.1721428711.txt.gz
  • 最終更新: 2024/07/19 22:38
  • by junichi