文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== ユーザエクスペリエンス監視 (UX および WUX) ====== {{indexmenu_n>7}} [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] ===== 概要 ===== User experience monitoring consists of making recordings of automated tasks of both **web browsing** (PWR/WUX) and interaction with the **desktop and Windows system applications** (PDR). These recordings can range from a mouse click on a web browser, typing text or performing a web search, to opening an application on the desktop. This allows functions to be configured and automatically recorded for later execution in search of results. ユーザエクスペリエンス監視は、**ウェブブラウジング** (PWR / WUX) と **Windows システムのデスクトップアプリケーション** (PDR) における操作を自動的に記録する仕組みから成ります。これらの記録は、ブラウザ上でのマウスクリック、テキスト入力、ウェブブラウジングでの検索、デスクトップ上でのアプリケーションを開くことなどです。記録した処理を自動的に実行し、処理にかかった時間などの結果を得ることができます。これにより、後で結果を検索して実行できるように自動的に記録することができます。 ===== UX および WUX 監視の違い ===== 両方の監視の仕組みは、Pandora Web Robot Daemon (PWRD) システムを通してウェブブラウジングタスクを実行するために利用されます。 **UX** システムは、マシンにインストールされたソフトウエアエージェントによって監視を実現します。**WUX ** は、Pandora FMS の内部に統合されたサーバを用いて監視をします。 Pandora Web Robot Daemon (PWRD) は、ウェブブラウジングセッションを自動実行するために必要なサービスです。これは、ユーザの Web ポータルをナビゲートするのに必要なアクションのリストを含むファイルを使用します。 加えて、UX 監視は、Windows デスクトップおよびシステムアプリケーションの自動化タスクを実行することができます。このタイプのタスクは、WUX では実行できません。 Pandora FMS UX は、自動化されたタスクを実行するシステムであり、Pandora FMS に実行結果、所要時間、およびエラーが検出された可能性のあるスクリーンショットを含むレポートを提供します。 UX 向けの Pandora FMS PWR テクノロジーは、ウェブサイトの閲覧、ユーザアクションのシミュレーションを可能にします。 コンテンツ、テキストなどを確認できます。これは、非フラッシュベースの Web サイトおよびアプリケーションを監視するのに最適です。利点としては、より高速でバックグラウンドで実行できることです。 タスクの自動化システムがある場合、Pandora FMS UX では、すでにあるスクリプトを実行し、その実行を監視することもできます。 どのタイプの監視を行うかを指定することが重要です。 どちらの方法も、対応するマシンにインストールされているソフトウェアエージェントのプラグインによる監視実行に基づいています。 <WRAP center round tip 60%> For the execution of web transactions Pandora FMS uses Selenium Engine: * Selenium version 2. * Selenium version 3. </WRAP> <WRAP center round tip 60%> ウェブトランザクションの実行には、Selenium エンジンを利用します。 * Selenium バージョン 2. * Selenium バージョン 3. </WRAP> ===== PWR UX 監視 ===== Taking into account the [[:en:documentation:03_monitoring:13_user_monitorization|differences between UX and WUX monitoring]], UX monitoring must follow a series of prerequisites related to the environment to be monitored, with the following previous steps: [[:ja:documentation:03_monitoring:13_user_monitorization#ux_および_wux_監視の違い|UX および WUX 監視の違い]] を考慮して、UX の監視は、監視対象の環境に関連する一連の前提条件に従う必要があります。 * Install Java®. * Configure a profile in Mozilla Firefox®. * Install a Selenium® service. * Distribute PWR on the system. * Install the Selenium® IDE for Mozilla Firefox®. * Save a PWR session. * Java® のインストール * Mozilla Firefox® のプロファイル設定 * Selenium® サービスのインストール * システム上への PWR の展開 * Mozilla Firefox® 用の Selenium® IDE の展開 * PWR セッションの保存 For the standard execution of pre-recorded sessions use the [[https://pandorafms.com/guides/public/books/pandora-ux|Pandora UX]] Plugin in its latest version 28-04-2022. 事前に保存されたセッションの標準的な実行には、[[https://pandorafms.com/guides/public/books/pandora-ux|Pandora UX]] プラグインの最新バージョン 28-04-2022 を使用します。 ===== Selenium 3 による Web User Experience (WUX) ===== WUX サーバでの Selenium デプロイでは、コンテナベースのスタックを使用して、迅速なデプロイと容易なスケーリングを実現します。 ==== 事前設定 ==== Docker and Docker Compose must be previously installed. DockerとDocker Compose が事前にインストールされている必要があります。 For this installation, we recommend following the Docker documentation at: このインストールは、以下にある Docker ドキュメントに従うことをお勧めします。 <WRAP center round download 60%> [[https://docs.docker.com/engine/install/|https://docs.docker.com/engine/install/]] </WRAP> The official Selenium images will be used for the installation and deployment of the stack. You may find them at: <WRAP center round download 60%> [[https://hub.docker.com/u/selenium|https://hub.docker.com/u/selenium]] </WRAP> <WRAP center round download 60%> [[https://docs.docker.com/engine/install/|https://docs.docker.com/engine/install/]] </WRAP> 公式 Selenium イメージは、スタックのインストールと展開に使用されます。 それらは次の場所で見つけることができます。 <WRAP center round download 60%> [[https://hub.docker.com/u/selenium|https://hub.docker.com/u/selenium]] </WRAP> Different images with browsers are available in the Selenium repository. For Pandora FMS, we recommend Firefox® and Chrome® containers. Selenium リポジトリでは、ブラウザを使用したさまざまなイメージがあります。Pandora FMS の場合は、Firefox® および Chrome® コンテナを推奨します。 ==== Selenium スタックのデプロイ ==== Selenium スタックをデプロイするには、まず必要な構成を含む **YAML** ファイルを作成する必要があります。 <code> # To execute this docker-compose yml file use `docker-compose -f up` # Add the `-d` flag at the end for detached execution version: "3" services: selenium-hub: image: pandorafms/pandorafms-selenium-hub mem_limit: 2G container_name: selenium-hub-v3 logging: driver: "json-file" options: max-file: "5" max-size: "4m" mode: "non-blocking" environment: - TZ=Europe/Amsterdam ports: - "4444:4444" chrome: image: pandorafms/pandorafms-selenium-node-chrome mem_limit: 2G volumes: - /dev/shm:/dev/shm depends_on: - selenium-hub logging: driver: "json-file" options: max-file: "5" max-size: "4m" mode: "non-blocking" environment: - TZ=Europe/Amsterdam - HUB_HOST=selenium-hub - HUB_PORT=4444 firefox: image: pandorafms/pandorafms-selenium-node-firefox mem_limit: 2G volumes: - /dev/shm:/dev/shm depends_on: - selenium-hub logging: driver: "json-file" options: max-file: "5" max-size: "4m" mode: "non-blocking" environment: - TZ=Europe/Amsterdam - HUB_HOST=selenium-hub - HUB_PORT=4444 </code> <WRAP center round important 60%> In the previous example, make the necessary modifications for each case, such as memory limit, time zone, number of nodes, etc. </WRAP> <WRAP center round important 60%> 前の例に対して、メモリ制限、タイムゾーン、ノード数など、ケースごとに必要な変更を行います。 </WRAP> To activate the container with the defined settings, just run the following command (replace ''<compose-file>'' with the name you chose for the file): 設定した内容でコンテナを有効化するには、次のコマンドを実行します。(''<compose-file>'' は、選択した名前に置き換えてください。) <code> docker-compose -f <compose-file> up -d </code> コンテナで実行されているサービスを確認する必要がある場合は、次のコマンドを使用します。 <code> docker-compose -f <compose-file> ps </code> Selenium サービスの状態とログを表示するには、次のコマンドを使用します。 <code> docker-compose -f <compose-file> logs </code> 適切なチェックが行われた後、グリッドが適切に機能し、ワーカーが設定ファイルでの定義どおりにサインアップしたことを確認するには、次のURLにアクセスします。 <code> http://<ip_selenium_server>:4444/grid/console </code> {{ wiki:newux4.png }} If you need to increase the number of workers, just run the following command: ワーカー数を増やす必要がある場合は、次のコマンドを実行します。 <code> docker-compose -f <compose-file> scale chrome=X firefox=Y </code> ==== Selenium サービスインフラストラクチャ ==== Selenium は、必要なワーカーコンテナーをデプロイするグリッドとして機能するコンテナが有効になっているハブとして機能します。 {{ :wiki:newux9.png?600 }} ==== Pandora FMS 設定 ==== 集中モード(WUX)を使用するには、Pandora FMS サーバに以下の設定を適用する必要があります。 選択したモードに関係なく、WUX サーバ設定パラメータを Pandora FMS サーバの設定ファイルに追加することにより、ブラウジングセッションから実行の割り当てができます。 ファイル''/etc/pandora/pandora_server.conf''の最後に次の設定を追加します(''<ip_wux_host>'' をサーバの IPアドレスに置き換えます。Pandora FMS が動作しているのと同じサーバの場合は、''127.0.0.1'' です。): <code> wuxserver 1 wux_host <ip_wux_host> wux_port 4444 </code> Pandora FMS サーバの設定ファイルには、キューに入れられたナビゲーションセッションを削除するための新しいトークンがあります。 <code> clean_wux_sessions 1 #(default) </code> === Pandora FMS スレッド管理 === * The ''wuxserver'' threads management is done automatically when starting the ''pandora_server'' service. * **It is done taking into account the number of nodes of a MINOR browser that is in the Selenium hub.** For example: * If in the hub there are configured 2 Firefox and 2 Chrome nodes, the number of ''wuxserver'' threads will be 2. * If 1 Firefox node and 4 Chrome nodes are configured in the hub, the number of threads will be 1. * If 6 Firefox nodes are configured in the hub, the number of threads will be 6. * ''wuxserver'' スレッド管理は、''pandora_server'' サービスを起動した際に自動的に行われます。 * **これは、Selenium hub にある MINOR ブラウザのノード数を考慮して行われます。** 例: * hub に 2 つの Firefox ノードと 2 つの Chrome ノードが設定されている場合、''wuxserver''スレッドの数は 2 になります。 * hub に 1 つの Firefox ノードと 4 つの Chrome ノードが設定されている場合、スレッドの数は 1 になります。 * hub に 6 つの Firefox ノードが設定されている場合、スレッドの数は 6 になります。 <WRAP center round tip 60%> Note that each thread indicates the sessions that can be sent simultaneously from the ''wuxserver'' to the Selenium hub. </WRAP> <WRAP center round tip 60%> 各スレッドは、''wuxserver'' から Selenium hub に同時に送信できるセッションを示していることに注意してください。 </WRAP> ==== 付録: Internet Explorer および Microsoft Edge のワーカー追加 ==== Microsoft ブラウザに対して Web トランザクションを起動する必要がある場合は、目的の Windows バージョンのマシン(物理または仮想)を設定し、以下の公式ドキュメントに従ってドライバーを設定する必要があります。 Internet Explorer ドライバインストールドキュメント: github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver <WRAP center round tip 60%> 32bit のバージョン 3.141 のドライバの利用をお勧めします。64bit 版はパフォーマンスの問題があります。 </WRAP> Microsoft Edge ドライバーインストールドキュメント: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Selenium を実行するには、Java が Windows デバイスにインストールされている必要があります。 Java がインストールされているかどうかを確認するには、次のコマンドを実行します。 <code> java -version </code> 次のような出力が得られます。 {{ :wiki:newux1.png?700 }} サーバをローカルで実行してグリッドに登録するには、Selenium **JAR** ファイルも必要です。 以下から入手できます。 <code> https://www.selenium.dev/downloads/ </code> {{ :wiki:newux2.png?800 }} **Microsoft Edge** サーバを有効化にするには、**JAR** ファイルがあるディレクトリのターミナルで次を実行する必要があります。 <code> java -jar selenium-server-standalone-<VER>.jar -port 5555 -role node -hub http://<ip_selenium_server>:4444/grid/register -browser "browserName=MicrosoftEdge, platform=WINDOWS, maxInstances=1" </code> このコマンドは **Internet Explorer** サーバを有効化するのと似ていますが、ダウンロードしたドライバーのパスを指定する必要があります。 <code> java -Dwebdriver.ie.driver=<PATH>IEDriverServer.exe -jar selenium-server-standalone<VER>.jar -port 5555 -role node -hub http://ip_selenium_server:4444/grid/register -browser "browserName=internet explorer, platform=WINDOWS, maxInstances=1" </code> {{ :wiki:newux3.png?700 |Click to enlarge}} <WRAP center round important 60%> Windows ファイアウォールは、コマンド実行時に指定されたポートの通信を許可するように設定する必要があります。例では 5555 および 4444。 </WRAP> ==== 記録 ==== <WRAP center round important 60%> Selenium 2 で作成された記録は正しく機能しない場合があることに注意してください。 </WRAP> Selenium バージョン 3 では、新旧両方の記録の両方がサポートされます。 新しいセッションを記録するには、目的のブラウザに **Selenium IDE** 拡張機能をインストールする必要があります。 **Firefox** <code> https://addons.mozilla.org/ja/firefox/addon/selenium-ide/ </code> **Chrome** <code> https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd </code> 次のアイコンは、拡張機能をインストールしたあとに表示される、記録を開始するアイコンです。 {{ :wiki:newux10.png }} 新しい記録プロジェクトを開始するためのメニューが開きます。 {{ :wiki:newux5.png?600 }} 記録が行われると、次のような結果になります。 {{ :wiki:newux6.png?700 }} Pandora FMS には、Selenium の機能とは別に、監視対象から情報を取得するためのカスタムコマンドがあります。 === コマンド === 利用可能なコマンドの一覧は、[[:ja:documentation:07_technical_annexes:17_compatible_selenium_commands|こちら]] を確認してください。 === 録画を行う際の推奨事項 === 次に、Selenium IDE とのトランザクションを記録し、最も複雑なコマンドを Pandora FMS と統合するための、一連の推奨事項とアドバイスについて詳しく説明します。 * **可能な場合はいつでも、トランザクションを段階的に分割します。**このようにして、状態、時間、スクリーンショットで作成されたモジュールがセグメント化され、トランザクションが失敗したときにそれらを見つけやすくなります。 * **誤検知を回避するには、selenium コマンド "set peed" および "wait for" を使用します。**トランザクションを実行するとき、selenium コマンドには、1つのコマンド実行終了から次のコマンドが実行されるまでのデフォルトの遅延がなく、一部のコマンドにもタイムアウトがありません。これにより、トランザクションは可能な限り最短時間で実行されますが、非常に高速に実行することにより、Web がやや遅かったり、ロードに数秒余分にかかる場合、チェックが失敗する可能性があります。たとえば、"click" コマンドを実行して他のページに移動した後、新しいページの要素を使って動作するコマンドがあった場合、読み込みが 1秒遅れると、その要素は見つかりません。新しいページのチェックは失敗に終わります。このような状況を回避するために、コマンド "set speed" があります。これは、各コマンドの間に Target フィールドに指定されたミリ秒数の遅延を追加します。トランザクションの開始時に設定することをお勧めします。ページの読み込みや要素の表示に数秒かかることがわかっている場合は、コマンド "wait for element present" もあります。"wait for visible " と "wait for test" では、トランザクションを失敗として判断する前に、要素がページに表示されるのを待つ時間をミリ秒単位で設定できます。これらのコマンドを使用すると、チェックの信頼性が大幅に向上しますが、トランザクションの実行にかかる時間も長くなることを考慮することが重要です。 * **既存の要素を確認します。**このためには、"assert" や "verify" などのコマンドをさまざまな場面で使用します。たとえば、クリックでトランザクションを終了しても、クリックした要素を新しいページが開くことは保証されません。要素をクリックできることを保証するだけです。クリック後にのみ読み込まれることがわかっている "verify test" を導入すると、クリックによって送信されたページが使用可能かどうかを確認することができます。 * **ウィンドウまたはタブ間を移動するトランザクションでは、"store window handle" を使用します。**初期ウィンドウに識別子をあらかじめ保存していない場合、ウィンドウの変更("select window" を使用)は失敗する可能性があります。 * **Target by CSS が失敗した場合またはページ内のコンテンツを検索したい場合は、xpath を使用します。**デフォルトでは、Selenium IDE レコーダは CSS ロケータ要素の Target にロードしますが、xpath によってロケータもロードします。レコーダの Target ボックスをクリックすると、保存されているすべてのロケータを表示できます。 {{ :wiki:recomendaciones_ux1.png }} さらに、xpath を使用すると、ページのタグ内のテキストを検索して、より動的なレコーディングができます。上記のキャプチャでは、特定のロケータではなく、ページのすべてのスパンタグで "Monitoring Innovators" というテキストを検索する xpath を使用できることがわかりました。 * **"execute script" コマンドの正しい利用。**"execute script" コマンドは、現在選択されているフレームまたはウィンドウのコンテキストでJavaScript のスニペットを実行します。 このガイド( [[https://ui.vision/rpa/docs/selenium-ide/executescript|https://ui.vision/rpa/docs/selenium-ide/executescript]] )を読んで、その使用法と提供されるさまざまなオプションについて学ぶことをお勧めします。ただし、以前に保存された変数の使用(たとえば、"store text" コマンドは、Pandora FMS Web ドライバが正しく解釈できるように、二重引用符で囲む必要があります。これは、"store text" で保存され、後で "execute script" で使用されるように、Pandora FMS サーバが正しく解釈できるようにする変数の例です。引用符で囲まれた変数をこのように使用すると、Selenium IDE レコーダではスクリプトを実行できないことに注意してください。 {{ :wiki:recomendaciones_ux2.png?650 }} ===== Selenium 2 による Web User Experience (WUX) ===== ==== 事前設定 ==== === Selenium === == Pandora ウェブロボットデーモン (PWRD) の展開 == Pandora Web Robot Daemon は、ユーザーの Web アクセスをナビゲートするために必要なアクションのリストを含むファイルを使用して、Webブラウザセッションを自動化するツールを提供するサービスです。 It comes integrated with the Pandora FMS server and can be found in the ''/usr/share/pandora_server/util/pwrd'' folder when installing the PFMS server (GNU/Linux®) or in the module library (Windows®). Pandora サーバに統合され、PFMS サーバ(GNU/Linux®) またはモジュールライブラリ(Windows®) のインストール時に ''/usr/share/pandora_server/util/pwrd'' に置かれています。または、モジュールライブラリからダウンロードできます(Windows®)。 ダウンロードは、 [[https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/|https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/]] から行います。 以下が含まれます。 * Windows 版 Firefox 47 のバイナリ * Web ブラウザセッションを実行するために、あらかじめビルドされたプロファイル * セッション自動化のためのサーバ (Selenium サーバ) == Windows への Selenium サーバの展開 == 事前準備: * サービスを提供するサーバへ Java 1.8 をインストール * Firefox 47.0.1 ([[https://ftp.mozilla.org/pub/firefox/releases/47.0.1/|https://ftp.mozilla.org/pub/firefox/releases/47.0.1/]] からダウンロード) * 自動セッションチェックのための Firefox プロファイル(オプション): [[http://toolsqa.com/selenium-webdriver/custom-firefox-profile/|http://toolsqa.com/selenium-webdriver/custom-firefox-profile/]] * ディレクトリの作成: ''C:\PWR'' PWR_Server.zip のダウンロードは、 [[https://pandorafms.com/library/pwr-server-for-ux-monitoring/|https://pandorafms.com/library/pwr-server-for-ux-monitoring/]] から行います。 ファイルの展開: * PWR_Server.zip を C:\PWR\ へ展開 * Firefox プロファイルを C:\PWR\profile へ展開 プロファイルを使用してチェックを実行することは必須ではありませんが、プロキシを使用する場合や、パスワードのオートコンプリートを使用する場合は特に推奨します。 Firefox のプロファイルを作成するには、次のようにします。 {{ :wiki:ux1.jpg?600 |ux1.jpg}} {{ :wiki:ux2.jpg?500 |ux2.jpg}} ディレクトリを選択します。 {{ :wiki:ux3.jpg?500 |ux3.jpg}} プロキシやポップアップなどのオプションを設定するために、新たなプロファイルで Firefox を起動します。 {{ :wiki:ux4.jpg |ux4.jpg}} 次に、提供された BAT ファイル //service_installer.bat// を実行してサービスをインストールします。 service_installer.bat が正しく機能するように、内容を変更し、存在するパスにインストールされるようにします。たとえば、Java は、PATH が正しく構成されている場合にのみ動作します。それ以外の場合は、ファイル内にフルパスを指定する必要があります。 最後に、サービスを開始します。 <code> net start PWRSRV </code> Selenium サーバが起動します。デバッグのために(サービスを中断した時は)手動でも実行できます。 次のコマンドを使います。 <code> java -jar C:\PWR\server\selenium-server-standalone-2.53.0.jar -firefoxProfileTemplate C:\PWR\profile -port 4444 -v </code> <wrap #ks5_1_1_3 /> == Linux への Selenium サーバの展開 == 事前準備: * Install Java 1.8 on the machine that will provide the service. * Install Firefox 47.0.1 (downloadable at [[https://ftp.mozilla.org/pub/firefox/releases/47.0.1/|https://ftp.mozilla.org/pub/firefox/releases/47.0.1/]]). * Prepare a Firefox profile to be used to test automated sessions (optional): [[http://toolsqa.com/selenium-webdriver/custom-firefox-profile/|http://toolsqa.com/selenium-webdriver/custom-firefox-profile/]] * Install xorg-x11-server-xvfb * Install java * サービスを提供するサーバへ Java 1.8 をインストール * Firefox 47.0.1 ([[https://ftp.mozilla.org/pub/firefox/releases/47.0.1/|https://ftp.mozilla.org/pub/firefox/releases/47.0.1/]] からダウンロードできます) をインストール * 自動セッションチェックのための Firefox プロファイル(オプション): [[http://toolsqa.com/selenium-webdriver/custom-firefox-profile/|http://toolsqa.com/selenium-webdriver/custom-firefox-profile/]] を準備 * xorg-x11-server-xvfb をインストール * java をインストール PWRD デーモンの Selenium コンポーネントは Java を要求します。以下のようにインストールします。 <code bash> dnf install java </code> PWRD で、Linux サーバで Firefox を起動できるようにするには、仮想グラフィック環境を作成するために xorg-x11-server-Xvfb, gtk2 and gtk3 をインストールする必要があります。 <code bash> dnf install xorg-x11-server-Xvfb gtk2 gtk3 </code> Once the prerequisites are installed, continue with the installation of install_pwrd.sh. This installer is found by default in the folder ///usr/share/pandora_server/util/pwrd/install_pwrd.sh// and it is executed as follows: 依存ファイルをインストールしたら、install_pwrd.sh のインストールを続行します。このインストーラーは、デフォルトでは ///usr/share/pandora_server/util/pwrd/install_pwrd.sh// フォルダーにあり、次のように実行します。 <code bash> cd /usr/share/pandora_server/util/pwrd/ ./install_pwrd.sh --install </code> インストールが完了したらサービスを開始します。 <code bash> /etc/init.d/pwrd start </code> 以下のスクリプトで Selenium サーバを起動できます。 <code bash> #!/bin/sh # Monitoring selenium process if [[ `ps aux |grep selenium` ]]; then exit else if [[ `ps aux |grep Xvfb` ]]; then Xvfb :99 -ac & export DISPLAY=:99 fi export DISPLAY=:99 java -jar /usr/share/pandora_server/util/pwrd/selenium-server-standalone-2.53.1.jar & fi </code> または、手動で以下のコマンドを実行します。 <code> $ Xvfb :99 -ac & -> Press Enter to continue $ export DISPLAY=:99 $ java -jar /usr/share/pandora_server/util/pwrd/selenium-server-standalone-2.53.1.jar -port 4444 & </code> バージョン 730 以降では、デフォルトのインストールとは異なるユーザとディレクトリでカスタムインストールを実行できるようになりました。 **PWRD 動作モード** PWRD には複数の動作モードがあります。 * **Standalone**: このモードでは、PWRD の単一のインスタンスを起動します。インスタンスは Pandora FMS サーバに割り当てられます。 * **HUB**: このモードでは、PWRD サービスはブラウザセッションを直接は評価せず、代わりにタスクを実行するためのノードが登録されます。これは、PWRD サービスのクラスタモードです。それぞれの HUB が Pandora FMS サーバに割り当てられます。 ==Standalone モードの PWRD== Standalone モードの PWRD は、デーモンを起動し、WUX サーバを通してユーザが指示したアクションを実行できるようになります。 {{ :wiki:wux_pwrd_standalone.png }} Start: 起動: <code> /etc/init.d/pwrd start </code> See the status 状態確認: <code> /etc/init.d/pwrd status </code> Stop: 停止: <code> /etc/init.d/pwrd stop </code> ==PWRD の "HUB" モード== HUB モードは、ロードバランサーとしてデーモンを起動します。この動作モードでは、システムに登録されたすべてのノード間で負荷をバランシングし、負荷に応じてセッションの実行割り当てをします。 HUB の管理コンソールにアクセスすることにより、HUB の状態を常に確認することができます。 <code> http://<ip_addr_HUB>:4444/grid/console </code> {{ wiki:wux_pwrd_hub.png }} Start: 起動: <code> /etc/init.d/pwrd start-hub </code> See the status: 状態確認: <code> /etc/init.d/pwrd status-hub </code> Stop: 停止: <code> /etc/init.d/pwrd stop-hub </code> ==PWRD ノードの HUB への追加== 新たな PWRD ノードを追加するには、以下が必要です。 * HUB (HUB モードの PWRD) * 同一または異なるマシン上の PWRD ファイル * ノードをホストするコンピュータから HUB をホストするコンピュータへの TCP/4444 接続 この動作モードでは、サービスはキューに入れられた HUB からのすべての要求を処理し、実行結果を返します。 HUB のみが WUXServer との通信を行い、アクションの実行は透過的です。 Start and sign up in the HUB, replace "hub" with the IP of the PWRD HUB server: 起動および HUB への登録。"hub" の部分は PWRD HUB のサーバ IP に置き換えてください: <code> /etc/init.d/pwrd start-node http://hub:4444/grid/register </code> See the status: 状態確認: <code> /etc/init.d/pwrd status-node </code> Stop: 停止: <code> /etc/init.d/pwrd stop-node </code> == Firefox プロファイルへの証明書アップロード == Firefox のデフォルトの CA に含まれていない、自己証明書や CA による証明書を必要とする Web ページの監視を行うこともできます。そのような場合、利用する Firefox のプロファイルに証明書を読み込ませる必要があります。 それには、グラフィカルな環境でブラウザを起動し、URL にアクセスし SSL 証明書を追加するのが一番簡単です。以下に Windows および Linux でのその方法を説明します。 **Windows システムにデプロイした PWRD の場合** この場合、GUI 環境があるのでチェック用のプロファイルを使って Firefox ブラウザを起動するだけです。 {{ :wiki:profile_01.png }} {{ :wiki:profile_02.png }} 起動したら、アップロードする証明書を使用して URL にアクセスし、ブラウザの例外として追加します。 {{ :wiki:profile_03.png }} {{ :wiki:profile_04.png }} 別の方法として、SSL 証明書を設定するには、Firefox のオプション、"Privacy & Security" タブにアクセスし、"Query OCSP responder servers to confirm the current validity of certificates" のチェックを外します。 {{ :wiki:profile_05.png }} {{ :wiki:profile_06.png }} **Linux システムにデプロイした PWRD の場合** 一般的に、Linux サーバがインストールされている場合、グラフィカルなデスクトップ環境は含まれていません。前のケースと同じ手順を実行するには、X を GUI 環境を持つコンピュータにリダイレクトする必要があります。 ==Linux デスクトップへの X11 のリダイレクト== PWRD サーバから "-X" オプションをつけて SSH 接続をするだけで十分であるため非常にシンプルです。 <code> ssh -X user@pwrd_ip_address </code> その後、Firefox ブラウザを起動すると、デスクトップに画面表示されます。 <code> firefox -p </code> デフォルトのインストールでは、デフォルトのプロファイルのみ見ることができます。Windows へのインストールの場合と同様に、新しいプロファイルを作成して使用することをお勧めします。 {{ :wiki:profile_07.png }} {{ :wiki:profile_08.png }} {{ :wiki:profile_09.png }} プロファイルが **/opt/firefox_profile** 以外にある場合、PWRD の起動スクリプト **/etc/init.d/pwrd** でプロファイルのパスを指定するように編集する必要があります。 <code> PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder" </code> プロファイルを作成したら、ブラウザを起動します。 {{ :wiki:profile_10.png }} 起動したら、アップロードする証明書を使って URL にアクセスし、ブラウザの例外として追加します。 {{ :wiki:profile_11.png }} {{ :wiki:profile_12.png }} 他の方法として、SSL 証明書を受け入れたい場合は、Firefox の "Advanced > Certificates" タブのオプションへアクセスし、"Query the OCSP respondent servers to confirm the current validity of the certificates" を選択します。 {{ :wiki:profile_13.png }} {{ :wiki:profile_14.png }} ==Windows デスクトップへの X11 リダイレクト== Windows の場合、リダイレクトを行えるようにするために、**Xming** などの X サーバをインストールする必要があります。インストールして起動すると、X のリダイレクトができるようになります。 SSH Putty クライアントを用いて、接続前に "Connection > SSH > X11" にアクセスします。そして "Enable X11 forwarding" がチェックされ、"X display location" が "localhost:0" になっていることを確認します。 {{ :wiki:profile_15.png }} そして、"Session" セクションに戻り、接続を確立します。 {{ :wiki:profile_16.png }} 接続したら、PWRD サーバ上で Firefox ブラウザを起動すると、Windows デスクトップでその画面を見ることができます。 <code> firefox -p </code> デフォルトのインストールでは、デフォルトのプロファイルのみ見ることができます。Windows へのインストールの場合と同様に、新しいプロファイルを作成して使用することをお勧めします。 {{ :wiki:profile_17.png }} {{ :wiki:profile_18.png }} {{ :wiki:profile_19.png }} プロファイルが **/opt/firefox_profile** 以外にある場合、PWRD の起動スクリプト **/etc/init.d/pwrd** でプロファイルのパスを指定するように編集する必要があります。 <code> PWROPTS =" -firefoxProfileTemplate /path/to/profile/folder" </code> プロファイルを作成したら、ブラウザを起動します。 {{ :wiki:profile_20.png }} 起動したら、アップロードする証明書を使って URL にアクセスし、ブラウザの例外として追加します。 {{ :wiki:profile_21.png }} {{ :wiki:profile_22.png }} 他の方法として、SSL 証明書を受け入れたい場合は、Firefox の "Advanced > Certificates" タブのオプションへアクセスし、"Query the OCSP respondent servers to confirm the current validity of the certificates" を選択します。 {{ :wiki:profile_23.png }} {{ :wiki:profile_24.png }} == Pandora サーバ設定 == 選択したモードにかかわらず、一度起動すると、Pandoraサーバーの設定ファイルに WUXServer の設定パラメータを追加して、ブラウジングセッションの実行の割り当てを開始できます。 Assuming that you have deployed your PWRD server on the same server where your Pandora FMS server runs, you should add the following configuration (add to ''/etc/pandora/pandora_server.conf''): PWRD サーバーを Pandora FMS サーバと同じサーバに配置するのであれば、次の設定を追加します。(''/etc/pandora/pandora_server.conf'' へ追加します) <code> wuxserver 1 wux_host 127.0.0.1 wux_port 4444 wux_timeout 30 </code> The ''wux_timeout'' parameter sets the maximum transaction time to 30 seconds: **if necessary adjust this value to your particular environment**. ''wux_timeout'' パラメーターで最大トランザクション時間を 30秒に設定していますが、**必要に応じて、この値を環境に合わせて調整します。** == Pandora FMS スレッド管理 == In case of using the PWRD in hub mode: PWRD を hub モードで利用する場合: * The ''wuxserver'' threads management is done automatically when starting the ''pandora_server'' service. * **It is done taking into account the number of nodes of a MINOR browser that is in the Selenium hub.** For example: * If in the hub there are configured 2 Firefox and 2 Chrome nodes, the number of ''wuxserver'' threads will be 2. * If 1 Firefox node and 4 Chrome nodes are configured in the hub, the number of threads will be 1. * If 6 Firefox nodes are configured in the hub, the number of threads will be 6. * ''wuxserver'' スレッド管理は、''pandora_server'' サービスを起動した際に自動的に行われます。 * **これは、Selenium hub にある MINOR ブラウザのノード数を考慮して行われます。** 例: * hub に 2 つの Firefox ノードと 2 つの Chrome ノードが設定されている場合、''wuxserver''スレッドの数は 2 になります。 * hub に 1 つの Firefox ノードと 4 つの Chrome ノードが設定されている場合、スレッドの数は 1 になります。 * hub に 6 つの Firefox ノードが設定されている場合、スレッドの数は 6 になります。 <WRAP center round tip 60%> Note that each thread indicates the sessions that can be sent simultaneously from the ''wuxserver'' to the Selenium hub. </WRAP> <WRAP center round tip 60%> 各スレッドは、''wuxserver'' から Selenium hub に同時に送信できるセッションを示していることに注意してください。 </WRAP> === PWR セッションの記録 === <WRAP center round tip 60%> Selenium 3 で実装された、新たなバージョンの Selenium IDE は、Pandora FMS バージョン 745 以降で対応しています。Selenium 3 におけるトランザクションの記録には影響しません。 </WRAP> User experience 監視の前に、選択した技術タイプに応じて、適切なレコーディングシステムを使用してください。 <WRAP center round important 60%> Selenium 2 でのセッションの記録は、Firefox でのみ実施可能です。 </WRAP> PWR で操作を記録するには、モジュールライブラリにある PWRD レコーダーが必要です。 [[https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/|https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/]] 以下が含まれています: * ウェブブラウザ [[https://ftp.mozilla.org/pub/firefox/releases/47.0.1/|Firefox バージョン 47.0.1]]. * 拡張 [[https://addons.mozilla.org/es/firefox/addon/selenium-ide/|Selenium IDE]]. レコーダ PWR_recorder.exe を起動します。 {{ :wiki:pwr_recorder.png }} PWR セッションの記録準備ができた状態で Firefox が自動的に起動します。 {{ :wiki:pwr_recorder_main.png }} Selenium IDE にアクセスしたあと、あなたの操作のレコーディングを開始できます。 {{ :wiki:ux10.jpg |ux10.jpg}} ここから、監視したいウェブサイトをブラウズし、それぞれのステップのアクションがレコーダーに現れます。 記録を停止するには、レコーダーの右上にある次のボタンを利用します。 {{ :wiki:ux11.jpg |ux11.jpg}} 処理が完了したら、ページのチェックを実施できます。たとえば、特定のテキストの存在を確認して、読み込まれたページが正しいことを確認できます。これには、記録を行っているときに、ブラウザウィンドウのテキスト部分を右クリックし、オプション // verifyText //を選択します: {{ :wiki:ux13.jpg |ux13.jpg}} テキストチェックアクションを示す新しいステップがレコーダに表示されます。 {{ :wiki:ux14.jpg |ux14.jpg}} //Play Entire test suite// ボタンで全体の流れを再現し、一通り成功するか確認できます。 {{ :wiki:ux15.jpg?800 |ux15.jpg}} 一連の動作を確認したら、それを保存します(File -> Save Test Case)。 これが、Pandora コンソールで新たな Web 分析モジュールを作成するときにロードするファイルになります。 == Pandora FMS WUX のトランザクションセッションを記録する == Pandora WUX は、ウェブサイトのブラウジング監視を、それぞれのステップを表す複数のモジュールに分割することができます。 新たなコントロールポイントを追加しフェーズモジュールを生成するには、フェーズを開始したい場所で右クリックします。 {{ :wiki:pwrd_recorder_transaction.png }} 次のテキストをコメントとして書きます。 <code> phase_start:<phase_name> </code> フェーズは、次のコメントまでに存在するすべてのコマンドと時間の結果を含みます。 <code> phase_end:<phase_name> </code> phase_start と phase_end の間に実行されるすべてのコマンドが、一つのフェーズとして扱われます。 {{ :wiki:pwrd_recorder_transaction2.png }} <WRAP center round important 60%> Selenium 2 で作成された記録は正しく機能しない場合があることを考慮してください。 </WRAP> ==== Web トランザクションの実行 ==== === 標準実行 === あらかじめ記録した PWR セッションを起動するには、//pandora_ux_x64.exe// を実行します。これは、 [[https://pandorafms.com/library/user-experience-pandora-ux|https://pandorafms.com/library/user-experience-pandora-ux]] からダウンロードできます。 PWR 動作モードとセッションガイドラインを含んだファイルを選択します。エラーのスクリーンショットが、//-folder// パラメータで指定された場所に保存されます。実行に失敗したときに再実行するための //-retries// パラメータを利用することもできます。Windows での実行は次のようにします。 <code> pandora_ux_x64.exe -exe PWR -script C:\tests\std.html -retries 3 </code> 次のモジュールが返ります。 * UX_Status_project_name: シーケンスが成功したかどうか * UX_Time_project_name: シーケンスを完了するのにかかった時間 * UX_Snapshot_project_name: エラーが発生した直前のスクリーンショット 正常実行結果例: <code> <module> <name><![CDATA[UX_Status_std.html]]></name> <type>generic_proc</type> <data><![CDATA[1]]></data> <description><![CDATA[Test OK]]></description> <tags>UX</tags> <module_group>UX</module_group> </module> <module> <name><![CDATA[UX_Time_std.html]]></name> <type>generic_data</type> <data><![CDATA[16.317]]></data> <description><![CDATA[Test OK]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_std.html</module_parent> </module> </code> エラー実行結果例: <code> <module> <name><![CDATA[UX_Status_std.html]]></name> <type>generic_proc</type> <data><![CDATA[0]]></data> <description><![CDATA[Failed to execute verifyText]]></description> <tags>UX</tags> <module_group>UX</module_group> </module> <module> <name><![CDATA[UX_Time_std.html]]></name> <type>generic_data</type> <data><![CDATA[15.463]]></data> <description><![CDATA[Failed to execute verifyText]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_std.html</module_parent> </module> <module> <name><![CDATA[UX_Snapshot_std.html]]></name> <type>async_string</type> <data><![CDATA[data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]></data> <description><![CDATA[Image (last error)]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_std.html</module_parent> </module> </code> すべて問題なければ、監視を実行するために実行コマンドラインを(マシンにインストール済の) Pandora エージェントに追加できます。例えば以下の通りです。 Windows: <code> module_plugin C:\Users\artica\Documents\Product\UX-Trans\UX\pandora_ux_x64.exe -exe PWR -script C:\Users\artica\Documents\Product\UX-Trans\PWR\sesion.html -folder <screenshots path> </code> Linux: <code> module_plugin /usr/share/pandora_server/tool/pwrd/firefox/pandora_ux.64 -exe PWR -script /usr/share/pandora_server/tool/pwrd/firefox/TestUX.html -pwr_port 4444 </code> エージェントが Pandora FMS サーバへデータを送ると、関連するモジュールが作られます。モジュールの関係を見るには、//階層モード// を有効にします。 {{ :wiki:ux33.jpg?800 |ux33.jpg}} 前述の通り、実行結果(成功・失敗)は、//UX_Status_session.html// モジュールで、所要時間(秒)は、//UX_Time_session.html// モジュールで、失敗時のスクリーンショット(例では空です)は //UX_Snapshot_session.html// に保存されます。アラートを設定したり個々のグラフを表示したりするには、これらのモジュールを使います。 {{ :wiki:imagen_nueva_ux.png }} === ステージごとの実行 === 前の章で説明した Pandora UX PWR トランザクションの記録がある場合、各フェーズを特定するのに必要なモジュールはシステムが生成します。これは実行は一つ前と関連性が無いことを意味します。対応する htmlファイル(この場合、異なるフェーズを含む)を指定します。 <code> pandora_ux_x64 -exe PWR -script C:\tests\std.html --folder <screenshots path> </code> 次のモジュールが返されます。 * UX_Time_project_name.phase_order * UX_Status_project_name.phase_order フェーズでエラーが返る場合は、次のモジュールが作成されます。 * UX_Snapshot_project_name.phase_order エラー時のスクリーンショットが表示されます。 全体の状態モジュールが、次のラベルで返されます。 * UX_Global_Time_project_name * UX_Global_Status_project_name * UX_Global_Snapshot_project_name エラー時のスクリーンショットが表示されます。 エージェントの実行コマンド設定は前述の例と同じですが、フェーズを含む html ファイルがあります。 Pandora FMS サーバにデータが届くと、モジュールとして表示されます。情報を見やすくするには、モジュールの //階層モード// を有効にします。 {{ :wiki:ux34.jpg?800 |ux34.jpg}} トランザクションおよびフェーズの詳細を確認するには、エージェントの //WUX// にアクセスします。 以下の例は、当社のウェブサイトの閲覧処理と複数のアイテムの購入を表しており、5段階に分けて、時間を正確に測定して改善が必要な場所、またはボトルネックが発生している場所がわかるようにしています。 {{ :wiki:ux44.jpg?800 |ux44.jpg}} === データ取得 === Pandora FMS UX は、ウェブのブラウジング監視中にウェブコンテンツのデータを取得できます。 この機能を利用するには、Selenium IDE でテストケースにコメントとしていくつかのディレクティブを追加する必要があります。 {{ :wiki:pwr_recorder_getvalue.png?600 }} この例では、監視の実行後に値を取得しています。そして、モジュール(getValue ディレクティブ)として Pandora に追加されます。 値を取得するプラグインを作成するステップは次の通りです。 * Selenium IDE で、テストケースにコメントを追加します。 * ディレクティブをコメントで記載します。 データ取得ディレクティブ: <code> getValue;<module name>;<module data type>;<Perl regular expression for data capture> </code> <code> getValue;<モジュール名>;<モジュールデータタイプ>;<データ取得のための perl 正規表現> </code> 各フィールドはセミコロンで区切ります。 * **getValue**: Instruction for the UX system. * **Module name**: The name of the module as it appears in Pandora FMS. * **Module data type****: **What type will be used. It can be any of the [[:en:documentation:02_installation:05_configuration_agents#module_type|data types]] supported by Pandora FMS. * **Perl regular expression for data capture**: It must be a Perl regular expression, with the information capture command between brackets. * **getValue**: UX システムのディレクティブです。 * **モジュール名**: Pandora に表示されるモジュール名です。 * **モジュールデータタイプ**: Pandora が取り扱える[[:ja:documentation:02_installation:05_configuration_agents#module_type|データタイプ]]です。 * **Perl 正規表現**: perl の正規表現です。カッコ内のデータが取得されます。 以下に例を示します。 <code> <p>The temperature of the solar plate is: <span class="temperatura">54º C</span></p> </code> 温度を取得したい場合、正規表現を以下のようにします。 <code> <span class="temperatura">(\d+\.*\,*\d*).*</span> </code> すると、例えばシステムは数値 "54"、または小数点以下の任意の数を取得します。 ディレクティブ全体は次のようになります。 <code> getValue;solar panel temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span> </code> The commands that generate modules are: モジュールを生成するコマンドは次の通りです。 * **getValue: **Extract a value. * **getValue: **値を展開します。 <code> getValue;module_name;module_type;REGEX_string_match </code> <code> getValue;モジュール名;モジュールタイプ;文字列マッチ正規表現 </code> * **getVariable**: (Version 753 or later) Extract an specific value from a variable. * **getVariable**: (バージョン 753 以上) 変数から特定の値を展開します。 <code> getVariable;module_name;module_type;var_name </code> <code> getVariable;モジュール名;モジュールタイプ;変数名 </code> * **getScreenshoot**: capture screen. * **getScreenshot**: 画面をキャプチャします。 <code> getScreenshot;module_name </code> <code> getScreenshot;モジュール名 </code> <WRAP center round tip 60%> ''getValue'' は、[[:ja:documentation:07_technical_annexes:17_compatible_selenium_commands#Commands_that_generate_modules|モジュールを生成するコマンド]] に属するコマンドです。詳細はリンクを確認してください。 </WRAP> ===== データ管理と表示 ===== <wrap #ks6_1 /> ==== Pandora FMS コンソールでの Web 分析モジュールの作成 ==== ブラウジングセッションを記録したら、Pandora FMS コンソールのモジュールとして展開します。 To do it, **access any agent linked to a server with the WUX feature enabled** and create a new module with **Create a new web analysis module** option: そのためには、**WUX 機能が有効化されたサーバで任意のエージェントにアクセスし**、**新規ウェブ分析モジュールの作成(Create a new web analysis module)** オプションでモジュールを作成します。 {{ :wiki:wux_module.png }} Once **Create** is selected, fill in all the fields the form presents: **作成(Create)** を選択後、次のフォームに入力します。 {{ :wiki:wux_form.png }} **Module name** **モジュール名(Module name)** WUX Module (Parent). All sub-modules with the monitoring results will rely on this new module. モジュールWUX(親)、監視結果を持つすべてのサブモジュールはこの新しいモジュールに依存します。 **Run performance tests** **パフォーマンステスト実行(Run performance tests)** It indicates that you wish to monitor not only the browsing experience, but also the performance statistics of access to the target website. 閲覧可否の監視だけでなく、対象のウェブサイトへのアクセスのパフォーマンス統計も監視することを示します。 **Execute test from** **テスト実行サーバ(Execute test from)** Set the WUX server that will execute the test. テストを実行する WUX サーバ。 **Browser** **ブラウザ(Browser)** Web browser that will run the test. テストを実行するウェブブラウザ。 <WRAP center round important 60%> The indicated browser must be on the Selenium grid or server used by the WUX server. </WRAP> <WRAP center round important 60%> ブラウザは、WUX サーバが使用する Selenium グリッドまたはサーバ上にある必要があります。 </WRAP> **User data dir** **ユーザデータディレクトリ(User data dir)** (//Version 764 or later//) Optional: Allows you to specify a directory for data. (//バージョン 764 以降//) オプション: データディレクトリを指定できます。 <WRAP center round info 60%> **User data dir** option only works on Google Chrome web browser. </WRAP>\\ <WRAP center round info 60%> **ユーザデータディレクトリ(User data dir)** オプションは、Google Chrome でのみ動作します。 </WRAP>\\ **Profile** **プロファイル(Profile)** (//Version 764 or later//) Optional: Allows to specify a user profile. If the profile name does not exist, use the default profile. (//バージョン 764 以降//) オプション: ユーザプロファイルを指定できます。プロファイル名が存在しない場合は、デフォルトのプロファイルを使用します。 <WRAP center round info 60%> **Profile** option only works on Google Chrome web browser. </WRAP> <WRAP center round info 60%> **プロファイル(Profile)** オプションは、Google Chrome でのみ動作します。 </WRAP> **Accept insecure certificates** **安全でない証明書を受け入れる(Accept insecure certificates)** If enabled, any insecure certificate (self-signed, expired, etc.) that is part of the navigation will be accepted. 有効にすると、ナビゲーションの際に安全でない証明書(自己署名、期限切れなど)が受け入れられます。 <WRAP center round important 60%> This option is only available for Google Chrome and Mozilla Firefox browsers, and will only take effect if the test is run by a Selenium 3 server. </WRAP> <WRAP center round important 60%> このオプションは、Google Chrome および Mozilla Firefox ブラウザでのみ使用でき、テストが Selenium 3 サーバによって実行される場合にのみ有効になります。 </WRAP> **Data history** **データ保存(Data history)** To save or not the historical information of the modules that monitor this user experience. 実行結果のモジュールデータを保存するかどうか。 **Text area section** **テキスト入力領域(Text area section)** Text box where to copy (or load) the content of the files from the browsing session that you previously recorded. このテキストボックスには、あらかじめ録画したブラウジングセッションのコンテンツファイルをコピー(またはアップロード)します。 {{ :wiki:wux_form_2.png }} **FF interval** **連続障害検知抑制間隔(FF interval)** Module execution flip flop time interval (in seconds). モジュールの連続障害検知抑制間隔(秒単位)。 **Retries** **リトライ(Retries)** Number of module launch retries. モジュールのリトライ回数。 === カスタムマクロ === {{ :wiki:wux_form_3.png }} カスタムマクロは、ブラウジングセッションのファイル内に設定した特定の文字列を、変化する特定の値に置き換える動作をします。 ウェブ解析モジュールの場合、この機能が改善され、値を日時の変数に変換できる **動的マクロ** が利用可能になりました。 なぜこの機能が必要なのでしょうか? 会議室を予約するウェブアプリケーションの機能を、ブラウジングセッションを通して監視する必要があるとします。 固定の日時を設定すると、システムはおそらく予約を取り消すことになります。これは、ある時点で過去に予約されている可能性があるためです。たとえば、先週の予約と同じ予約をしようとしている可能性があります。 また、予約の実行が可能な期間を見つけることも必要です。例えば、システムは当月を超えないなど一定の期間内に部屋を予約する必要があります。 数日おきに設定を気にしたりマクロを編集するのを避け、動的マクロを使用することにより、テストを行う翌日の部屋を常に予約するようにシステムを設定することができます。 この機能を利用するには、次のような特定の形式を用います。 * ''@DATE_FORMAT'' current date/time with user-defined format. * ''@DATE_FORMAT_nh'' hours. * ''@DATE_FORMAT_nm'' minutes. * ''@DATE_FORMAT_nd'' days. * ''@DATE_FORMAT_ns'' seconds. * ''@DATE_FORMAT_nM'' month. * ''@DATE_FORMAT_nY'' year. * ''@DATE_FORMAT'' ユーザ定義フォーマットでの現在の日付/時間 * ''@DATE_FORMAT_nh'' 時間 * ''@DATE_FORMAT_nm'' 分 * ''@DATE_FORMAT_nd'' 日 * ''@DATE_FORMAT_ns'' 秒 * ''@DATE_FORMAT_nM'' 月 * ''@DATE_FORMAT_nY'' 年 "n" は、符号なしの数値(正の数)または負の数です。 書式は、[[http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm|perl の strftime]] に従います。 例: <code> @DATE_%Y-%m-%d %H:%M:%S @DATE_%H:%M:%S_300s @DATE_%H:%M:%S_-1h </code> ==== データ表示 ==== WUX で生成された情報は、次のようにモジュールに表示されます。モジュール一覧の中で階層表示を有効化することにより、情報をより分かりやすく表示します。 {{ :wiki:wux_modules.png?800 }} 階層表示では、次のモジュールを見ることができます。 * //module//_Global_Status: It will indicate the **global** state of the complete navigation. * If there is a recording, it gives the status of the WUX recording. * In the case that the [[:en:documentation:03_monitoring:13_user_monitorization#create_a_web_analysis_module_in_pandora_fms_console|run performance Test]] is enabled but the recording is not included, the Global Status module status is the status of the check that is performed when obtaining these modules. * //module// _ Global_Time: It will indicate the **global** time spent in full navigation. * //module//_ Global_Screenshot: It contains an image with the result of the navigation error, **it will only be generated in case of error** * //module//_Phase X: //Phase name//_ Status: It will indicate the navigation status during phase X. * //module//_Phase X: //Phase name//_Time: It will indicate the time spent in phase X. * //module//_Global_Status: ブラウズ完了の **全体の** 状態を表示します。 * 記録がある場合は、WUX 記録の状態を示します。 * [[:ja:documentation:03_monitoring:13_user_monitorization#pandora_fms_コンソールでの_web_分析モジュールの作成|パフォーマンステストの実行]]が有効になっており、記録が含まれていない場合、グローバルステータスモジュールの状態は、これらのモジュールの実行結果の状態になります。 * //module//_Global_Time: ブラウズ完了の **全体の** 所要時間を表示します。 * //module//_Global_Screenshot: ブラウズでエラーとなった画面キャプチャで、**エラーの場合のみ生成されます。** * //module//_Phase X: //フェーズ名//_Status: フェーズ X におけるブラウジングの状態を示します。 * //module//_Phase X: //フェーズ名//_Time: フェーズ X における所要時間を示します。 例: エラー画面スクリーンショット {{ :wiki:wux_screenshot.png?800 }} <WRAP center round important 60%> 注意: Pandora FMS 7.0NG 712 以前のバージョンからアップグレードした場合は、少し変更する必要があります。 </WRAP> WUXServer によって生成された画面キャプチャを保存するには、データベースにて次の操作を行う必要があります。 <code> alter table tagente_estado modify column datos mediumtext; alter table tagente_datos_string modify column datos mediumtext; </code> この操作を行わないと、全てのスクリーンショット見ることができない可能性があります エージェントの //WUX// セクションにアクセスすることによって、トランザクションとフェーズの追加の詳細を見ることができます。 {{ :wiki:wux_nueva_imagen.png }} ウェブサイトの統計情報は、以下の概念でまとめられています。 * **Stats_TT**: ウェブサイトの取得にかかるトータルの時間。 * **Stats_TDNS**: 対象の IP アドレスを名前解決するためにかかるトータルの時間。 * **Stats_TTCP**: TCP の接続にかかった時間。 * **Stats_TSSL**: SSL のネゴシエーションにかかった時間。 * **Stats_TST** : データ転送が開始されるまでにかかった時間。 * **Stats_TTC** : データ転送にかかった時間。すべての処理にかかった時間の合計です。 * **Stats_TTR** : ページのコンテンツの転送にかかった時間。 * **Stats_TTR_main**: HTML コードを転送するのにかかった時間。 * **Stats_TTR_image**: 画像(png|jpg|jpeg|bmp|tiff|gif|webp|svg)の転送にかかった時間。 * **Stats_TTR_css**: スタイルシートを転送するのにかかった時間。 * **Stats_TTR_js**: JavaScript ファイルを転送するのにかかった時間。 ==== ウェブ解析モジュールへのアラートの割り当て ==== ウェブ解析モジュールに関するアラートは、Pandora FMS の全体のアラートシステムと同様です。 互換性を保つため、次のようにウェブ分析モジュールによって生成されたサブ要素にアラートテンプレートを割り当てることをお勧めします。 * 全体のブラウジングの状態 * 時間閾値に関するアラート * 結果のスクリーンショットモジュールで、警告テンプレートを "常時" に設定したアラート ==== ダッシュボードの新たなウィジェット ==== ブラウジング情報を表示するための新たな 2つのウィジェットが追加されています。 ブラウジングのフェーズの状態ウィジェット。 {{ :wiki:widget_wux_fases.png }} ウェブサイトの統計ウィジェット。 {{ :wiki:widget_wux_stats.png }} ===== デスクトップ UX (PDR) ===== ==== PDR の展開 ==== PDR は Windows でのみ動作するように設計されています。Pandora エージェントで実行されるとき **プロセスモード** で実行する必要があります。サービスモードでは動作しません。デスクトップセッションのブロックはできませんので、仮想マシンの利用をお勧めします。 事前準備: * デスクトップモード、自動起動、自動ログインでの Windows OS 設定には以下を実行します: **Windows10® より前のバージョンの場合**: <code> control userpasswords2 </code> "このコンピュータを使うにはユーザ名とパスワードが必要(Users must enter a user name and password to use this computer)" のチェックを外します。 {{ :wiki:ux5.jpg?350 |ux5.jpg}} **Windows 10® の場合**: MS Windows® バージョン 10で自動起動を有効にする 1つの方法としては、Microsoft® ドキュメントの [[https://docs.microsoft.com/en-us/sysinternals/downloads/autologon ダウンロードセクション]] で入手可能な Sysinternals Powertoys を使用することです。そして、監視を実行するユーザを有効にします。次に例を示します。 {{ :wiki:autologon_enable_-_sysinternals.png?450 }} 環境設定するには、以下のディレクトリを作成します。 <code> C:\PDR </code> [[https://pandorafms.com/library/pdr-cmd-for-ux-monitoring/|https://pandorafms.com/library/pdr-cmd-for-ux-monitoring/]] から入手した ''PDR.rar'' ファイルを ''C:\PDR'' へ展開します。 ==== PDR セッションの記録 ==== レコーダーを起動するには、以下のスクリプトを実行します。 <code> C:\PDR\pdr </code> {{ :wiki:scriptwux22332.png }} 起動したら、レコーディング環境に入ります。 {{ :wiki:ux18.jpg?800 |ux18.jpg}} 実行するアクションを選択し、それらを適用する領域でスクリーンショットを実行します。 以下に、最も一般的な例を示します。 一般的なアクション: {{ :wiki:ux19.jpg |ux19.jpg}} フロー制御アクション: {{ :wiki:ux20.jpg |ux20.jpg}} このスクリプト言語の詳細は、[[http://sikulix-2014.readthedocs.io/en/latest/index.html|http://sikulix-2014.readthedocs.io/en/latest/index.html]] を参照してください。 プロジェクトが記録されると、次の要素を持つファイルが作成されます。 * 自動実行コードを含んだ .py ファイル * ウェブブラウザ制御イメージ 実行の簡単な例としては、Windows の電卓が正しく動作するかどうかを確認します。 一度に1つずつスライドさせる方法を見てみましょう。 1. "click" アクションを選択し、アクションをしたいエリアを選択します。画面が "エリア選択" モードに変わります。 {{ :wiki:ux21.jpg |ux21.jpg}} {{ :wiki:ux22.jpg |ux22.jpg}} 2. //type// アクションとテキスト "calc" を入力し、電卓が表示されるのを待ってクリックします。電卓が操作できるようになったら、次のようにアクションを入力します。 {{ :wiki:ux23.jpg |ux23.jpg}} 3. 関連する部分クリックし、以前と同様の領域を選択します。 4. 最後に、保存して **Run** をクリックして実行します。 重要な注意点: * 記録環境内の任意の画像をダブルクリックすると、クリックする場所を正確に選択するなど、コントロールキャプチャの詳細を調整できます。 * オペレーティングシステムの遅延によって実行が停止しないように、各クリックの間に「待機」アクションを入力することを強くお勧めします。 * レコーダーはスクリーンショットのような領域を探しますので、ボタンがその上に置かれているときに強調表示されているものがあれば特に注意する必要があります(たとえば、カーソルがそれらの上にあるときに電卓のボタンがオレンジ色に変わります)。 記録を保存したフォルダに、python ファイルと画像ファイルがあります。 {{ :wiki:ux24.jpg |ux24.jpg}} **注意:**次のコードを使用して、PDR レコーディングエンジンからによるキャプチャ内容をカスタマイズできます。 <code> ## OPTIONAL ##capture file names import shutil file = "C:\probes\screenshot_prueba.sikuli.png" focusWindow = App.focusedWindow() regionImage = capture(focusWindow) shutil.move(regionImage, file) </code> これは、指定したファイルに、指定した特定の時間のアクティブウインドウのスクリーンショットを作成します。 座標を使用してスクリーンショットをカスタマイズすることができます。次の構文を用います: <code> capture(x, y, w, h) </code> ここで、変数は以下の通りです。 X: horizontal position of the rectangle to take a screenshot on. Y: vertical position of the rectangle to take a screenshot on. W: Screenshot width. H: Screenshot height. X: キャプチャしたい領域の水平方向の位置 Y: キャプチャしたい領域の垂直方向の位置 W: キャプチャしたい幅 H: キャプチャしたい高さ === Pandora UX PDR でトランザクションセッションの記録 === 特別なセッションの記録は必要ありません。異なるスクリプトでセッションを記録するだけです。Pandora UX は、複雑なトランザクションの結果を返し整理します。次の段階では、正しく動作させるための実行の呼び出し方を見ていきます。 トランザクション処理を作成するために複数のレコーディングを行う場合は、記録時に探している要素が存在することに注意する必要があります。 単一のトランザクション処理ごとに、レコーディング内容を手動で実行することをお勧めします。手動で実行してみたあとに、アクションが期待どおりに行われるようにします。 次の例では、上記の例のプロセス次の段階を構成する記録プロセスを確認できます。電卓の結果をメモ帳にペーストします。以下に例を示します。 {{ :wiki:ux40.jpg |ux40.jpg}} ここでは、テキストファイルを特定の場所に保存し、前のファイルを上書きするという別の手順を示します。これにより、柔軟性が大幅に向上し、並行してファイルの監視が可能になり、ヘビー級のデスクトップアプリケーションに対するさまざまな情報を扱えます。この 3つ目のシーケンス例は、以下のステップからなります。 {{ :wiki:ux43.jpg |ux43.jpg}} ==== PDR セッションの実行 ==== === 標準実行 === あらかじめ記録した PDR セッションを起動するには、pdr.cmd ファイルを置いた場所とともに動作モードを指定します。このファイルの引数は "-r"、セッションガイドラインを含むファイル(-script)を指定し、スクリーンショットが保存されるディレクトリ(-folder)の指定は "\"で終了します。実行失敗時にスクリプトを再実行するための //-retries// オプションも利用できます。 次の実行では、スクリーンショットはアクティブウインドウのみが対象です。 <code> pandora_ux_x64 -exe C:\PDR\pdr -args -r -script C:\pandora_ux\calculadora.sikuli -folder C:\pandora_ux\ -ss_config active -retries 3 </code> 次のモジュールが返されます。 * UX_Time_project_name * UX_Status_project_name * UX_Control_Snapshot_project_name (初回の実行時のみ) フェーズでエラーが発生した場合は、次のモジュールが作成されます。 * UX_Snapshot_project_name エラー時には、アクティブウインドウの画像が表示されます(-ss_config が有効な場合)。 正常時の実行結果例: <code> <module> <name><![CDATA[UX_Status_calculadora.sikuli]]></name> <type>generic_proc</type> <![CDATA[1]]> <description><![CDATA[C:\pandora_ux\calculadora.sikuli execution completed Control snapshot rebuild ]]></description> <tags>UX</tags> <module_group>UX</module_group> </module> <module> <name><![CDATA[UX_Time_calculadora.sikuli]]></name> <type>generic_data</type> <![CDATA[20.204]]> <description><![CDATA[C:\pandora_ux\calculadora.sikuli execution completed Control snapshot rebuilt ]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_calculadora.sikuli</module_parent> </module> <module> <name><![CDATA[UX_Control_Snapshot_calculadora.sikuli]]></name> <type>async_string</type> <![CDATA[data:image/png;base64, IBCAIAAAAOCnfhAAAAAXNSR…/4x79e/7757f8H2C00s1C73yMAAAAASUVORK5CYII=]]> <description><![CDATA[Control image rebuilt]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_calculadora.sikuli</module_parent> </module> </code> エラー時の実行結果例: <code> <module> <name><![CDATA[UX_Status_std.html]]></name> <type>generic_proc</type> <![CDATA[0]]> <description><![CDATA[Failed to execute verifyText]]></description> <tags>UX</tags> <module_group>UX</module_group> </module> <module> <name><![CDATA[UX_Time_std.html]]></name> <type>generic_data</type> <![CDATA[15.463]]> <description><![CDATA[Failed to execute verifyText]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_std.html</module_parent> </module> <module> <name><![CDATA[UX_Snapshot_std.html]]></name> <type>async_string</type> <![CDATA[data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]> <description><![CDATA[Image (last error)]]></description> <tags>UX</tags> <module_group>UX</module_group> <module_parent>UX_Status_std.html</module_parent> </module> </code> すべて問題なければ、Windows マシンの Pandora FMS エージェントのプラグインとしてコマンド設定を行います。以下に例を示します。(1行です) <code> module_plugin C:\Users\artica\Documents\Product\UX-Trans\ux\pandora_ux_x64.exe -exe C:\PDR\pdr.bat -args -r -script C:\PDR\calc.sikuli -folder C:\PDR\ -ss_config active -checkpoint -post "taskkill /F /IM calc.exe" </code> ご覧の通り、実行にはオプションが追加されています。パラメータ //--checkpoint// は、エラーが無かったとしても最終結果のスクリーンショットを表示します。//-post// は、セッションの実行が完了した後にアクションを実行します。この場合、ウインドウを多重に開くなどを防ぐために、電卓のプロセスを終了します。 エージェントに //module_plugin// の設定ができたら、プロセスモードでの起動準備完了です。管理者権限のコマンドラインから以下を実行します。 <code> "%ProgramFiles%\pandora_agent\PandoraAgent.exe" --process </code> "PandoraAgent.exe" の場所はインストールに依存します。 起動すると、どのようにアクションが記録に従って自動的に実行されるかを見ることができます。ここからは、**エージェントのプロセスは終了してはいけません。** また、リモートデスクトップで開始したセッションや実行は中断してはいけません。マシンには触れない状態にしておきます。これが、仮想マシンが必要である理由です。 {{ :wiki:imagen_nueva_pdr.png }} <WRAP center round tip 60%> 他の自動監視のテストがある場合、次のようにしてPandora FMS に読み込むことができます。 </WRAP> <code> pandora_ux.64 -exe <exe of the automation system> -args <system arguments> -script <test file path> </code> * ''<exe of the automation system>'': exe (executable) of the automation system. * ''<system arguments>'': System arguments. * ''<test file path>'': Test file path. * ''<exe of the automation system>'': 自動化システムの exe (実行可能ファイル)。 * ''<system arguments>'': システムの引数。 * ''<test file path>'': テストファイルのパス。 === トランザクションベースの実行 === いろいろな処理が記録され、正しく機能することが確認されたら、PDR で以下を実行します。 <code> C:\Users\artica\Documents\Product\UX-Trans\ux\pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t calculadora_trans -script C:\PDR\calc.sikuli,C:\PDR\savecalc.sikuli,C:\PDR\savefile.sikuli -folder C:\PDR\ -ss_config active </code> 見ての通り、//-scrit// のパラメータで新たなスクリプトの場所を指定する必要があるだけです。前のスクリプトとはカンマで区切ります。また、**-t** パラメータですべての異なるフェーズをカバーするトランザクションの名前を指定します。より多くのフェーズがあったとしても設定の考え方は同じです。以下に例を示します。 <code> pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t proceso_transaccional -script C:\PDR\script1,C:\PDR\script2,C:\PDR\script3,C:\PDR\script4 -folder C:\PDR\ -ss_config active </code> この例では、次の行をエージェントの設定ファイルに追加します。 <code> module_plugin C:\Users\artica\Documents\Product\UX-Trans\ux\pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -t calculadora_trans -script C:\PDR\calc.sikuli,C:\PDR\savecalc.sikuli,C:\PDR\savefile.sikuli -folder C:\PDR\ -ss_config active -checkpoint -post "taskkill /F /IM calc.exe" </code> //-checkpoint// パラメータで、それぞれのフェーズの最終スクリーンショットを Pandora コンソールに表示することができます。 フェーズごとに、以下のモジュールが返ります。 * UX_Time_project_name.phase_order * UX_Status_project_name.phase_order フェーズでエラーになった場合は、次のモジュールが作成されます。 * UX_Snapshot_project_name.phase_order エラーの場合は、エラーが発生した時点の画像が表示されます。 次の名前で全体のまとめのモジュールも返されます。 * UX_Global_Time_project_name * UX_Global_Status_project_name * UX_Global_Snapshot_project_name エージェントがプロセスモードで動き、モジュールを Pandora FMS が受け取ると、コンソールで見ることができます。繰り返しになりますが、//階層モード// で、モジュール間の関係とフェーズ間の区切りがわかりやすく表示されます。 {{ :wiki:ux41.jpg?800 |ux41.jpg}} フェーズとタイムチャートの詳細は、トランザクションの画面で見ることができます。 {{ :wiki:ux42.jpg?800 |ux42.jpg}} エラーのスクリーンショットは、UX クライアント(PWR)と PWR サーバが共に同じマシンで動作しているときにのみ表示されます。そうでない場合は、Pandora で画像を表示するために、PWR サーバの画像配布ディレクトリがクライアントからアクセスできる必要があります。 同じモジュールを使用して、アラートを作成し、システムの時間経過に伴う変化を表示するために、履歴表示やグラフ生成ができます。 システムを再起動したときなどに実行の中断を避けるために、システムが起動したときに、Pandora エージェントをプロセスモードで起動させるプログラムタスクを作成することと、パスワード無しでマシンへ自動ログインし、エージェントが確実に実行されるようにすることをお勧めします。 {{ :wiki:ux26.jpg |ux26.jpg}} {{ :wiki:ux27.jpg?800 |ux27.jpg}} {{ :wiki:ux28.jpg |ux28.jpg}} {{ :wiki:ux29.jpg |ux29.jpg}} {{ :wiki:ux30.jpg |ux30.jpg}} {{ :wiki:ux31.jpg |ux31.jpg}} {{ :wiki:ux32.jpg |ux32.jpg}} これにより、対象の Windows インスタンスでは、マシンが再起動しても Pandora FMS エージェントが常にプロセスモードで実行され、常にPDR プローブによって収集されたデータを送信できることが保証されます。 さまざまなデスクトップシステムでは問題が発生する可能性があります。そのため、前述の設定を使い、デスクトップモードで自動起動を単一のデスクトップ使用することをお勧めします。 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/monitoring/13_user_monitorization.txt 最終更新: 2025/02/14 08:23by junichi