| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン |
| ja:documentation:pandorafms:monitoring:13_user_monitorization [2025/07/19 22:33] – [Pandora FMSによるWUXの紹介] junichi | ja:documentation:pandorafms:monitoring:13_user_monitorization [2026/08/07 21:57] (現在) – [パラメータと設定] junichi |
|---|
| <WRAP center round download 90%> | <WRAP center round download 90%> |
| |
| https://pandorafms.com/library/selenium-4-discovery/ | [[https://marketplace.pandorafms.com/entries/pandorafms.selenium.4]] |
| |
| </WRAP> | </WRAP> |
| === 手動実行(エージェントから、プラグインとして) === | === 手動実行(エージェントから、プラグインとして) === |
| |
| 手動実行のために、Selenium 4 プラグインをホストする Pandora FMS サーバ内に、[[:en:documentation:pandorafms:monitoring:02_operations|ソフトウェアエージェント]]を設定することができます。 | For manual execution you may configure a [[:en:documentation:pandorafms:monitoring:02_operations|EndPoint]] within Pandora FMS server itself that hosts the Selenium 4 plugin to perform these executions and to generate XML files for each one of them, to obtain different agents, each one with its corresponding modules. |
| | |
| | 手動で実行するには、Pandora FMS サーバ自体に Selenium 4 プラグインをホストする [[:ja:documentation:pandorafms:monitoring:02_operations|エンドポイント]] を設定して実行し、それぞれに対して XML ファイルを生成して、それぞれに対応するモジュールを持つ異なるエージェントを設定できます。 |
| | |
| | To do this, the Selenium 4 plugin may be configured as an agent plugin **using absolute paths**, so that the path to the plugin file and the necessary configuration files may be indicated. |
| |
| これを行うために、Selenium 4 プラグインは、プラグインファイルへのパスと必要な設定ファイルを示すことができるように、エージェントプラグインとして **絶対パス** を使って設定することができます。 | これを行うために、Selenium 4 プラグインは、プラグインファイルへのパスと必要な設定ファイルを示すことができるように、エージェントプラグインとして **絶対パス** を使って設定することができます。 |
| |
| <WRAP center round box 90%> | <WRAP center round box 90%> |
| | <font inherit/Courier New,Courier,monospace;;inherit;;inherit>module_plugin /var/spool/pandora/data_in/discovery/pandorafms.selenium.4/bin/pandora_selenium -c /path/to/configuration/file -s /path/to/side/file -t task_name -i agent_interval -g ID_group -x</font> |
| <font inherit/Courier New,Courier,monospace;;inherit;;inherit> | |
| module_plugin /var/spool/pandora/data_in/discovery/pandorafms.selenium.4/bin/pandora_selenium -c /パス/への/構成/ファイル -s /パス/への/side/ファイル -t タスク名 -i エージェント間隔 -g ID_グループ -x | |
| </font> | |
| |
| </WRAP> | </WRAP> |
| {{ :wiki:pfms-wux_4-image_240.png }} | {{ :wiki:pfms-wux_4-image_240.png }} |
| |
| Pandora FMS と同じサーバにインストールされていないソフトウェアエージェントからプラグインを実行することも可能です。 このためには、ソフトウェアエージェントをホストしているサーバーで、プラグインの''.disk''パッケージをローカルにダウンロードし、そのフォーマットを''.zip''に変更するために名前を変更し、バイナリおよび動作に必要な残りのファイルにアクセスするためにコンテンツを解凍する必要があります。 | If you wish, it is also possible to execute the plugin from a EndPoint that **is not** installed in the same server as Pandora FMS. For that, it is necessary to download locally in the server that hosts the EndPoint the ''.disk'' package of the plugin, rename it to modify its format to ''.zip'' and decompress the content to have access to the binary and to the rest of the files that it may need to work. |
| | |
| | 必要に応じて、Pandora FMS と同じサーバにインストールされていないエンドポイントからプラグインを実行することも可能です。そのためには、エンドポイントをホストしているサーバにプラグインの ''.disk'' パッケージをローカルにダウンロードし、名前を ''.zip'' に変更して内容を解凍し、バイナリと動作に必要なその他のファイルにアクセスできるようにする必要があります。 |
| |
| また、''-x'' パラメータで XML 形式のデータを送信し、''-S'' パラメータで XML を受信する Tentacle サーバの IP アドレスとポートを指定します。 実行は以下のようになります: | また、''-x'' パラメータで XML 形式のデータを送信し、''-S'' パラメータで XML を受信する Tentacle サーバの IP アドレスとポートを指定します。 実行は以下のようになります: |
| |
| <WRAP center round box 90%> | <WRAP center round box 90%> |
| | <font inherit/Courier New,Courier,monospace;;inherit;;inherit>module_plugin /path/to/binary/file/pandora_selenium -c /path/to/configuration/file -s /path/to/side/file -t task_name -i agent_interval -g ID_group -x -S IP_address_Tentacle_server:Tentacle_port</font> |
| <font inherit/Courier New,Courier,monospace;;inherit;;inherit> | |
| module_plugin /パス/への/バイナリ/ファイル/pandora_selenium -c /パス/への/構成/ファイル -s /パス/への/side/ファイル -t タスク名 -i エージェント間隔 -g ID_グループ -x -S IP_住所_Tentacle_サーバー:Tentacle_ポート | |
| </font> | |
| |
| </WRAP> | </WRAP> |
| <WRAP center round tip 90%> | <WRAP center round tip 90%> |
| |
| 最後に、この種の実行は、端末から手動で実行することも、ソフトウェア・エージェントから実行することも可能であるが、**常にディスカバリーPFMSセクションから実行することを推奨する**ことに留意すべきである。 | Finally, it should be noted that, although it is possible to perform this type of executions, either manually from the terminal or from the EndPoint, **the recommendation is to always carry them out** from PFMS Discovery section, since the original operation method is designed to work in this way, and the task configuration is considerably simpler. |
| | |
| | </WRAP> |
| | |
| | <WRAP center round tip 90%> |
| | |
| | 最後に、このタイプの実行は、ターミナルから手動で実行することも、エンドポイントから実行することもできますが、元々自動検出で動作するように設計されておりタスク設定がかなり簡単になるので、**常に PFMS 自動検出から実行することをお勧めします** 。 |
| |
| </WRAP> | </WRAP> |
| |
| <wrap #ks4 /> | <wrap #ks4 /> |
| | |
| ===== パラメータと設定 ===== | ===== パラメータと設定 ===== |
| |
| |
| <file> | <file> |
| | |
| { | { |
| "worker_mode" : "<local | remote>", | "worker_mode" : "<local | remote>", |
| "browser_height" : "<height>", | "browser_height" : "<height>", |
| "global_timeout" : "<seconds>", | "global_timeout" : "<seconds>", |
| "wait_between_commands" : "<seconds>" | "wait_between_commands" : "<seconds>", |
| | "phase_summarize" : "<1 | 0>", |
| | "legacy_data_structure" : "<1 | 0>", |
| | "legacy_data_agent_name" : "<agent_name>", |
| | "legacy_data_agent_group" : "<group_name>" |
| } | } |
| | |
| </file> | </file> |
| |
| コンフィギュレーションの各要素: | Each configuration element: |
| | |
| | 設定の各要素: |
| | |
| | |''worker_mode'' |It indicates whether the transaction will be launched locally or remotely. | |
| | |''run_mode'' |It indicates whether the plugin will run with drivers or in Docker. | |
| | |''browser'' |It indicates the web browser to be used for the transaction. | |
| | |''driver_url'' |It indicates the URL to Selenium 4 server \\ to execute the transaction. \\ Only in ''remote/driver'' mode. | |
| | |''ssh_address'' |It indicates the IP address of the server to which it will connect by SSH to execute the plugin. \\ Only in ''remote/docker'' mode. | |
| | |''ssh_port'' |**Optional**. \\ It indicates the port number for SSH connection. \\ By default: ''22''. \\ Only in ''remote/docker'' mode. | |
| | |''ssh_user'' |It specifies the user for SSH connection. \\ Only in ''remote/docker'' mode. | |
| | |''ssh_password'' |It indicates the user's password ''ssh_user''. \\ Only in ''remote/docker'' mode. | |
| | |''ssh_password_encrypt'' |**Optional**. \\ It indicates whether the above password is sent encrypted (''1'') or not (''0''). \\ Only in ''remote/docker'' mode. \\ Passwords may be encrypted by executing \\ the plugin from Pandora FMS Discovery server. | |
| | |''ssh_temp_folder'' |**Optional**. \\ It specifies the path to the temporary directory for the necessary files \\ during execution on the SSH server. \\ By default: ''/tmp''. \\ Only in ''remote/docker'' mode. | |
| | |''docker_image'' |**Optional**. \\ It indicates the name of the Docker image to run the transaction. \\ By default: ''pandorafms/pandora_selenium_headless''. \\ Only in ''docker'' mode. | |
| | |''chromedriver_path'' |**Optional**. \\ It specifies the path to ''chromedriver'' binary.((Default: ''/usr/share/pandora_server/util/selenium_headless_drivers/chromedriver'')) \\ Only in ''local/driver'' mode. | |
| | |''chrome_binary_path'' |**Optional**. \\ It specifies the path to Google Chrome binary.((Default: ''/usr/share/pandora_server/util/selenium_headless_drivers/chrome/google-chrome'')) \\ Only in ''local/driver'' mode. | |
| | |''chrome_user_data_dir'' |**Optional**. \\ It specifies the path to the data directory (''data dir'') of Google Chrome that you wish to use. | |
| | |''chrome_profile'' |**Optional**. \\ It specifies the name of the Google Chrome profile to be used. \\ It must be inside the ''data_dir''. \\ If not specified, the browser's default profile will be used. | |
| | |''geckodriver_path'' |It specifies the path to the ''geckodriver'' binary.((Default: ''/usr/share/pandora_server/util/selenium_headless_drivers/geckodriver'')) \\ Only in ''local/driver'' mode.| |
| | |''firefox_binary_path'' |It specifies the path to the Mozilla Firefox binary.((Default: ''/usr/share/pandora_server/util/selenium_headless_drivers/firefox/firefox'')) \\ Only in ''local/driver'' mode. | |
| | |''firefox_profile'' |**Optional**. \\ It specifies the path to Mozilla Firefox profile directory you wish to use. \\ If not specified, the browser's default profile will be used. | |
| | |''accept_insecure_certs'' |**Optional**. \\ If set to ''1'', insecure SSL certificates from URLs accessed \\ during the transaction will be automatically accepted as valid. | |
| | |''monitor_stats'' |**Optional**. \\ If it is indicated with value ''1'', connection statistics modules \\ will be generated to the main URL of the indicated SIDE file. | |
| | |''browser_width'' |**Optional**. \\ It indicates the width of the web browser in pixels for the transaction. \\ By default: ''1920''. | |
| | |''browser_height'' |**Optional**. \\ It indicates the height of the browser in pixels for the transaction. \\ By default: ''1080''. | |
| | |''global_timeout'' |**Optional**. \\ It indicates the global timeout in seconds for tasks performed by the plugin, \\ such as connecting to Selenium server, starting browser drivers, etc. \\ It is also the default timeout used for Selenium commands to be executed. \\ By default: ''5''. | |
| | |''wait_between_commands'' |**Optional**. \\ It indicates the time in seconds that the plugin \\ will wait between each SIDE command it executes. \\ This value may be adjusted with the SIDE itself \\ by means of the ''setSpeed'' command. \\ By default: ''0''. | |
| | | ''phase_summarize'' | **Optional**. \\ Sets the transaction’s Global_Time as the sum of the Time modules for all phases. | |
| | | ''legacy_data_structure'' | **Optional**. \\ Enables the renaming of modules created in the transaction that used Selenium 3. Useful for migrating tasks from Selenium 3 to Selenium 4 and reporting on modules that already existed. | |
| | | ''legacy_data_agent_name'' | **Optional**. \\ If ''legacy_data_structure'' is enabled, the name of the agent to which the task will report. | |
| | | ''legacy_data_agent_group'' | **Optional**. \\ If ''legacy_data_structure'' is enabled, the name of the group to which the agent to which the task will report will belong. | |
| |
| | ''worker_mode'' | トランザクションがローカルで開始されるか、リモートで開始されるかを示す。 | | | ''worker_mode'' | トランザクションがローカルで開始されるか、リモートで開始されるかを示す。 | |
| | ''browser_height'' | **オプション**. \\ トランザクションのブラウザの高さをピクセル単位で示す。 \\ デフォルト: ''1080''. | | | ''browser_height'' | **オプション**. \\ トランザクションのブラウザの高さをピクセル単位で示す。 \\ デフォルト: ''1080''. | |
| | ''global_timeout'' | **オプション**. \\ プラグインが実行するタスクのグローバルタイムアウトを秒単位で示します。 \\ また、Seleniumコマンドが実行される際のデフォルトのタイムアウトでもあります。 \\ デフォルト: ''5''. | | | ''global_timeout'' | **オプション**. \\ プラグインが実行するタスクのグローバルタイムアウトを秒単位で示します。 \\ また、Seleniumコマンドが実行される際のデフォルトのタイムアウトでもあります。 \\ デフォルト: ''5''. | |
| | ''wait_between_commands'' | **オプション**. \\ プラグインがSIDEコマンドを実行するまでの待機時間を秒単位で示します。 \\ この値はSIDE本体で''setSpeed''コマンドにより調整可能。 \\ デフォルト: ''0''. | | | ''wait_between_commands'' | **オプション**. \\ プラグインが SIDE コマンドを実行するまでの待機時間を秒単位で示します。 \\ この値は SIDE 本体で ''setSpeed'' コマンドにより調整可能。 \\ デフォルト: ''0''. | |
| | | ''phase_summarize'' | **オプション**。 \\ トランザクションの Global_Time を、すべてのフェーズの Time モジュールの合計値として設定します。 | |
| | | ''legacy_data_structure'' | **オプション**。 \\ Selenium 3 を使用して作成されたトランザクション内のモジュールの名前変更を有効にします。Selenium 3 から Selenium 4 へタスクを移行する場合や、既存のモジュールに関するレポートを作成する場合に役立ちます。 | |
| | | ''legacy_data_agent_name'' | **オプション**。 \\ ''legacy_data_structure'' が有効な場合、タスクがレポートを送信するエージェントの名前を指定します。 | |
| | | ''legacy_data_agent_group'' | **オプション**。 \\ ''legacy_data_structure'' が有効な場合、タスクがレポートを送信するエージェントが所属するグループの名前を指定します。 | |
| |
| 例えば、こうだ: | 例: |
| |
| <file> | <file> |
| ===== .SIDEファイル用コマンド ===== | ===== .SIDEファイル用コマンド ===== |
| |
| 追加モジュールを生成するために、以下のカスタムコマンドを設定することができます。 ''<nowiki>//</nowiki>''): | The following custom commands may be configured to generate additional modules (all custom commands must begin with ''<nowiki>//</nowiki>''): |
| | |
| | 追加のモジュールを生成するために、次のカスタムコマンドを設定できます (すべてのカスタムコマンドは ''<nowiki>//</nowiki>'' で始まる必要があります)。 |
| | |
| | |''<nowiki>//phase_start:<phase_name></nowiki>'' |It indicates the beginning of a stage, which will \\ last until another ''<nowiki>//phase_start</nowiki>'' command is found \\ or until the end of the test. \\ This will generate a module with the status of the stage and another module with the time it has taken to complete. \\ For example: ''<nowiki>//phase_start:Login</nowiki>'' | |
| | |''<nowiki>//getValue;<module_name>;<module_type>;<regexp></nowiki>'' |It generates a module with content from the web page \\ which may be obtained by means of a regular expression \\ from the source code of the web page. \\ For example: \\ ''<nowiki>//getValue;Temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span></nowiki>'' \\ You would get the temperature indicated on a web page with this line in its source code: \\ ''<nowiki><p> The temperature of the solar panel is: <span class="temperature">54 º C</span></p></nowiki>'' | |
| | |''<nowiki>//getVariable;<module_name>;<module_type>;<variable></nowiki>'' |It generates a module with the content \\ of a variable stored in the SIDE with the following ''store'' commands. \\ For example: \\ ''<nowiki>//getVariable;List count;generic_data;listCount</nowiki>'' | |
| | |''<nowiki>//getScreenshot;<module_name></nowiki>'' |It generates a module with a screenshot of the current browser. \\ For example: \\ ''<nowiki>//getScreenshot;URL home</nowiki>'' | |
| |
| | ''<nowiki>//phase_start:<phase_name></nowiki>'' | フェーズの開始を示す。このフェーズは、別の''<nowiki>//phase_start</nowiki>''コマンドが見つかるか、 テストが終了するまで続く。 \\ これは、フェーズのステータスを示すモジュールと、完了までにかかった時間を示す別のモジュールを生成する。 \\ 例えば、こうだ: ''<nowiki>//phase_start:Login</nowiki>'' | | | ''<nowiki>//phase_start:<phase_name></nowiki>'' | フェーズの開始を示す。このフェーズは、別の''<nowiki>//phase_start</nowiki>''コマンドが見つかるか、 テストが終了するまで続く。 \\ これは、フェーズのステータスを示すモジュールと、完了までにかかった時間を示す別のモジュールを生成する。 \\ 例: ''<nowiki>//phase_start:Login</nowiki>'' | |
| | ''<nowiki>//getValue;<module_name>;<module_type>;<regexp></nowiki>'' | ウェブページのソースコードから正規表現で得られるウェブページの内容を含むモ ジュールを生成する。 \\ 例えば、こうだ: \\ ''<nowiki>//getValue;Temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span></nowiki>'' \\ ソースコードにこの行があるウェブページでは、温度が表示される: \\ ''<nowiki><p> The temperature of the solar panel is: <span class="temperature">54 º C</span></p></nowiki>'' | | | ''<nowiki>//getValue;<module_name>;<module_type>;<regexp></nowiki>'' | ウェブページのソースコードから正規表現で得られるウェブページの内容を含むモ ジュールを生成する。 \\ 例: \\ ''<nowiki>//getValue;Temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span></nowiki>'' \\ ソースコードにこの行があるウェブページでは、温度が表示される: \\ ''<nowiki><p> The temperature of the solar panel is: <span class="temperature">54 º C</span></p></nowiki>'' | |
| | ''<nowiki>//getVariable;<module_name>;<module_type>;<variable></nowiki>'' | 以下の''store''コマンドで、SIDEに格納された変数の中身をモジュールとして生成する。 \\ 例えば、こうだ: \\ ''<nowiki>//getVariable;List count;generic_data;listCount</nowiki>'' | | | ''<nowiki>//getVariable;<module_name>;<module_type>;<variable></nowiki>'' | 以下の''store''コマンドで、SIDEに格納された変数の中身をモジュールとして生成する。 \\ 例: \\ ''<nowiki>//getVariable;List count;generic_data;listCount</nowiki>'' | |
| | ''<nowiki>//getScreenshot;<module_name></nowiki>'' | 現在のブラウザのスクリーンショットを含むモジュールを生成します。 \\ 例えば、こうだ: \\ ''<nowiki>//getScreenshot;URL home</nowiki>'' | | | ''<nowiki>//getScreenshot;<module_name></nowiki>'' | 現在のブラウザのスクリーンショットを含むモジュールを生成します。 \\ 例: \\ ''<nowiki>//getScreenshot;URL home</nowiki>'' | |
| |
| プラグインで実行可能なSIDEファイルのコマンドは以下の通りです(使用方法についてはSelenium IDEのドキュメントを参照してください): | プラグインで実行可能なSIDEファイルのコマンドは以下の通りです(使用方法についてはSelenium IDEのドキュメントを参照してください): |
| |
| <wrap #ks6 /> | <wrap #ks6 /> |
| ===== ウェブ・スクラッピング ===== | ===== ウェブスクレーピング ===== |
| |
| Pandora FMSでウェブスクラッピングを行うことは、複雑なトランザクションのパフォーマンスや結果を測定するために設計されたものですが、実現可能です。 | Pandora FMSでウェブスクラッピングを行うことは、複雑なトランザクションのパフォーマンスや結果を測定するために設計されたものですが、実現可能です。 |