Difference between revisions of "Pandora: Documentation en: User Monitorization"

From Pandora FMS Wiki
Jump to: navigation, search
(Installation on Linux)
(Commands)
 
(63 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
  
User experience monitoring consists of making recordings of automated tasks for both web browsing and interaction with the desktop and Windows system applications. These recordings can consist of a click of a mouse on a browser, write a text and perform a search in web browsing, such as being able to open an application on the desktop. This will allow us to perform the recorded functions automatically and run to get results, such as time spent on tasks. To do this we have automated UX monitoring and monitoring user web experience (WUX).
+
User experience monitoring consists of recording automated tasks both for <b>web browsing</b> (PWR / WUX) and for interacting with <b>Windows desktop and system applications</b> (PDR). These recordings can consist of a mouse click on a browser, writing a text, searching throughout the Internet or opening an application on the desktop. This will allow you to perform the recorded functions automatically and they will be executed to obtain results, such as the time spent performing the tasks. To that end, there is automated UX monitoring and user web experience (WUX) monitoring.
  
From Pandora FMS version 7.0NG.728, the UX and WUX monitors have been merged inside Pandora FMS console, having both functionalities in only one screen.
+
From Pandora FMS version 7.0NG.728, UX and WUX monitoring have been merged with Pandora FMS console, offering both features on a single screen.
 
   
 
   
 
<center>
 
<center>
Line 9: Line 9:
 
</center>
 
</center>
  
Next, we will see the differences between the WUX and UX systems and the description of both functionalities with their different possibilities.
+
Next, we will see the differences between WUX and UX systems and the description of both features along with the different possibilities they offer.
  
==Differences between UX and WUX monitoring==
+
= Differences between UX and WUX monitoring =
  
Both monitoring systems are used for the execution of automated web browsing tasks through Pandora Web Robot Daemon (PWRD) system.
+
Both monitoring systems are used to execute automated web browsing tasks using Pandora Web Robot Daemon (PWRD) system.  
 
The UX system carried out these monitoring by means of the software agent installed in a machine, while the WUX monitoring is based on a server integrated inside Pandora FMS.
 
  
Pandora Web Robot Daemon (PWRD) is a service that provides the necessary tools to automate web browsing sessions. For it uses a file that contains a list of the necessary actions to navigate through the user's web portal.
+
The <b>UX</b> system performs these monitoring tasks using the software agent installed on a machine, while <b>WUX</b> monitoring is based on a server integrated within Pandora FMS.
  
Additionally, UX monitoring allows the execution of automated tasks that interact with the desktop and Windows system applications. This type of tasks cannot be performed with WUX.
+
Pandora Web Robot Daemon (PWRD) is a service that provides the necessary tools to automate web browsing sessions. To do it, it uses a file that contains a list of the actions necessary to navigate the user's web portal.
  
= Automated UX monitoring =
+
Additionally, UX monitoring enables the execution of the automated tasks that interact with Windows desktop and system applications. These types of tasks cannot be performed with WUX.
  
== Introduction ==
+
Pandora FMS UX is a system that executes automated tasks, giving Pandora FMS a report with the execution results, time spent and screenshots with the errors that may be found.
  
Pandora UX is an automated task-execution system that subsequently reports the results of executions and chronometries to Pandora FMS, and also includes screenshots of possible errors, to provide more intuitive, visually-oriented feedback.  
+
Pandora FMS PWR technology for UX allows browsing websites, simulating user actions. You may check content, texts, etc. It is the perfect choice for monitoring non-flash-based web sites and applications. Its advantage: it is faster and offers the possibility of running in the background.
  
Pandora UX employs two default technologies for automatizing tasks:
+
If you have a task automation system, Pandora FMS UX also allows you to execute the scripts you already have and monitor their execution.
  
* Pandora Web Robot (PWR): which permits web navigation and replicates user actions. It checks contents, texts, etc. and is ideal for monitoring sites and apps not based on flash. Pros: quicker, can run in the background.
+
It is important to specify the use of this type of monitoring. Both methods are based on monitoring execution by means of a plugin in the software agents installed in the corresponding machines.
  
* Pandora Desktop Robot (PDR): replicates user-interactions with Windows. Pandora UX launches prepared scripts using this tool, allowing for more advanced and specific monitoring. E.g., plugins can be deployed on hardware and connect to distinct networks to check that what users would see is functioning correctly. Its principal use is to monitor heavy desktop apps.
+
<br>
  
As can be seen, there is a big difference between the two automation methods. While the PWR method is based on the automated navigation of a user through a website performing the tasks determined in the recording, the PDR method can interact with different operating system tools as if a user were running them. In short, one is based on web browsing, and the other is based on running different desktop applications.
+
{{Tip|For web transaction execution, use Selenium Engine.}}
 +
<br>
  
If your system already has automated task-execution Pandora UX can still be used to execute pre-existing scripts and also to monitor their execution.
+
= Web User Experience (WUX) with Selenium 3 =
 +
<br>
 +
For Selenium deployment on WUX servers, a container-based stack will be used for fast deployment and easy scaling.  
  
It is important to specify the use of this type of monitoring. Both methods are based on the execution of the monitoring by means of plugin in the software agents installed in the corresponding machines.
+
== Previous settings ==
  
== WEB UX (PWR) ==
+
Docker and Docker Compose must be previously installed and we recommend using CentOS as the base operating system.
=== PWR deployment ===
 
  
Pandora UX set-up.
+
For this installation, we recommend following the Docker documentation at: https://docs.docker.com/engine/install/
  
==== Selenium server deployment on Windows ====
+
The official Selenium images will be used for the installation and deployment of the stack. You may find them at: https://hub.docker.com/u/selenium
  
Prerequisites:
+
Different images with browsers are available in the Selenium repository. For Pandora FMS, we recommend Firefox and Chrome containers.  
* Install Java 1.8. on the machine that's going to provide the service
 
* Firefox 43.0.1 (download at https://ftp.mozilla.org/pub/firefox/releases/43.0.1/).
 
* Firefox profile to check automatized sessions (optional): http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
 
* Create the directories:
 
C:\PWR
 
C:\probes
 
  
To download the PWR_Server.zip go to: ''https://pandorafms.com/library/pwr-server-for-ux-monitoring/''
+
== Selenium Stack Deployment ==
  
Create file distribution:
+
To deploy the Selenium stack, it will be necessary to first create a <b>YAML</b> file with the necessary configuration:  
* File decompression PWR_Server.zip a C:\PWR\
 
* Export Firefox profile to C:\PWR\profile
 
  
Using a profile to carry out checks '''is optional''', but recommendable in case of using proxies or password autofill.
+
# To execute this docker-compose yml file, use `docker-compose -f <file_name> up`
To create a Firefox profile follow the steps in the following screenshots:
+
# Add the `-d` flag at the end for detached execution
 +
version: "3"
 +
services:
 +
  selenium-hub:
 +
    image: selenium/hub:3.141.59-zinc
 +
    container_name: selenium-hub
 +
    ports:
 +
      - "4444:4444"
 +
    environment:
 +
      - GRID_BROWSER_TIMEOUT=60000
 +
      - GRID_TIMEOUT=60000
 +
      - GRID_MAX_SESSION=50
 +
      - GRID_CLEAN_UP_CYCLE=60000
 +
      - GRID_UNREGISTER_IF_STILL_DOWN_AFTER=180000
 +
      - GRID_NEW_SESSION_WAIT_TIMEOUT=60000
 +
  chrome:
 +
    image: selenium/node-chrome:3.141.59-zinc
 +
    volumes:
 +
      - /dev/shm:/dev/shm
 +
    depends_on:
 +
      - selenium-hub
 +
    environment:
 +
      - HUB_HOST=selenium-hub
 +
      - HUB_PORT=4444
 +
  firefox:
 +
    image: selenium/node-firefox:3.141.59-zinc
 +
    volumes:
 +
      - /dev/shm:/dev/shm
 +
    depends_on:
 +
      - selenium-hub
 +
    environment:
 +
      - HUB_HOST=selenium-hub
 +
      - HUB_PORT=4444
  
[[File:ux1.JPG|center]]
+
It can be saved as <i>docker-compose.yml</i> to make identifying it easier.  
[[File:ux2.JPG|center]]
 
  
Choose directory address:
+
To activate the container with the defined settings, just run the following command:  
  
[[File:ux3.JPG|center]]
+
docker-compose -f <compose-file> up -d
  
Start Firefox with the new profile to customize options such as proxies, popups, etc.:
+
If you need to check the services running in the container, use the following command:  
  
[[File:ux4.JPG|center]]
+
docker-compose -f <compose-file> ps
  
Install the service by executing BAT file ''service_installer.bat'' provided. For a correct operation of the service_installer.bat we will have to modify the content, putting the paths that exist in the file as we have them installed in our machine. For example, in the case of java, it can only serve as java if we have correctly configured the PATH of it, otherwise we will have to give it all the PATH inside the file. Finally initiate the service:
+
To see the status and logs of Selenium services, use the following command:  
  
  net start PWRSRV
+
  docker-compose -f <compose-file> logs
  
The Selenium server is now running. It can also be manually executed (after interrupting the service) in order to ''debug''. Use the command:
+
Once the appropriate checks have been made, to verify the grid works properly and the workers have signed up as you defined in the configuration file, go to the following URL:  
  
  java -jar selenium-server-standalone-2.53.0.jar -firefoxProfileTemplate C:\selenium\firefox_profile -port 4444 -v
+
  http://<ip_selenium_server>:4444/grid/console
  
==== Selenium server deployment on Linux ====
 
  
Prerequisites:
+
<center>
* Install Java 1.8 on the machine that's going to provide the service.
+
[[File:newux4.png]]
* Firefox 43.0.1 (download at https://ftp.mozilla.org/pub/firefox/releases/43.0.1/).
+
</center>
* Firefox profile to check automatized sessions (optional): http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
 
* Install xorg-x11-server-xvfb.
 
* Install java.
 
  
 +
If you need to scale the number of workers, just run the following command:
  
To install the dependencies from the repositories:
+
docker-compose -f <compose-file> scale chrome=X firefox=Y
  
yum install xorg-x11-server-Xvfb
+
=== Upload pwrd images from ISO ===
yum install java
 
  
 +
If you do not have Internet access to connect to Docker Hub servers and download the images, you will find everything you need in Pandora FMS ISO.
  
If it's not in the repositories, the rpm file can be found at the following link:
+
The steps to be followed are:  
ftp://rpmfind.net/linux/centos/6.9/os/x86_64/Packages/xorg-x11-server-Xvfb-1.17.4-16.el6.centos.x86_64.rpm
 
  
To install the rpm package manually:
+
* Build the pandora_enterprise ISO in /mnt
 +
* Copy the file pwrd.tar.gz (600M => 1.7G) to /root
 +
*Unzip.
 +
* Import the images.
  
  yum install xorg-x11-server-Xvfb-1.17.4-16.el6.centos.x86_64.rpm
+
  $ mount /dev/cdrom0 /mnt
 +
$ cp /mnt/Packages/pwrd.tar.gz /root/
 +
$ cd /root
 +
$ tar xvzf pwrd.tar.gz
 +
$ docker load < chrome.node*.tar
 +
$ docker load < firefox.node.*.tar
 +
$ docker load < hub.3.*.tar
  
Once the prerequisites are installed, we continue the installation of the install_pwrd.sh. The default PATH is ''/usr/share/pandora_server/util/pwrd/install_pwrd.sh'' and it's execution is:
+
To check that the images have been correctly uploaded, the following command will be run:  
  
  /usr/share/pandora_server/util/pwrd/install_pwrd.sh --install
+
  docker images
  
Once installed will have to start the service:
+
== Selenium service infrastructure ==
  
/etc/init.d/pwrd start
+
Selenium works as a hub where a container, that works as a grid where to deploy the necessary worker containers, is enabled.  
  
The Selenium server can be booted up with the script:
+
<center>
 +
[[File:newux9.png]]
 +
</center>
  
#!/bin/sh
+
== Pandora FMS Configuration ==
# Monitoring selenium process
 
if [[ "`ps aux |grep selenium |grep -v grep |grep -v selenium.sh |wc -l `" != "0" ]]; then
 
    exit
 
else
 
    if [[ "`ps aux |grep Xvfb |grep -v grep | wc -l `" != "0" ]]; then
 
      Xvfb :99 -ac &
 
      export DISPLAY=:99
 
    fi
 
    export DISPLAY=:99
 
    java -jar /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar  &
 
fi
 
  
Or manually with the following commands:
+
To use the centralized mode (WUX) it will be necessary to apply the following configuration to the Pandora FMS server.
  
 +
Regardless of the chosen mode, once started you may start assigning executions from your browsing sessions, adding the WUX Server configuration parameters to the configuration file of your Pandora FMS server.
  
$ Xvjb :99 -ac &
+
Assuming that you have deployed your PWRD server on the same server where your Pandora FMS server runs, add the following configuration:
-> Press Enter to continue
 
$ export DISPLAY=:99
 
$ java -jar /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar  -port 4444 &
 
  
=== Pandora Web Robot Daemon (PWRD) ===
+
# add to /etc/pandora/pandora_server.conf
 +
wuxserver 1
 +
wux_host 127.0.0.1
 +
wux_port 4444
  
Pandora Web Robot Daemon is a service, which provides tools to automate web browser sessions, using a file containing a list of necessary actions in order to navigate the user's web portal.  
+
The configuration file of Pandora FMS server has a new token to clean queued navigation sessions.
  
It comes integrated with the Pandora server and we can find it in the folder /usr/share/pandora_server/util/pwrd when installing the Enterprise server (Linux) or in the module library (Windows)
+
clean_wux_sessions 1 (default)
  
It contains:
+
==Appendix: Add workers for Internet Explorer and Microsoft Edge ==
  
* Firefox 43 Binary for Windows.
+
If it is necessary to launch web transactions against Microsoft browsers, it will be necessary to configure a machine (physical or virtual) with the desired Windows version and configure the driver following the official documentation.  
* Pre-built profile to perform web browser sessions.
 
* Server for session automation (Selenium server).
 
  
=== Recording a PWR session ===
+
Internet Explorer driver installation documentation:
  
Before UX monitoring can take place, you need to record a session. Depending on the type of tech you use, various recording options are available.
+
github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
  
To record the navigation with PWR, you need the PWR recorder available at plugin module library:
+
{{Tip|We recommend using driver 3.141 version 32bit to avoid performance 64bit version problems.}}
  
https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/
+
Microsoft Edge driver installation documentation:  
  
The package contains:
+
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
* Firefox version 43.0.1 (downloadable at: https://ftp.mozilla.org/pub/firefox/releases/43.0.1/).
 
* Selenium IDE extension (downloadable at: https://addons.mozilla.org/es/firefox/addon/selenium-ide/).
 
  
 +
To run Selenium, Java must be installed on the Windows device.
  
Start PWR_recorder.exe:
+
To check whether Java is installed, run this command:  
  
<br>
+
java -version
[[File:PWR_recorder.PNG|center]]
 
<br>
 
  
The recorder will start automatically Firefox with a prebuilt environment:
+
You should get an output like the following:  
  
<br>
+
<center>
[[File:PWR_recorder_main.png|center]]
+
[[File:newux1.png]]
<br>
+
</center>
  
 +
The Selenium <b>JAR</b> file will also be required to run the server locally and register it on your grid.
  
After start Selenium IDE, we'll be able to record our web navigation test:
+
It can be obtained at:  
  
[[File:ux10.JPG|center]]
+
https://www.selenium.dev/downloads/
  
Now you can navigate the website you want to monitor and register the different actions associated with each step on the recording.  
+
<center>
To stop recording use the following button, located on the upper-right of the screen:
+
[[File:newux2.png]]
 +
</center>
  
[[File:ux11.JPG|center]]
+
To activate the <b>Microsoft Edge</b> server, the following must be run in a terminal in the directory where you have the <b>JAR</b> file:  
  
Once the actions are completed the page can be checked, e.g. verification of a text to ensure the correct page has loaded. Right click on a section of text in the browser window while recording and select ''verifyText'':
+
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"
  
[[File:ux13.JPG|center]]
+
The command is similar to activate the <b>Internet Explorer</b> server, but the path of the downloaded driver must be specified:  
  
Another step will appear on the recording indicating the text to be checked:
+
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"
  
[[File:ux14.JPG|center]]
+
<center>
 +
[[File:newux3.png]]
 +
</center>
  
The entire sequence can be reproduced by clicking ''Play entire test suite'' and checking that it finishes correctly:
+
{{Warning|The Windows Firewall must be configured to allow traffic on the ports specified in the run command. In the case of examples 5555 and 4444.}}
  
[[File:ux15.JPG|center|800px]]
+
== Recording ==
  
Once the whole browsing sequence has been checked and verified save it (File -> Save Test Case) in order to execute it on Pandora UX. The resulting file is an HTML document that Pandora UX can then interpret.
+
{{Warning|It should be taken into account that the recordings made in Selenium 2 may not work properly.}}
  
==== Recording a transaction session with Pandora UX PWR ====
+
For Selenium version 3, both old and new recordings will be supported.
  
Pandora UX in PWR mode (Pandora Web Robot) allows browser monitoring to be divided among multiple modules, that represent each of the steps taken.
+
In order to record a new session, the <b>Selenium IDE</b> extension must be installed in the desired browser.  
  
To insert a new control point and generate the phase modules (to this point) right-click on the point where the phase is to start.
+
*Firefox: https://addons.mozilla.org/es/firefox/addon/selenium-ide/
 +
*Chrome: https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd
  
[[File:ux16.JPG|center]]
+
The next icon will be the one that allows to start the recording environment once the extension is installed.  
  
Use the following as the New Comment:
+
<center>
 +
[[File:newux10.png]]
 +
</center>
  
phase_start:name_of_phase
+
A menu that will allow to start new recording projects will open.
  
The phase includes the timings and results of all the commands up to the following comment:
+
<center>
 +
[[File:newux5.png]]
 +
</center>
  
phase_end:name_of_phase
+
Once the recording is made, it will result in something like the following:  
  
All commands executed between a phase_start and a phase_end are included in that phase.
+
<center>
 +
[[File:newux6.png]]
 +
</center>
  
=== Executing PWR sessions ===
+
Apart from the feature provided by Selenium, Pandora FMS has custom commands to retrieve information from the target to be monitored.
  
==== Standard execute ====
+
=== Commands ===  
  
To launch prerecorded PWR sessions call the ''pandora_ux_x64.exe'' executable. It can be downloaded in: ''https://pandorafms.com/library/user-experience-pandora-ux/''
+
The list of compatible commands available can be found [https://pandorafms.com/docs/index.php?title=Pandora:Documentation_en:_Compatible_Selenium_Commands here].
  
Select PWR work mode and the file containing the session guidelines. Any error screenshots will be saved in the route indicated on the ''-folder''  parameter, optional. You can also user the parameter ''-retries'' to reexecute the script after a failure execution. The execution in Windows is:
+
<br>
 +
<br>
 +
<br>
  
pandora_ux_x64.exe -exe PWR -script tests\std.html -retries 3
+
= Web User Experience (WUX) with Selenium 2 =
  
The following modules are returned:
+
== Previous settings ==
* UX_Status_project_name: whether or not the sequence was successful
 
* UX_Time_project_name: time taken to complete the sequence
 
* UX_Snapshot_project_name: screenshot of the last point before any error occurred
 
  
Example of correct execution:
+
=== Selenium ===
  
<module>
+
==== Pandora Web Robot Daemon (PWRD) deployment ====
    <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>
 
  
Example of incorrect execution:
+
Pandora FMS Web Robot Daemon is a service that provides the necessary tools to automate web browsing sessions, using a file that contains a list of the actions necessary to navigate the user's web portal.
  
<module>
+
It comes integrated with the Pandora FMS server and can be found in the /usr/share/pandora_server/util/pwrd folder when installing the Enterprise server (Linux) or in the module library (Windows).
    <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>
 
  
Provided everything is OK the execution line can be added to the Pandora agent (already installed on the machine) which is going to carry out the checks. It should look something like this:
+
To download it, go to the following link: ''https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/ ''
In Windows:
 
module_plugin C:\Users\artica\Documents\Producto\UX-Trans\UX\pandora_ux_x64 -exe PWR -script C:\Users\artica\Documents\Producto\UX-Trans\PWR\sesion.html -folder C:\probes
 
In Linux:
 
module_plugin /usr/share/pandora_server/util/pwrd/firefox/pandora_ux.64 -exe PWR -script /usr/share/pandora_server/util/pwrd/firefox/PruebaUX.html -pwr_port 4444
 
  
Once the agent is reporting to the Pandora FMS server the corresponding modules will appear. Enable ''hierarchy mode'' to see the relation among them:
+
It contains:
  
[[File:ux33.JPG|center|800px]]
+
* Firefox browser binary version 47.
 +
* Pre-built profile for executing web browsing sessions.
 +
* Session automation server (Selenium server).
  
As previously indicated, the result of the execution (successful or not) can be seen on the ''UX_Status_session.html'' module, the time taken (in secs) on the ''UX_Time_session.html'' module , and another with the screenshot of the last error on ''UX_Snapshot_session.html'' which, in this case, is empty. Use these modules to create alerts and display the individual graphs from each module.
+
==== Selenium server deployment on Windows systems ====
  
<center>
+
Prerequisites:
[[File:imagen_nueva_ux.png]]
+
* Install Java 1.8 on the machine that will provide the service.
</center>
+
* Install Firefox 47.0.1 (downloadable at 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/
 +
* Create the following directories:
 +
C:\PWR
  
==== Transaction-based execution ====
+
To download the PWR_Server.zip, go to the following link:
 +
''https://pandorafms.com/library/pwr-server-for-ux-monitoring/''
  
If there is a Pandora UX PWR transaction recording as outlined in previous sections, it will be the system itself that generates the necessary modules to identify each of the phases indicated, which means the execution won't vary with respect to the previous case. Indicate the corresponding html file, which, in this case, contains the different phases. E.g. in Windows:  
+
Do the following file distribution:
 +
* Unzip the PWR_Server.zip file to C:\PWR\
 +
* Export Firefox profile to C:\PWR\profile
  
pandora_ux_x64 -exe PWR -script tests\std.html –folder C:\probes
+
The use of a profile to carry out checks '''is not mandatory''', however it is recommended particularly when using a proxy or wanting to use password autocompletion.
 +
To create a Firefox profile, follow the steps from the following screenshots:
  
The following modules will be returned:
+
<br>
 +
[[File:ux1.JPG|center]]
 +
<br>
 +
[[File:ux2.JPG|center]]
 +
<br>
  
* UX_Time_project_name.phase_order
+
Choose the destination directory:
* UX_Status_project_name.phase_order
 
  
If any phase returns an error, the following module is created:
+
<br>
 +
[[File:ux3.JPG|center]]
 +
<br>
  
* UX_Snapshot_project_name.phase_order
+
Start Firefox with the new profile to customize options such as proxy, popup display, etc.:
  
A screenshot with the moment the error took place will be displayed.
+
<br>
 +
[[File:ux4.JPG|center]]
 +
<br>
  
Global status modules are returned with the following labels:
+
Next, install the service by executing the provided BAT file ''service_installer.ba ''. For the service_installer.bat to work properly, modify the content, typing in the paths that exist in the file as they are installed on your machine. For example, Java can only work if you have correctly configured its PATH. Otherwise, you will have to provide the full PATH inside the file. Finally, start the service:
  
* UX_Global_Time_project_name
+
net start PWRSRV
* UX_Global_Status_project_name
 
* UX_Global_Snapshot_project_name
 
  
A screenshot showing the moment the error took place will be displayed.
+
From this point, the Selenium server is running on your machine. However, you may execute it manually (stopping the service previously) in case you wish to perform debugging tasks, using the following command:
  
The agent's execution line is the same to the previous example, but with an html file containing the phases. Something like this:
+
java -jar C:\PWR\server\selenium-server-standalone-2.53.0.jar -firefoxProfileTemplate C:\PWR\profile -port 4444 -v
  
When the data reaches the Pandora FMS server it is displayed as modules. Enable ''hierarchy mode'' in the modules list to see the information clearly:
+
==== Selenium server deployment on Linux systems ====
  
[[File:ux34.JPG|center|800px]]
+
Prerequisites:
 +
* 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/).
 +
* Prepare a Firefox profile to be used to test automated sessions (optional): http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
 +
* Install xorg-x11-server-xvfb
 +
* Install java
  
Access the agent's ''UX'' section to see extra details on the transaction and its phases:
+
The Selenium component of the PWRD daemon requires Java to work, so it needs to be installed:
  
The following example represents a browsing process, plus the purchase of various articles, performed on our website, and divided into five phases to exactly measure the time taken and to locate areas that could be improved or where bottlenecks are being produced:
+
yum install java
  
[[File:ux44.JPG|center|800px]]
+
For PWRD to be able to launch Firefox on your Linux server, it will be necessary to install xorg-x11-server-Xvfb, gtk2 and gtk3 in order to virtualize a graphical environment:
==== Data retrieval ====
 
  
Pandora_UX is able to retrieve data from web content while testing the user experience test.
+
yum install xorg-x11-server-Xvfb gtk2 gtk3
  
To use this feature, you must add some directives as comments in the user experience test recorder in Selenium IDE.
+
If it is not available in your repositories, you may find the rpm files in the following links:
 +
ftp://rpmfind.net/linux/centos/6.6/os/x86_64/Packages/xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm
  
<br>
+
ftp://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/gtk2-2.24.31-1.el7.x86_64.rpm
[[File:PWR_recorder_getValue.png|center|600px]]
 
<br>
 
  
In the attached exampled, both values will be retrieved after test the navigation, and will be added to Pandora as modules (both getValue directives).
+
To manually install the rpm packages:
  
The stepts to make the plugin retrieve values are following:
+
yum install xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm
* Add a new comment to our navigation test in the Selenium IDE.
+
yum install gtk2-2.24.31-1.el7.x86_64.rpm
* Fill the comment with the directive.
 
  
Data retrieval directive:
+
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:
  
  getValue;module name;module type;Regular expression for data capture
+
  cd /usr/share/pandora_server/util/pwrd/
 +
./install_pwrd.sh --install
  
What does each field represented by a dot and comma mean?
+
Once installed, start the service:
  
* <b>getValue</b>: UX system directive
+
/etc/init.d/pwrd start
* <b>Module name</b>: module name as it will appear in Pandora
 
* <b>Module type</b>: datatype to use, any from Pandora datatypes is allowed (generic_proc,generic_data,generic_data_string,async_proc,async_data,async_string...)
 
* <b>Perl regular expression</b>: Must be a perl regex, specifing data to be retrieved between parenthesis
 
  
For example, in following text:
+
Use the following script to start the Selenium server:
  
<pre>
+
#!/bin/sh
  <p>The temperature of the solar plate is: <span class="temperature">54º C</span></p>
+
# Monitoring selenium process
</pre>
+
  if [[ <nowiki>"`ps aux |grep selenium |grep -v grep |grep -v selenium.sh |wc -l `"</nowiki> != "0" ]]; then
 +
    exit
 +
else
 +
    if [[ <nowiki>"`ps aux |grep Xvfb |grep -v grep | wc -l `" != "0"</nowiki> ]]; then
 +
      Xvfb :99 -ac &
 +
      export DISPLAY=:99
 +
    fi
 +
    export DISPLAY=:99
 +
    java -jar /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar &
 +
fi
  
If we want to retrieve the temperature of the solar plate to monitor it, we must specify the regex as:
+
Or manually with the following commands:
  
<pre>
+
$ Xvfb :99 -ac &
<span class="temperature">(\d+\.*\,*\d*).*</span>
+
-> Press Enter to continue
</pre>
+
$ export DISPLAY=:99
 +
$ java -jar  /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar -port 4444 &
  
So, the system will retrieve the number "54" from the example, or any number with decimal positions.
 
  
 +
In version 730 and later, the possibility of performing the custom installation with a user and a directory different from those of the default installation has been added.
  
Then, the complete directive will appear as:
+
===== PWRD operating modes =====
 +
 +
PWRD provides several operating modes:
  
<pre>
+
* '''Standalone''': This standard mode will launch a single PWRD instance. Each of these instances will be associated with a Pandora FMS server.
getValue;Solar plate temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span>
+
* '''HUB''': Hub mode. In this mode, the PWRD service will not evaluate the browsing sessions directly, but "nodes" must be registered to execute the tasks. It is the cluster mode of the PWRD service. Each HUB will be assigned to a Pandora FMS server.
</pre>
 
  
== Desktop UX (PDR) ==
+
====== PWRD in standalone mode ======
  
=== PDR deployment (Windows only) ===
+
PWRD in standalone mode will start the daemon and get it ready to execute the actions indicated by the user through WUX Server.
  
The PDR system only works on Windows systems, and once run by the Pandora FMS agent it must run in '''process mode''', as running in service mode will not work. Furthermore, it will not be possible to block the desktop session, so we recommend its use in virtual machines.
+
<br>
 +
[[File:wux_pwrd_standalone.png|center]]
 +
<br>
  
Prerequisites:
 
* Windows OS in desktop mode, auto startup, and auto login.
 
  
To configure, execute:
+
# Start
  control userpasswords2
+
/etc/init.d/pwrd start
 +
 
 +
# see the status
 +
  /etc/init.d/pwrd status
  
Uncheck "Users must enter a user name and password to use this computer":
+
# stop
 +
/etc/init.d/pwrd stop
  
[[File:ux5.JPG|center]]
 
  
To set up the environment create the following directories:
+
====== PWRD in "HUB" mode ======
  
C:\PDR
+
The hub mode will start the daemon as a load balancer. In this work mode, the system will balance the load among all the nodes that are registered on it, assigning browsing session execution to the nodes according to their workload.
C:\probes
 
  
Decompress the "PDR.zip" file from: ''https://pandorafms.com/library/pdr-cmd-for-ux-monitoring/'' into ''C:\PDR''.
+
You can see the HUB status at any time by accessing the HUB administration console:
  
To start the recorder, execute:  
+
http://hub:4444/grid/console
  
C:\PDR\pdr
 
  
=== Record a PDR session ===
+
<br>
 +
[[File:wux_pwrd_hub.png|center]]
 +
<br>
  
Requirements:
 
* Automation system (decompress pdr.zip in a directory of your choice) installed.
 
* Start recording system (pdr.cmd).
 
  
[[File:ux17.JPG|center]]
+
# Start
 +
/etc/init.d/pwrd start-hub
  
After loading, we will enter the recording environment:
+
# see the status
 +
/etc/init.d/pwrd status-hub
  
[[File:ux18.JPG|center|800px]]
+
# stop
 +
/etc/init.d/pwrd stop-hub
  
Select the actions and the zones where they are to be carried out. Here are some of the most common ones:
 
  
General actions:
+
====== Add PWRD nodes to your HUB ======
  
[[File:ux19.JPG|center]]
+
To add a new PWRD node, you will need:
  
Flow control actions:
+
* A hub (PWRD in HUB mode).
 +
* PWRD files, on the same or on different machines.
 +
* TCP / 4444 connectivity from the computer hosting the node to the computer hosting the HUB.
  
[[File:ux20.JPG|center]]
+
In this working mode, the service will process all those requests queued <b>from the hub (HUB)</b> , giving back the results of the executions. It will be the HUB who will speak exclusively with the WUX Server, for which the one who executes the user's actions is visible.
  
More information about this scripting language: http://sikulix-2014.readthedocs.io/en/latest/index.html
+
# Start and sign up in the HUB, replace "hub" with the IP of the PWRD HUB server
 +
/etc/init.d/pwrd start-node http://hub:4444/grid/register
  
When the project is recorded a file will be created with the following elements:
+
# see the status
* File .py with the script automation code.
+
/etc/init.d/pwrd status-node
* Web browser control images.
 
  
A simple example of an execution would be something like monitoring to check that the Windows calculator works correctly. Let's take a look at how to go about it, one slide at a time.
+
# stop
 +
/etc/init.d/pwrd stop-node
  
1. Choose the action "click" and the area where we want to apply the action; the screen will change to "area selection" mode:
+
==== Pandora FMS server configuration ====
  
[[File:ux21.JPG|center]]
+
To use the centralized mode (WUX), it will be necessary to apply the following configuration to the Pandora FMS server.
[[File:ux22.JPG|center]]
 
  
2. Enter the ''type'' action and the text "calc", wait for the calculator area to appear and click. Afterwards, we will wait for the calculator window to appear to enter the following actions:
+
Regardless of the chosen mode, once started you may start assigning executions from your browsing sessions, adding the WUX Server configuration parameters to the configuration file of your Pandora FMS server.
  
[[File:ux23.JPG|center]]
+
Assuming that you have deployed your PWRD server on the same server where your Pandora FMS server runs, you should add the following configuration:
  
3. Then we will click on the corresponding buttons, selecting the areas as in the previous steps.
+
# add to /etc/pandora/pandora_server.conf
 +
wuxserver 1
 +
wux_host 127.0.0.1
 +
wux_port 4444
  
4. Lastly, save and replay clicking on '''Run'''.
 
  
Important notes:
+
==== Uploading certificates for Firefox ====
  
*If we double-click on any of the images within the recording environment, we can adjust details of the control capture, such as selecting the exact point where to click.
+
It is possible that some of the configured checks are executed against web pages that use self-signed certificates or signed by a CA not included in those accepted by default in Firefox, so in those cases it will be necessary to load the certificate itself in the Firefox profile that is being used.
*It is highly recommended to enter ''wait'' actions between each click to make sure that the execution will not be stopped due to a delay in the operating system.
 
*The recorder will look for the area that looks like the screenshot, so we need to be especially careful if there is something highlighted when the button is placed on top of it (for example, the calculator buttons change to orange when the cursor is over them).
 
  
The image files can be viewed in the folder where the recording is saved, as well as the python file.
+
The easiest way to do it is to start the browser in a graphical environment, access the URL and add the SSL certificate. Next, we will explain how to do it both in Windows and Linux:
  
[[File:ux24.JPG|center]]
+
===== With PWRD deployed on Windows systems =====
  
<b><u>Nota</u>:</b> You can customize the capture from the PDR recording engine by using the following code:
+
In this case, since you have a graphical environment, just start the Firefox browser with the profile used for the checks:
  
## OPTIONAL ##capture file names
+
[[File:Profile_01.png|center]]
import shutil
 
file = "C:\probes\screenshot_prueba.sikuli.png"
 
focusWindow = App.focusedWindow()
 
regionImage = capture(focusWindow)
 
shutil.move(regionImage, file)
 
  
 +
[[File:Profile_02.png|center]]
  
This will create an image of the active window in the destination indicated by file with which we can make the screenshot at the specific time we want.
+
Once started, access the URL with the certificate you want to load and add it as an exception for the browser:
We can customize this screenshot using coordinates, so we will specify the following syntax:
 
  
capture(x, y, w, h)
+
[[File:Profile_03.png|center]]
  
Where:
+
[[File:Profile_04.png|center]]
  
X: X position of the rectangle we want to capture
+
Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":
  
Y: Y position of the rectangle we want to capture
+
[[File:Profile_05.png|center]]
  
W: Width of the capture
+
[[File:Profile_06.png|center]]
  
H: Heigth of the capture
+
===== With PWRD deployed on Linux systems =====
  
<br><br>
+
In general, when a Linux server is installed, it is not included in a graphical desktop environment, so in order to follow the same steps as in the previous case, redirect the graphical Xs to a computer where you do have a graphical desktop environment. This is done differently if we redirect the Xs to a graphical desktop in Linux or Windows.
  
==== Recording a transaction session with Pandora UX PDR ====
+
====== Redirecting X11 to a Linux desktop ======
  
 +
Doing it is very simple, since it will be enough to set an SSH connection to the PWRD server with the parameter "-X":
  
Recording a specific session is not necessary, just record the sessions you need in different scripts. Pandora UX will return the results and organize them as a complex transaction. In the next point we will see how to make the call of the execution so that it works correctly.
+
ssh -X [email protected]_ip_address
  
If we are going to make several recordings to create a transactional process we must be careful when recording that the elements we are looking for are present. The manual execution of the recordings that we want to use in a single transactional process is recommended, followed by a manual execution to ensure that the actions take place as expected.
+
Once this is done, if you launch the Firefox browser, it will be shown on your desktop:
 
In the next example you can see a recording process that will constitute the second phase of the process from the example above. Take the result returned by the calculator and paste it into a note. It should look like this:
 
  
[[File:ux40.JPG|center]]
+
firefox -p
  
Here's another sequence that consists of saving the text file in a specific location, overwriting the previous. This gives great flexibility, affording the possibility of parallel file monitoring, reflecting information from a variety of checks against heavyweight desktop applications. This third sequence consists of the following steps:
+
In a default installation, you will only see the "default" profile, so it would be advisable to do as in the installation in Windows and create a new profile to use:
  
[[File:ux43.JPG|center]]
+
[[File:Profile_07.png|center]]
  
=== Executing PDR sessions ===
+
[[File:Profile_08.png|center]]
  
==== Standard execution ====
+
[[File:Profile_09.png|center]]
  
To launch prerecorded PDR sessions, indicate work mode as file route pdr.cmd deployed in the corresponding point, the argument of said file being “-r”, the file that contains the session guidelines (-script), the directory where the screenshots will be saved (-folder) finishing ‘\’, optional. You can also user the parameter ''-retries'' to reexecute the script after a failure execution.
+
In case of saving the profile in a path other than '''/opt/firefox_profile''', it will be necessary to edit the PWRD starting script '''/etc/init.d/pwrd''' to indicate the path to the new profile:
  
In the following execution the screenshot can be customized to capture only the active window:
+
PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"
  
pandora_ux_x64 -exe C:\PDR\pdr -args -r -script C:\pandora_ux\calculadora.sikuli -folder C:\pandora_ux\ -ss_config active -retries 3
+
With the created profile, you can start the browser:
  
The following modules will be returned:
+
[[File:Profile_10.png|center]]
* UX_Time_project_name.
 
* UX_Status_project_name.
 
* UX_Control_Snapshot_project_name (only on first execute).
 
  
If any phase returns an error, the following module will be created:
+
Once started, access the URL with the certificate you want to load and add it as an exception for the browser:
* UX_Snapshot_project_name.
 
  
An image from the active window will be shown (with -ss_config active) displaying the error when it occurred.
+
[[File:Profile_11.png|center]]
  
Correct output execution example:
+
[[File:Profile_12.png|center]]
  
<module>
+
Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":
    <name><![CDATA[UX_Status_calculadora.sikuli]]></name>
 
    <type>generic_proc</type>
 
    <data><![CDATA[1]]></data>
 
    <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>
 
    <data><![CDATA[20.204]]></data>
 
    <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>
 
    <data><![CDATA[data:image/png;base64, IBCAIAAAAOCnfhAAAAAXNSR…/4x79e/7757f8H2C00s1C73yMAAAAASUVORK5CYII=]]></data>
 
    <description><![CDATA[Control image rebuilt]]></description>
 
    <tags>UX</tags>
 
    <module_group>UX</module_group>
 
    <module_parent>UX_Status_calculadora.sikuli</module_parent>
 
</module>
 
  
Incorrect iutput execution example:
+
[[File:Profile_13.png|center]]
  
<module>
+
[[File:Profile_14.png|center]]
    <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>
 
  
If everything is A-OK add the execution line for the Pandora FMS agent installed on the Windows device as a plugin. The line looks like this (one line):
+
====== Redirecting X11 to a Windows desktop ======
  
module_plugin C:\Users\artica\Documents\Producto\UX-Trans\ux\pandora_ux_x64.exe -exe C:\PDR\pdr.cmd -args -r -script C:\PDR\calc.sikuli -folder C:\PDR\ -ss_config active -checkpoint -post "taskkill /F /IM calc.exe"
+
In Windows, first install an X server to be able to redirect, such as '''Xming'''. Once installed and started, redirect the Xs.
  
As can be seen, the execution has more options. The parameter ''-checkpoint'' displays a screenshot of the final result, even if there are no errors to display, ''-post'' will execute actions once the session replay has finished, in which case close the calculation process initiated by the recording to avoid a system collapse due to an excess of open windows, or any similar problem.
+
Using the SSH Putty client, go to the "Connection> SSH> X11" section before connecting, and make sure you check the "Enable X11 forwarding" option and fill in the "X display location" field as "localhost:0":
  
Now that the agent has the execution line ''module_plugin'' ready launch it in process mode, executing the following from the admin command line:
+
[[File:Profile_15.png|center]]
  
"C:\Program Files\pandora_agent\PandoraAgent.exe" --process
+
Then go back to the "Session" section and establish the connection:
  
Obviously, the complete route to the executable ''PandoraAgent.exe'' should correspond to your installation.
+
[[File:Profile_16.png|center]]
  
When launched you can see how actions are executed automatically according to the recording. From now on, '''the agent process must not be closed''' or a session initiated on the machine from a remote desktop or the executions may be interrupted. The machine should remain untouched, this being the reason for which virtual machines are recommended.
+
Once the connection is established, if you launch the Firefox browser on the PWRD server, you may see it on the Windows desktop.
  
<center>
+
firefox -p
[[File:imagen_nueva_pdr.png]]
 
</center>
 
  
{{Tip|If you have other automatic monitoring tests, you can include them in Pandora FMS  with the following execution.}}
+
In a default installation, you will only see the "default" profile, so it would be advisable to do as in the installation in Windows and create a new profile to use:
  
pandora_ux.64 -exe <exe of the aumotatic monitoring system> -args <system parameters> -script <file PAHT of the test>
+
[[File:Profile_17.png|center]]
  
==== Transaction-based execution ====
+
[[File:Profile_18.png|center]]
  
Once there are various processes recorded, and verified for correct functioning, with the PDR, execute the following:  
+
[[File:Profile_19.png|center]]
  
C:\Users\artica\Documents\Producto\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
+
In case of saving the profile in a path other than '''/opt/firefox_profile''', it will be necessary to edit the PWRD starting script '''/etc/init.d/pwrd''' to indicate the path to the new profile:
  
As can be seen, you only need to indicate the new script's route in the ''-script'' parameter, separated by a comma from the previous script, and employ the '''-t''' parameter with the name of the transaction which covers all the different phases. If the process contains more phases simply apply the same logic, e.g.:
+
PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"
  
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
+
With the created profile, you can start the browser:
  
Add the following line to the agent configuration file:
+
[[File:Profile_20.png|center]]
  
module_plugin C:\Users\artica\Documents\Producto\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"
+
Once started, access the URL with the certificate you want to load and add it as an exception for the browser:
  
Thanks to the ''-checkpoint'' parameter screenshots of the final result from each phase can be viewed on the Pandora console.  
+
[[File:Profile_21.png|center]]
  
The following modules will be returned, per phase:
+
[[File:Profile_22.png|center]]
* UX_Time_project_name.phase_order.
 
* UX_Status_project_name.phase_order.
 
  
If any of the phases returns an error, the following module will be created:
+
Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":
* UX_Snapshot_project_name.phase_order.
 
  
In case of error it will also display a web image with the moment the error was produced.
+
[[File:Profile_23.png|center]]
  
It also returns global summary modules with the following IDs:
+
[[File:Profile_24.png|center]]
* UX_Global_Time_project_name.
 
* UX_Global_Status_project_name.
 
* UX_Global_Snapshot_project_name.
 
  
  
When the agent is running in process mode and the modules are recovered by Pandora FMS they can be seen on the console. Once again, via ''hierarchy mode'' view, the relation among the modules, and the boundaries between phases,  can be clearly seen:
+
=== Session Recorder (PWR) ===
  
[[File:ux41.JPG|center|800px]]
+
{{Warning|The new Selenium IDE version will be supported by Pandora FMS version 745 onwards, when Selenium 3 is implemented. Transactions recorded in Selenium 2 will not be affected.}}
  
Details of the phases and time charts can be viewed in the transaction display:
+
{{Warning|Session recordings with Selenium 2 can only be done with Firefox.}}
  
[[File:ux42.JPG|center|800px]]
+
Before monitoring a user experience, record it. Use the appropriate recording system according to the type of technology you chose.
  
Error screenshots are only shown when the UX client (PWR) and the PWR server are both running on the same machine. Otherwise, the PWR server image delivery directory should be accessible for the client in order to view the image on Pandora.
+
To record a navigation with PWR, you will need the PWRD recorder available in the module library:
  
Using these same modules you can create alerts and view the history in order to generate graphs and display the evolution over time of your systems.
+
https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/
  
It is recommendable to create a programmed task that boots the Pandora agent in process mode when the system boots up, to avoid interrupting executions, even when the system has been force-booted, and to ensure the agent executes even though the machine is on automatic login mode, without password protection.
+
It contains:
 +
* Firefox web browser version 47.0.1 (downloadable from https://ftp.mozilla.org/pub/firefox/releases/47.0.1/).
 +
* Selenium IDE extension (downloadable from: https://addons.mozilla.org/es/firefox/addon/selenium-ide/).
  
[[File:ux26.JPG|center]]
+
Start the PWR_recorder.exe recorder:
[[File:ux27.JPG|center|800px]]
 
[[File:ux28.JPG|center]]
 
[[File:ux29.JPG|center]]
 
[[File:ux30.JPG|center]]
 
[[File:ux31.JPG|center]]
 
[[File:ux32.JPG|center]]
 
  
This guarantees that on the Windows instance in question the Pandora FMS agent will always be running in process mode even when the machine restarts, being always able to send the data harvested by the PDR probe.
+
<br>
 +
[[File:PWR_recorder.PNG|center]]
 +
<br>
  
Systems with various desktops can present problems, in which case it's recommendable to always use the configuration previously described, on any machine in desktop mode and autostart and a single desktop.
+
It will automatically start Firefox with the environment ready to record PWR sessions:
  
= WEB User experience transactional monitoring (WUX) =
+
<br>
 +
[[File:PWR_recorder_main.png|center]]
 +
<br>
  
== Introduction ==
 
  
Pandora WUX is a Pandora FMS internal component, which allows users to automate web browser interaction.
+
After accessing the Selenium IDE, you may start recording your user experience:
  
In order to work, WUXServer must be connected to a Pandora Web Robot Daemon (PWRD) server.
+
<br>
 +
[[File:ux10.JPG|center]]
 +
<br>
  
PWRD is a service that executes step by step pre-recorded actions by the user in a web portal.
+
From that moment on, you will be able to navigate throughout the website that you wish to monitor and the different actions of each step that you take will appear in the recorder.  
  
To achieve this, PWRD uses Selenium web automation technology.
+
To stop the recording, use the following button, located in the upper right corner of the recorder:
  
It is therefore imperative that the user shows Pandora WUXServer the actions that must be performed to navigate through the web portal.
+
<br>
 +
[[File:ux11.JPG|center]]
 +
<br>
  
With this data, Pandora WUXServer will generate a report with the results of the performances, time spent, and screenshots with the possible errors found.
+
Once these actions are completed, perform the checks on the website. For example, check the existence of a certain text to make sure that the loaded page is the correct one. To that end, right-click on a section of text on the browser window while you keep recording, and select the option ''verifyText'':
  
Pandora WUXServer is able to split the browsing sessions into phases, which simplifies the view and helps us to debug possible bottlenecks.
+
<br>
 +
[[File:ux13.JPG|center]]
 +
<br>
  
 +
A new step will appear in the recorder indicating the indicated text checking action:
  
 
<br>
 
<br>
[[File:wux_simple.png|center]]
+
[[File:ux14.JPG|center]]
 
<br>
 
<br>
  
== Configuration ==
+
You may play the full sequence using the button ''Play entire test suite'' and check that it ends correctly:
  
In order to enable WUXServer on our Pandora FMS server,we will need to configure the <b>Pandora Web Robot service (PWRD)</b>
+
<br>
 +
[[File:ux15.JPG|center|800px]]
 +
<br>
  
=== Pandora Web Robot Daemon (PWRD) ===
+
Once the validity of the navigation sequence is verified, save it (File -> Save Test Case) to execute it afterwards with Pandora FMS UX. The resulting file will be an HTML document that Pandora FMS UX will interpret.
  
Pandora Web Robot Daemon is a service, which provides tools to automate web browser sessions, using a file containing a list of necessary actions in order to navigate the user's web portal.
 
  
It comes integrated with the Pandora server and we can find it in the folder /usr/share/pandora_server/util/pwrd when installing the Enterprise server (Linux) or in the module library (Windows)
+
===== Record a transactional session for Pandora WUX =====
  
It contains:
+
Pandora FMS WUX allows dividing navigation monitoring into multiple modules, which will represent each one of the steps carried out.
  
* Firefox 43 Binary for Windows.
+
To insert a new control point and generate the phase modules (up to that point), right-click on the point where you want to identify the beginning of the phase.
* Pre-built profile to perform web browser sessions.
 
* Server for session automation (Selenium server).
 
  
 +
<br>
 +
[[File:pwrd_recorder_transaction.PNG|center]]
 +
<br>
  
=== Installation on Linux===
+
Type in the following text as a comment:
  
The Selenium component of the PWRD daemon requires java in order to work, we will need to install it:
+
phase_start:phase_name
  
  yum install java
+
The phase will include the time and result of all the commands found until the following comment:
  
In order for PWRD to be able to launch Firefox on our Linux server, it will be necessary to install xorg-x11-server-Xvfb, gtk2 and gtk3 to be able to virtualize graphical environments.
+
phase_start:phase_name
  
yum install xorg-x11-server-Xvfb gtk2 gtk3
+
All commands executed between phase_start and phase_end tags will be included within that phase.
  
If its not available in your repos, you can find the RPMs files in following links:
+
<br>
ftp://rpmfind.net/linux/centos/6.6/os/x86_64/Packages/xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm
+
[[File:pwrd_recorder_transaction2.PNG|center]]
 +
<br>
  
ftp://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/gtk2-2.24.31-1.el7.x86_64.rpm
+
{{Warning|It should be taken into account that the recordings made in Selenium 2 may not work properly.}}
  
To do the RPMs installation manually:
+
== Web transaction execution ==
  
yum install xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm
+
=== Standard execution ===
yum install gtk2-2.24.31-1.el7.x86_64.rpm
 
  
Then, proceed to install PWRD daemon, which can be found in the folder  /usr/share/pandora_server/util/pwrd/ when installing the Enterprise server.
+
To launch pre-recorded PWR sessions, call the executable "pandora_ux_x64.exe", which can be downloaded from the following link: "https: //pandorafms.com/library/user-experience-pandora-ux" '
  
sudo /bin/bash /usr/share/pandora_server/util/pwrd/install_pwrd.sh --install [user] [directory]
+
Indicate that the working mode is PWR, and the file that contains the session guidelines. In the path indicated in the '' -folder '' parameter, the screenshots will be saved to be shown in case of failure, optional parameter. You may also enter the number of consecutive retries in case of failure, optional parameter. Its execution in Windows is:
  
 +
pandora_ux_x64.exe -exe PWR -script C:\tests\std.html -retries 3
  
In version 730 and later, the possibility of performing the customized installation with a user and a directory different from the default installation has been introduced.
+
The following modules will be returned:
 +
* UX_Status_project_name: if the sequence succeeded or failed.
 +
* UX_Time_project_name: time taken to complete the sequence.
 +
* UX_Snapshot_project_name: screenshot right before the error, if any.
  
Once installed, we must start it.
+
Example of successful execution:
  
PWRD provides several working modes:
+
<module>
 +
    <name><![CDATA[UX_Status_std.html]]></name>
 +
    <type>generic_proc</type>
 +
    <nowiki><data><![CDATA[1]]></data></nowiki>
 +
    <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>
 +
    <nowiki><data><![CDATA[16.317]]></data></nowiki>
 +
    <description><![CDATA[Test OK]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
    <module_parent>UX_Status_std.html</module_parent>
 +
</module>
  
* '''Standalone''': This is the standard mode; it will launch a single PWRD instance, each will be assigned to a Pandora FMS server.
+
Output with erroneous execution example:
  
* '''HUB''': Concentrator mode. In this mode, PWRD service will not evaluate browser sessions directly; instead, "nodes" will have to be registered to execute tasks. This is the cluster mode from the PWRD service. Each HUB will be assigned to a Pandora FMS server.
+
<module>
 +
    <name><![CDATA[UX_Status_std.html]]></name>
 +
    <type>generic_proc</type>
 +
    <nowiki><data><![CDATA[0]]></data></nowiki>
 +
    <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>
 +
    <nowiki><data><![CDATA[15.463]]></data></nowiki>
 +
    <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>
 +
    <nowiki><data><![CDATA[data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]></data></nowiki>
 +
    <description><![CDATA[Image (last error)]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
    <module_parent>UX_Status_std.html</module_parent>
 +
</module>
  
 +
If everything has turned out right, you may add the execution line to the Pandora FMS agent installed on the machine that you have prepared to run the checks. The line to add to the agent configuration file will look like this (in one line):
 +
In Windows:
 +
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\session.html -folder <screenshot path>
 +
In Linux:
 +
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
  
====PWRD in "Standalone" mode ====
+
Once it reports information to the Pandora FMS server, you will see how the corresponding modules appear. You may enable the view in "hierarchical mode" to see the relationship between them:
 
 
PWRD in standalone mode, will start the daemon and will prepare it to execute the actions indicated by the user through WUXServer.
 
  
 
<br>
 
<br>
[[File:wux_pwrd_standalone.png|center]]
+
[[File:ux33.JPG|center|800px]]
 
<br>
 
<br>
  
# Start
+
As indicated previously, you see the result of the execution (whether it was successful or not) in the module ''UX_Status_sesion.html'', the time spent (in seconds) in the ''UX_Time_sesion.html'' module, and another with a screenshot of the last failure in ''UX_Snapshot_sesion.html'', which in this case is empty. It will be on these modules where you may create alerts and show the individual graphs of each module.
/etc/init.d/pwrd start
+
 
 +
<center>
 +
[[File:imagen_nueva_ux.png]]
 +
</center>
  
#Get status
+
=== Phase-based execution ===
/etc/init.d/pwrd status
 
  
# Stop it
+
If you have a transactional recording with Pandora FMS UX PWR, as indicated in previous sections, the system itself will generate the required modules to identify each of the indicated stages, so the execution will not change regarding the previous case. Just indicate the corresponding html file, which in this case will contain the different stages. Windows execution example:
/etc/init.d/pwrd stop
 
  
 +
pandora_ux_x64 -exe PWR -script C:\tests\std.html –folder <screenshot path>
  
 +
The following modules will be returned by stage:
 +
* UX_Time_project_name.phase_order
 +
* UX_Status_project_name.phase_order
  
====PWRD in "HUB" mode====
+
If there is any phase with an error, the following module will also be created:
 +
* UX_Snapshot_project_name.phase_order
  
Concentrator mode or HUB will start the daemon as a load balancer. In this working mode, the system will balance the load between all nodes registered in the system, assigning the execution of the navigation sessions, depending on their workload.
+
It will display an image of the web at the time of the error.
  
You can always check the status of the HUB by accessing the HUB administration console:
+
The global summary modules identified with the following names will also be returned:
 +
* UX_Global_Time_project_name
 +
* UX_Global_Status_project_name
 +
* UX_Global_Snapshot_project_name
  
http://hub:4444/grid/console
+
A web image at the time of the error will be displayed.
  
<br>
+
The agent's execution line would be the same as in the previous case, but with the html file that contains the stated phases.
[[File:wux_pwrd_hub.png|center]]
 
<br>
 
  
# Start
+
And when the information correctly reaches Pandora FMS server, it will be displayed as modules in this way. Enabling the view in ''hierarchical mode'' in the module list will help you see the information much more clearly:
/etc/init.d/pwrd start-hub
 
  
# Get status
+
<br>
/etc/init.d/pwrd status-hub
+
[[File:ux34.JPG|center|800px]]
 +
<br>
  
# Stop it
+
By accessing the ''WUX''section of the agent, you may see additional details of the transaction and its stages:
/etc/init.d/pwrd stop-hub
 
  
 +
The example below represents a browsing process of our website and the purchase of multiple items, divided into 5 stages to accurately measure the times and know where improvements are needed, or a bottleneck takes place:
  
 +
<br>
 +
[[File:ux44.JPG|center|800px]]
 +
<br>
  
=====Add PWRD nodes to our HUB=====
+
=== Value recovery ===
  
To add a new PWRD node, you will need:
+
Pandora FMS UX is capable of retrieving data directly from the website during the execution of user experience tests.
  
* A hub (PWRD in HUB mode)
+
To use this new feature, add the screenshot command as a comment in the Selenium test:
* PWRD files, on the same or different machine
 
* TCP/4444 connectivity from the computer that hosts the node to the computer that hosts the HUB.
 
  
In this work mode, the service will process all queued <b>requests from the hub (HUB)</b>, returning the results of the executions to it. It will be the HUB who will speak exclusively with the WUXServer, being transparent to the one who is executing the actions of the user.
+
<br>
 +
[[File:PWR_recorder_getValue.png|center|600px]]
 +
<br>
  
 +
In the example here, two values are retrieved after navigation and will be represented as modules in Pandora FMS (number and result in text).
  
  # Start and register in the HUB, replace "hub" with the server IP PWRD HUB
+
The steps to make the plugin collect data are as follows:
  /etc/init.d/pwrd start-node http://hub:4444/grid/register
+
* Add a new comment to your test file with the Selenium recorder.
 +
* Add the directive to the comment.
  
Check status
+
Data capture policy
/etc/init.d/pwrd status-node
 
  
  Stop it
+
  getValue;module name;module data type;regular expression for data capture
/etc/init.d/pwrd stop-node
 
  
==== Pandora Server Configuration====
+
What does each field separated by semicolons represent?
  
Regardless of the chosen mode, once started, we can start assigning executions of our browsing sessions, adding the configuration parameters of WUXServer to the configuration file of our Pandora server.
+
* <b>getValue</b>: Instruction for the UX system.
 +
* <b>Module name</b>: The name of the module as it appears in Pandora FMS.
 +
*<b>Module data type</b>: What type will be used. It can be any of the data types supported by Pandora FMS (generic_proc, generic_data, generic_data_string, async_proc, async_data, async_string...)
 +
*<b>Perl regular expression to use for data capture</b>: It must be a Perl regular expression, with the information capture command between brackets.
  
Assuming that we have deployed our PWRD server on the same server that runs our Pandora FMS server, we would add the following configuration:
+
For example, in the text:
  
  # add to /etc/pandora/pandora_server.conf
+
<pre>
wuxserver 1
+
  <p> The temperature of the solar panel is: <span class="temperature">54º C</span></p>
wux_host 127.0.0.1
+
</pre>
wux_port 4444
 
  
=== Installation on Windows ===
+
If you wish to retrieve the temperature to keep track of the value, specify the regular expression as follows:
  
Steps to prepare a working environment for Pandora WUX on Windows.
+
<pre>
 +
<span class="temperature">(\d+\.*\,*\d*).*</span>
 +
</pre>
 +
In such a way that it will recover the value 54 of the example, or possible values with decimal places.
  
<b>Nota</b>: We strongly recommend Linux to host the PWRD service.
+
The full capture directive would be as follows:
  
You can get the files needed for your deployment of the module library in https://library.pandorafms.com/index.php?sec=Library&sec2=repository&lng=en&action=view_PUI&id_PUI=816
+
<pre>
 +
getValue;solar panel temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span>
 +
</pre>
  
==== PWRD deployment on Windows systems ====
+
= Data management and display =
  
Prerequisites:
+
== Create a web analysis module in Pandora FMS Console ==
* Download [https://library.pandorafms.com/index.php?sec=Library&sec2=repository&lng=es&action=view_PUI&id_PUI=816 PWRD server ]
 
  
* Install Java 1.8 on the machine.
+
Once the browsing session is recorded, it is time to deploy it as a module in Pandora FMS console.
* Install Firefox 47.0.1 (download from https://ftp.mozilla.org/pub/firefox/releases/47.0.1/).
 
* Prepare a Firefox profile that will be used to test automated sessions (optional): http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
 
* We will create a  C:\PWR  directory
 
  
 +
To do it, access any agent linked to a server with the WUX feature enabled and create "Web analysis" module:
  
We will create the following file distribution:
+
[[File:Wux_module.PNG|center|400px]]
* File Decompression PWR_Server.zip from : ''https://pandorafms.com/library/pwr-server-for-ux-monitoring/'' into C:\PWR\
 
* Export Firefox profile to C:\PWR\profile
 
  
Using a profile for the checks is not essential, however it is recommended especially when using proxy or when using autocomplete passwords.
 
To create a profile of Firefox follow the steps in the following screenshots:
 
  
<br>
+
Once "create" is selected, fill in all the fields the form presents:
[[File:ux1.JPG|center]]
 
<br>
 
[[File:ux2.JPG|center]]
 
<br>
 
  
Choose the destination directory:
+
[[File:Wux_new_module_form2.PNG|center]]
  
<br>
+
* Module name: WUX Module (Parent). All sub-modules with the monitoring results will rely on this new module.
[[File:ux3.JPG|center]]
+
* Target web site: For monitoring website performance statistics.
<br>
+
* 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.
 +
* Data history: To save or not the historical information of the modules that monitor this user experience.
 +
* ''Textarea'' section: Text box where to copy (or load) the content of the files from the browsing session that you previously recorded.
  
We must start Firefox with the new profile to customize options such as proxy, shown popups, etc:
 
  
<br>
+
==== Custom macros ====
[[File:ux4.JPG|center]]
 
<br>
 
  
Then we install the service by executing the BAT file ''service_installer.bat'' provided and we will start the service:
+
Custom macros enabled involve replacing certain text strings present in your browsing session file with certain custom values.
  
net start PWRSRV
+
This feature has been improved for web analysis modules, enabling '''dynamic macros''' that allow these values to be translated into variable '''dates and times'''.
  
From this moment you have the Selenium server running on your machine. However, we can run it manually (by previously stopping the service) if we want to carry out ''debugging'' tasks, using the following command:
+
Why this feature?
  
java -jar selenium-server-standalone-2.53.1.jar -firefoxProfileTemplate C:\selenium\firefox_profile -port 4444 -v
+
Suppose you need to monitor, through a browsing session, the correct operation of a meeting room booking web application.
  
== To record a PWR session ==
+
If you set a fixed date and time when filling in the form data, it is possible that the system canceled the booking because at some point it is in the past. For example, you might be trying to book a room for the past week.
  
Before monitoring a user experience we must record the actions we want the system to perform, in order to browse through our web portal
+
It is also possible that you find a time limit to make that reservation, and that the system forces you to book the room within a specific time period, for example, no farther than the current month.
  
To do this we have available the "PWR recorder" utility in the [https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/  module library].
+
To avoid having to edit the macro every few days, and not worry about the configuration section, you may use dynamic macros, telling the system to always book the room for the next day at the time of performing the test.
  
Run the downloaded file to start the recording environment.
+
In order to use this feature, the values must have a specific format, achieving the following possible replacements:
Once the environment is started, you can access the recorder by clicking on the following button:
 
  
<br>
+
@DATE_FORMAT (current date/time with user-defined format)
[[File:iniciar_grabador.png|center]]
+
@DATE_FORMAT_nh (hours)
<br>
+
@DATE_FORMAT_nm (minutes)
 +
@DATE_FORMAT_nd (days)
 +
@DATE_FORMAT_ns (seconds)
 +
@DATE_FORMAT_nM (month)
 +
@DATE_FORMAT_nY (year)
  
  
You should see a window like the one shown in the image:
+
Where "n" can be an unsigned (positive) or negative number.
  
 +
And FORMAT follows the standard of [http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm strftime of perl]
  
<br>
 
[[File:ux10.JPG|center]]
 
<br>
 
  
 +
For example:
  
From this moment we will be able to browse the website that we want to monitor and the different actions of each step that we advance will appear in the recorder.
+
@DATE_%Y-%m-%d %H:%M:%S
 +
@DATE_%H:%M:%S_300s
 +
@DATE_%H:%M:%S_-1h
  
To stop recording we will use the following button, located at the top right of the recorder:
+
== Data display ==
  
 +
The information generated by WUX will be displayed in the form of modules as follows. Enabling the view in ''hierarchical mode'' in the module list will help you see the information much more clearly:
  
 
<br>
 
<br>
[[File:ux11.JPG|center]]
+
[[File:WUX_modules.PNG|center|800px]]
 
<br>
 
<br>
  
 +
Within this hierarchy you find the following modules:
  
After completing the actions, we can perform checks on the page, for example verify the existence of a certain text to ensure that the page loaded is correct. To do this we will right click on a section of text in the browser window while we continue to record, and select the option ''verifyText'':
+
* ''module''_Global_Status: It will indicate the '''global''' state of the complete navigation.
 
+
* ''module'' _ Global_Time: It will indicate the '''global''' time spent in full navigation.
<br>
+
* ''module''_ Global_Screenshot: It contains an image with the result of the navigation error, '''it will only be generated in case of error'''
[[File:ux13.JPG|center]]
+
* ''module''_Phase X: ''Phase name''_ Status: It will indicate the navigation status during phase X.
<br>
+
* ''module''_Phase X: ''Phase name''_Time: It will indicate the time spent in phase X.
  
A new step will appear in the recorder indicating the said text checking action:
+
Example: Error screenshot view.
  
 
<br>
 
<br>
[[File:ux14.JPG|center]]
+
[[File:Wux_screenshot.png|center|800px]]
 
<br>
 
<br>
  
 +
{{warning|Warning: If you have updated from previous versions to Pandora FMS 7.0NG 712, you must make a small change.}}
  
We can reproduce the entire sequence using the button ''Play Entire test suite'' and check that successfully completes:
+
In order to store the screenshots generated by WUX Server, you will need to launch the following operations in your database schema:
  
<br>
+
alter table tagent_status modify column data mediumtext;
[[File:ux15.JPG|center|800px]]
+
alter table tagent_data_string modify column data mediumtext;
<br>
 
  
 +
If you do not perform, you may not see the full screenshot.
  
After verifying the validity of the sequence of navigation, save it (File -> Save Test Case).This will be the file that we will load when creating a new web analysis module in our Pandora console.
+
By accessing the ''WUX''section of the agent, you may see additional details of the transaction and its stages:
  
 +
<center>
 +
[[File:Wux_nueva_imagen.png]]
 +
</center>
  
=== Record a transactional session for Pandora WUX ===
+
Website statistics are summarized in the following concepts:
  
Pandora WUX allows you to split browsing monitoring of a website into multiple modules, representing each of the steps performed.
+
* '''Stats_TT''': Total time to load the website.
 +
* '''Stats_TDNS''': Total time to solve the target's IP address.
 +
* '''Stats_TTCP''': Time spent connecting through TCP.
 +
* '''Stats_TSSL''': Time spent establishing SSL communication.
 +
* '''Stats_TST''': Time elapsed until data transfer started.
 +
* '''Stats_TTC''’: Time transferring data. It will group all the resource transfer times.
 +
* '''Stats_TTR''': Time taken to transfer the content of the page.
 +
* '''Stats_TTR_main''': Time used to transfer the HTML code.
 +
* '''Stats_TTR_image''':  Time spent transferring image type resources (png|jpg|jpeg|bmp|tiff|gif|webp|svg).
 +
* '''Stats_TTR_css''': Time taken to transfer style sheets.
 +
* '''Stats_TTR_js''': Time spent transferring JavaScript files.
  
To insert a new control point and generate the phase modules (up until that point) right-click on the point where you want to identify the start phase.
+
== Assign alerts to a web analytics module ==
  
<br>
+
The alerts associated with the web analysis modules follow the same operating dynamics as the entire alert system in Pandora FMS.  
[[File:pwrd_recorder_transaction.PNG|center]]
 
<br>
 
  
We will write the next text as a comment:
+
For compatibility purposes, it is recommended to assign the alert templates on the sub-elements self-generated by the web analysis module, such as:
  
phase_start:name_of_phase
+
* The status of global navigation.
 +
* Alerts about time thresholds.
 +
* Alerts with warning template set to "always" for result screenshot modules.
  
The Phase will encompass the time and result of all commands that exist up until the following comment:
+
== New widgets for Dashboards ==
  
phase_end:name_of_phase
+
In order to represent user navigation information, two new types of widgets have been added:
  
All commands that are run between a phase_start y phase_end label will be covered in this phase.
+
Navigation phase status widget:
 +
<br>
 +
[[File:widget_wux_fases.PNG|center]]
 +
<br>
  
 +
Website statistics widget:
 
<br>
 
<br>
[[File:pwrd_recorder_transaction2.PNG|center]]
+
[[File:widget_wux_stats.PNG|center]]
 
<br>
 
<br>
  
== Creating a Web Analytics module in Pandora FMS Console ==
+
= Desktop User Experience (PDR) =
  
Once we have our browsing session recorded, it's time to deploy it as a module in Pandora FMS console.
+
== PDR system deployment (Windows only) ==
  
To do so , we will access to '''any agent associated with a server with WUX feature enabled''' and we will create a module "Web analysis":
+
The PDR system only works on Windows systems, and once it is run by the Pandora FMS agent, it must run in '''process mode''', since running in service mode will not work. Also, it will not be possible to lock the desktop session, so it is recommended to use it on virtual machines.
  
[[File:Wux_module.PNG|center|400px]]
+
Prerequisites:
 +
* Windows system in desktop mode with auto start and auto login.
  
 +
To achieve this configuration, execute:
 +
control userpasswords2
  
 +
And uncheck the box "Users must enter a username and password to use this computer":
  
 +
<br>
 +
[[File:ux5.JPG|center]]
 +
<br>
  
After selecting "create" we must fill in all fields showed in the form:
+
To prepare the environment, create the following directories:
  
[[File:Wux_new_module_form2.PNG|center|800px]]
+
C:\PDR
  
* Module Name: Module WUX (Father), all sub-modules with monitoring results will be dependent on this new module.
+
And unzip the "PDR.rar" file provided in the following link: ''https://pandorafms.com/library/pdr-cmd-for-ux-monitoring/'' in ''C:\PDR''.
* Target Web site: For monitoring performance statistics of website.
 
* Run performance test: Indicates that we want to monitor not only the browsing experience, but also the performance statistics of access to the target web site.
 
* Historical data: Saving or not saving the historical data modules that monitor that user experience.
 
* '' textarea '' section: in this text box  we must copy (or upload) content files of the browsing session we have previously recorded.
 
  
 +
== Record a PDR session ==
  
 +
To start the recorder, run the following script:
  
==== Custom Macros ====
+
C:\PDR\pdr
  
The operation of custom macros involves the substitution of certain text strings that are present in our file of browsing session with certain customizable values.
+
<br>
 +
[[File:scriptwux22332.png|center]]
 +
<br>
  
In the case of web analytics modules, this feature has been improved, allowing  '''dynamic macros'''  which allow these values to be translated into  '''dates and times '''  variables.
+
After the loading process, enter the recording environment:
  
Why this feature then?
+
<br>
 +
[[File:ux18.JPG|center|800px]]
 +
<br>
  
Let’s suppose that we need to monitor, through a browsing session, the proper functioning of a web application that focus on booking meeting rooms.
+
Select the actions you wish to perform and do a screenshot on the area where you want to apply them. Below you can find a list with the most common ones.
  
If we establish a date and time fixed, the system would probably cancel the reservation because at some point it might stay in the past , for example could be trying to book a room for  last week.
+
General actions:
  
We may also find a maximum of time to carry out that reservation, and that the system requires us to book the room within a certain period of time, for example, not exceeding the current month.
+
<br>
 +
[[File:ux19.JPG|center]]
 +
<br>
  
To avoid editing the macro every few days, and worrying  about the configuration section, you can use the dynamic macros, telling the system to always book the room for the next day when doing the test.
+
Flow control actions:
  
 +
<br>
 +
[[File:ux20.JPG|center]]
 +
<br>
  
To use this feature, the values must have a specific format, making possible the following substitutions:
+
More language help: http://sikulix-2014.readthedocs.io/en/latest/index.html
  
@DATE_FORMAT (current date / time with user-defined format)
+
When recording the project, a folder will be created that will contain the following elements:
@DATE_FORMAT_nh (hours)
+
* .py file with the automation script code.
@DATE_FORMAT_nm (minutes)
+
* Images to control navigation.
@DATE_FORMAT_nd (days)
 
@DATE_FORMAT_ns (seconds)
 
@DATE_FORMAT_nM (month)
 
@DATE_FORMAT_nY (years)
 
  
 +
A simple example of execution could be monitoring that your Windows calculator works correctly. We will show the whole process through screenshots.
  
"n" may be an unsigned number (positive) or negative.
+
1. Choose the "click" action and the area where you wish to apply the action. The screen will change to "area selection" mode:
  
And FORMAT follows the standard [http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm strftime de perl]
+
<br>
 +
[[File:ux21.JPG|center]]
 +
<br>
 +
[[File:ux22.JPG|center]]
 +
<br>
  
 +
2. Enter the action ''type'' and the text "calc". Then enter the actions to wait for the "calculator" area to appear and click on it. Then wait for the calculator window to appear to enter the following actions this way:
  
Examples:
+
<br>
 +
[[File:ux23.JPG|center]]
 +
<br>
  
@DATE_%Y-%m-%d %H:%M:%S
+
3. Then click on the corresponding buttons, selecting the areas as in the previous steps.
@DATE_%H:%M:%S_300s
 
@DATE_%H:%M:%S_-1h
 
  
== Uploading certificates to Firefox profile ==
+
4. Finally save the process and run it using the '''Run''' button.
  
It is possible that some of the configured checks will run against web pages that use self-signed certificates or signed by a CA not included in the Firefox default accepted CA, so in such cases it will be necessary to load the certificate in question into the Firefox profile being used.
+
Important comments:
 +
* If you double click on any of the images within the recording environment, you may adjust details of the control screenshot, such as selecting the exact point where to click.
 +
* It is highly recommended to enter actions such as ''wait'' after each click to make sure that the execution will not stop due to an operating system delay.
 +
* The recorder will search for the area that looks the same as the screenshot, so special care should be taken in case something is highlighted when the button is located above (for example, the calculator buttons change to orange when the mouse is hovering over them).
  
To do this, the easiest way is to launch the browser in a graphical environment, access the URL and add the SSL certificate. Next we will explain how to do it both in Windows and Linux:
+
In the folder where you stored the recording you may see the image files and the Python file.
  
=== With PWRD deployed on Windows systems ===
+
<br>
 +
[[File:ux24.JPG|center]]
 +
<br>
  
In this case, since we will have a graphical environment, we only have to start the Firefox browser with the profile we are using for checks:
+
<b><u>Nota</u>:</b> You can customize the capture made from the PDR recording engine using the following code:
  
[[File:Profile_01.png|center]]
+
## OPTIONAL ##capture file names
 +
import shutil
 +
file = "C:\probes\screenshot_prueba.sikuli.png"
 +
focusWindow = App.focusedWindow()
 +
regionImage = capture(focusWindow)
 +
shutil.move(regionImage, file)
  
[[File:Profile_02.png|center]]
 
  
Once started, access the URL with the certificate you want to upload and add it as an exception for the browser:
+
This will create an image of the active window in the destination indicated by file, with which you may take a screenshot right when you want.
 +
You may customize the screenshot using coordinates. To that end, specify the following syntax:
  
[[File:Profile_03.png|center]]
+
capture(x, y, w, h)
  
[[File:Profile_04.png|center]]
+
Where:
  
Another possibility, if you want to accept any SSL certificate, would be to access the Firefox options, the "Privacy & Security" tab, and uncheck the field "Query OCSP responder servers to confirm the current validity of certificates":
+
X: X position of the rectangle to take a screenshot on.
  
[[File:Profile_05.png|center]]
+
Y: Y position of the rectangle to take a screenshot on.
  
[[File:Profile_06.png|center]]
+
W: Screenshot width.
  
=== With PWRD deployed on Linux systems ===
+
H: Screenshot height.
  
In general, when a Linux server is installed, it does not include a graphical desktop environment, so in order to follow the same steps as in the previous case we have to make a redirection of the graphical X to a computer where we do have a graphical desktop environment. This is done differently if we redirect the X to a graphical desktop in Linux or Windows.
+
<br><br>
  
==== Redirecting X11 to a Linux desktop ====
+
=== Record a transactional session with Pandora FMS UX PDR ===
  
Doing this is very simple, since it will be enough to establish an SSH connection to the PWRD server with the "-X" parameter:
+
It is not necessary to record a specific session. Just record the sessions you need in different scripts. It will be Pandora FMS UX who manages the return of results to organize it as a complex transaction. In the next point, we will see how to make the execution call for it to work correctly.
  
ssh -X [email protected]_ip_address
+
If you are going to make several recordings to create a transactional process, be careful when making the recording and make sure the elements you are looking for are present. It is recommended to manually execute the recordings that you wish to use in a single transactional process continuously, to ensure that the actions proceed as expected.
  
Having done this, if we launch the Firefox browser, we can see how it shows on our desktop:
+
The following example contains a recording process that will represent the second phase of the process used in the previous example. The result returned by the calculator is copied and pasted into a notebook. The recording looks like this:
  
firefox -p
+
<br>
 +
[[File:ux40.JPG|center]]
 +
<br>
  
In a default installation we will only see the default profile, so it would be advisable to do as in the Windows installation and create a new profile to use:
+
And another sequence that will consist of saving the text file in a certain location is included, overwriting the previous one. This offers high flexibility, since it opens the possibility of monitoring these files at the same time, reflecting the needed information in all kinds of checks for heavy desktop applications. This third sequence consists of the following steps:
  
[[File:Profile_07.png|center]]
+
<br>
 +
[[File:ux43.JPG|center]]
 +
<br>
  
[[File:Profile_08.png|center]]
+
== PDR session execution ==
  
[[File:Profile_09.png|center]]
+
=== Standard execution ===
  
If you save the profile in a path other than '''/opt/firefox_profile''', you will need to edit the PWRD start script '''/etc/init.d/pwrd''' to indicate the path to the new profile:
+
To launch pre-recorded PDR sessions, the working mode indicated is the path to the pdr.cmd file displayed at the corresponding point, the argument of said "-r" file, the file that contains the session directives (-script), the directory where to store the screenshots (-folder) ending in "\", which is optional, where to save the screenshots in the folder where the pdr is located. You may also enter the number of consecutive retries in case of failure, optional parameter.
  
PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"
+
In the next run, the screen capture is also customized to collect only the active window:
  
With the profile created, you can start the browser:
+
pandora_ux_x64 -exe C:\PDR\pdr -args -r -script C:\pandora_ux\calculadora.sikuli -folder C:\pandora_ux\ -ss_config active -retries 3
  
[[File:Profile_10.png|center]]
+
The following modules will be returned:
 +
* UX_Time_project_name.
 +
* UX_Status_project_name.
 +
* UX_Control_Snapshot_project_name (only on the first run).
  
Once started, access the URL with the certificate you want to upload and add it as an exception for the browser:
+
If there is an error at any stage, the following module will also be created:
 +
* UX_Snapshot_project_name.
  
[[File:Profile_11.png|center]]
+
And it will show an image of the active window (with -ss_config active) from when the failure took place.
  
[[File:Profile_12.png|center]]
+
Example of successful execution:
  
Another possibility, if you want to accept any SSL certificate, would be to access the Firefox options, in the "Advanced > Certificates" tab, and deselect the field "Query the OCSP respondent servers to confirm the current validity of the certificates":
+
<module>
 +
    <name><![CDATA[UX_Status_calculator.sikuli]]></name>
 +
    <type>generic_proc</type>
 +
    <nowiki><data><![CDATA[1]]></data></nowiki>
 +
    <description><![CDATA[C:\pandora_ux\calculator.sikuli execution completed Control snapshot rebuild ]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
</module>
 +
<module>
 +
    <name><![CDATA[UX_Time_calculator.sikuli]]></name>
 +
    <type>generic_data</type>
 +
    <nowiki><data><![CDATA[20.204]]></data></nowiki>
 +
    <description><![CDATA[C:\pandora_ux\calculator.sikuli execution completed Control snapshot rebuilt ]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
    <module_parent>UX_Status_calculator.sikuli</module_parent>
 +
</module>
 +
<module>
 +
    <name><![CDATA[UX_Control_Snapshot_calculator.sikuli]]></name>
 +
    <type>async_string</type>
 +
    <nowiki><data><![CDATA[data:image/png;base64, IBCAIAAAAOCnfhAAAAAXNSR…/4x79e/7757f8H2C00s1C73yMAAAAASUVORK5CYII=]]></data></nowiki>
 +
    <description><![CDATA[Control image rebuilt]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
    <module_parent>UX_Status_calculator.sikuli</module_parent>
 +
</module>
  
[[File:Profile_13.png|center]]
+
Example of output with failed execution:
  
[[File:Profile_14.png|center]]
+
<module>
 +
    <name><![CDATA[UX_Status_std.html]]></name>
 +
    <type>generic_proc</type>
 +
    <nowiki><data><![CDATA[0]]></data>
 +
</nowiki>    <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>
 +
    <nowiki><data><![CDATA[15.463]]></data>
 +
</nowiki>    <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>
 +
    <nowiki><data><![CDATA[data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAA…JRU5ErkJggg==]]></data>
 +
</nowiki>    <description><![CDATA[Image (last error)]]></description>
 +
    <tags>UX</tags>
 +
    <module_group>UX</module_group>
 +
    <module_parent>UX_Status_std.html</module_parent>
 +
</module>
  
==== Redirecting X11 to a desktop in Windows ====
+
If everything turned out to be a success, you may add the execution line to the Pandora FMS agent installed on the Windows machine as an agent plugin. The line to add to the agent configuration file will look like this (in a single line):
  
In the case of Windows, first we will have to install an X server to be able to do the redirection, as for example '''Xming'''. Once installed and started, we will be able to do the X redirection.
+
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"
  
Using the SSH Putty client, we will have to go to the section "Connection > SSH > X11" before making the connection, and make sure that we mark the option "Enable X11 forwarding" as well as fill the field "X display location" as "localhost:0":
+
As you can see, this run has a few more options. The ''-checkpoint'' parameter is used to show a screenshot of the result, even if there is no failure. ''-post'' will execute actions after the session playback is finished. In this case, the calculator process that started the recording is closed, to prevent the system from failing due to too many open windows or similar processes.
  
[[File:Profile_15.png|center]]
+
Now that the agent has the execution line ''module_plugin'' ready, it is launched in process mode, executing the following from the command line as administrator:
  
Then we go back to the "Session" section and establish the connection:
+
"C:\Program Files\pandora_agent\PandoraAgent.exe" --process
  
[[File:Profile_16.png|center]]
+
Obviously, the full path to the executable "PandoraAgent.exe" must be the one corresponding to the installation.  
  
Once the connection is established, if we launch the Firefox browser on the PWRD server, we will be able to visualize it on the Windows desktop.
+
When launching it, the actions will be executed automatically according to the recording. From that point onwards '''the agent process should not be closed''', and you should not log in the machine through remote desktop, or the executions could be interrupted. The machine must be left unhandled, that is why its use is recommended in virtual machines.
  
firefox -p
+
<center>
 +
[[File:imagen_nueva_pdr.png]]
 +
</center>
  
In a default installation we will only see the default profile, so it would be advisable to do as in the Windows installation and create a new profile to use:
+
{{Tip|If you already have automation tests, they can be included in Pandora FMS with the following execution.}}
  
[[File:Profile_17.png|center]]
+
pandora_ux.64 -exe <exe of the automation system> -args <system arguments> -script <test file path>
  
[[File:Profile_18.png|center]]
+
=== Transaction-based execution ===
  
[[File:Profile_19.png|center]]
+
If you have recorded different processes with PDR and you have checked they work by playing them continuously, run:
  
If you save the profile in a path other than '''/opt/firefox_profile''', you will need to edit the PWRD startup script '''/etc/init.d/pwrd''' to indicate the path to the new profile:
+
C:\Users\artica\Documents\Producto\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
  
PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"
+
As it can be seen, just indicate the path of the new script in the ''-script'' parameter separated by a comma from the previous script and use the '''-t''' parameter with the name of the transaction that will include the different phases . If the process had more phases, the same logic would be followed, for example:
  
With the profile created, you can start the browser:
+
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
  
[[File:Profile_20.png|center]]
+
The line to add to the agent configuration file, in this case, is the following:
  
Once started, access the URL with the certificate you want to upload and add it as an exception for the browser:
+
module_plugin C:\Users\artica\Documents\Producto\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"
  
[[File:Profile_21.png|center]]
+
Thanks to the ''-checkpoint'' parameter, you may see screenshots of the result of each phase in the Pandora FMS console.
  
[[File:Profile_22.png|center]]
+
The following modules will be returned by stage:
 +
* UX_Time_project_name.phase_order
 +
* UX_Status_project_name.phase_order
  
Another possibility, if you want to accept any SSL certificate, would be to access the Firefox options, in the "Advanced > Certificates" tab, and deselect the field "Query the OCSP respondent servers to confirm the current validity of the certificates":
+
If there is any phase with an error, the following module will also be created:
 +
* UX_Snapshot_project_name.phase_order
  
[[File:Profile_23.png|center]]
+
It will also display an image of the web at the time of the failure, should it take place.
  
[[File:Profile_24.png|center]]
+
The global summary modules identified with the following names will also be returned:
 +
* UX_Global_Time_project_name
 +
* UX_Global_Status_project_name
 +
* UX_Global_Snapshot_project_name
  
== Data viewing ==
 
  
The information generated by WUX is displayed in modules as follows. Enabling view '' hierarchically '' in the list of modules, will help us to display the information much more clearly:
+
When the agent is running in process mode and the modules are recovered by Pandora FMS you will see them in the console. Again, through the view in "hierarchical mode" you can clearly show the relationship between the modules shown, clearly defining the different phases:
  
 
<br>
 
<br>
[[File:WUX_modules.PNG|center|800px]]
+
[[File:ux41.JPG|center|800px]]
 
<br>
 
<br>
  
 
+
And in the transaction viewer, you can see the detail of the phases and the graph with the times:
Within this hierarchy we will find the following modules:
 
 
 
* ''module''_Global_Status: Indicates the '''global''' state of complete browsing.
 
* ''module''_Global_Time: Indicates the '''global''' time lapsed of complete browsing.
 
* ''module''_Global_Screenshot: contains an image with the result of browsing error, '''it will be generated only in case of error'''
 
* ''module''_Phase X: ''Name of phase''_Status: Indicates the status of the browsing in Phase X
 
* ''module''_Phase X: ''Name of phase''_Time: Indicates time lapsed in Phase X
 
 
 
Example: Error capture view.
 
  
 
<br>
 
<br>
[[File:Wux_screenshot.png|center|800px]]
+
[[File:ux42.JPG|center|800px]]
 
<br>
 
<br>
  
{{warning|Attention: If you upgraded from versions prior to Pandora FMS 7.0NG 712 you must make a small change.}}
+
The error traps will only be shown when the UX client (PWR) and the PWR server are running on the same machine. Otherwise, the directory for image delivery by the PWR server must be accessible by the client in order to display the image in Pandora FMS.
  
In order to store the screenshots generated by WUXServer, you must execute the following operations on your database schema:
+
It will be on these modules where you may create alerts and see the history to build graphs and show the evolution of your systems over time.
  
alter table tagente_estado modify column datos mediumtext;
+
It is recommended to create a scheduled task that starts the Pandora FMS agent in process mode when the computer starts. This will not interrupt executions even if the system is forcefully restarted and if it is in automatic login mode without password, the agent will always be run even if the machine is restarted.
alter table tagente_datos_string modify column datos mediumtext;
 
  
If you don't execute this actions, your screenshots may be incomplete or cropped
 
 
Accessing the ''WUX'' section Agent , we can view additional details of the transaction and its phases:
 
 
<center>
 
[[File:Wux_nueva_imagen.png]]
 
</center>
 
 
 
 
Website statistics are summarized in the following concepts:
 
 
* '''Stats_TT''': Total time to obtain the website.
 
* '''Stats_TDNS''': Total time to resolve the IP address of the target.
 
* '''Stats_TTCP''': Time spent on connecting via TCP..
 
* '''Stats_TSSL''': Time spent on establishing SSL communication.
 
* '''Stats_TST''' : Time lapsed until data transfer started.
 
* '''Stats_TTC''' : Time spent transferring data, It will gather all the transfer time of the resources.
 
* '''Stats_TTR''' : Time used to transfer the content of the page.
 
* '''Stats_TTR_main''': Time lapsed to transfer the HTML code.
 
* '''Stats_TTR_image''':  Time used to transfer resources of  type of image (png|jpg|jpeg|bmp|tiff|gif|webp|svg).
 
* '''Stats_TTR_css''': Time spent on transferring style sheets.
 
* '''Stats_TTR_js''': Time spent on transferring the JavaScript files.
 
 
== Assign alerts to a web analysis module ==
 
 
Alerts associated with Web analysis modules follow the same dynamics of operating as the entire system of alerts in Pandora FMS.
 
 
For compatibility, it is recommended to assign templates of alerts on self-generated sub-elements by the analytics web module, such as:
 
 
* The state of the global browisng
 
* Alerts on thresholds times
 
* Emails warning template set as "always" for screenshots modules of results
 
 
 
 
== New widgets for Dashboards ==
 
 
To be able to display user browsing information, two new widget types have been added:
 
 
Widget for status of browsing phases
 
 
<br>
 
<br>
[[File:widget_wux_fases.PNG|center]]
+
[[File:ux26.JPG|center]]
 +
<br>
 +
[[File:ux27.JPG|center|800px]]
 +
<br>
 +
[[File:ux28.JPG|center]]
 +
<br>
 +
[[File:ux29.JPG|center]]
 +
<br>
 +
[[File:ux30.JPG|center]]
 +
<br>
 +
[[File:ux31.JPG|center]]
 +
<br>
 +
[[File:ux32.JPG|center]]
 
<br>
 
<br>
  
 +
That way you will ensure the Pandora FMS agent will always be running in process mode in this Windows system, even when the machine is restarted, being able to always send the information collected by the PDR probe.
  
 +
Systems with multiple desktops can be troublesome, so it is always recommended to use the configuration described above, on a desktop-mode machine with auto-login and a single desktop.
  
Widget for website statistics
+
 
<br>
+
[[Pandora:Documentation|Go back to Pandora FMS Documentation Index]]
[[File:widget_wux_stats.PNG|center]]
 
<br>
 

Latest revision as of 11:21, 8 September 2020

Contents

1 Introduction

User experience monitoring consists of recording automated tasks both for web browsing (PWR / WUX) and for interacting with Windows desktop and system applications (PDR). These recordings can consist of a mouse click on a browser, writing a text, searching throughout the Internet or opening an application on the desktop. This will allow you to perform the recorded functions automatically and they will be executed to obtain results, such as the time spent performing the tasks. To that end, there is automated UX monitoring and user web experience (WUX) monitoring.

From Pandora FMS version 7.0NG.728, UX and WUX monitoring have been merged with Pandora FMS console, offering both features on a single screen.

Wux ux unifcado.png

Next, we will see the differences between WUX and UX systems and the description of both features along with the different possibilities they offer.

2 Differences between UX and WUX monitoring

Both monitoring systems are used to execute automated web browsing tasks using Pandora Web Robot Daemon (PWRD) system.

The UX system performs these monitoring tasks using the software agent installed on a machine, while WUX monitoring is based on a server integrated within Pandora FMS.

Pandora Web Robot Daemon (PWRD) is a service that provides the necessary tools to automate web browsing sessions. To do it, it uses a file that contains a list of the actions necessary to navigate the user's web portal.

Additionally, UX monitoring enables the execution of the automated tasks that interact with Windows desktop and system applications. These types of tasks cannot be performed with WUX.

Pandora FMS UX is a system that executes automated tasks, giving Pandora FMS a report with the execution results, time spent and screenshots with the errors that may be found.

Pandora FMS PWR technology for UX allows browsing websites, simulating user actions. You may check content, texts, etc. It is the perfect choice for monitoring non-flash-based web sites and applications. Its advantage: it is faster and offers the possibility of running in the background.

If you have a task automation system, Pandora FMS UX also allows you to execute the scripts you already have and monitor their execution.

It is important to specify the use of this type of monitoring. Both methods are based on monitoring execution by means of a plugin in the software agents installed in the corresponding machines.


Info.png

For web transaction execution, use Selenium Engine.

 



3 Web User Experience (WUX) with Selenium 3


For Selenium deployment on WUX servers, a container-based stack will be used for fast deployment and easy scaling.

3.1 Previous settings

Docker and Docker Compose must be previously installed and we recommend using CentOS as the base operating system.

For this installation, we recommend following the Docker documentation at: https://docs.docker.com/engine/install/

The official Selenium images will be used for the installation and deployment of the stack. You may find them at: https://hub.docker.com/u/selenium

Different images with browsers are available in the Selenium repository. For Pandora FMS, we recommend Firefox and Chrome containers.

3.2 Selenium Stack Deployment

To deploy the Selenium stack, it will be necessary to first create a YAML file with the necessary configuration:

# To execute this docker-compose yml file, use `docker-compose -f <file_name> up`
# Add the `-d` flag at the end for detached execution
version: "3"
services:
  selenium-hub:
    image: selenium/hub:3.141.59-zinc
    container_name: selenium-hub
    ports:
      - "4444:4444"
    environment:
      - GRID_BROWSER_TIMEOUT=60000
      - GRID_TIMEOUT=60000
      - GRID_MAX_SESSION=50
      - GRID_CLEAN_UP_CYCLE=60000
      - GRID_UNREGISTER_IF_STILL_DOWN_AFTER=180000
      - GRID_NEW_SESSION_WAIT_TIMEOUT=60000
  chrome:
    image: selenium/node-chrome:3.141.59-zinc
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
  firefox:
    image: selenium/node-firefox:3.141.59-zinc
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444

It can be saved as docker-compose.yml to make identifying it easier.

To activate the container with the defined settings, just run the following command:

docker-compose -f <compose-file> up -d

If you need to check the services running in the container, use the following command:

docker-compose -f <compose-file> ps

To see the status and logs of Selenium services, use the following command:

docker-compose -f <compose-file> logs

Once the appropriate checks have been made, to verify the grid works properly and the workers have signed up as you defined in the configuration file, go to the following URL:

http://<ip_selenium_server>:4444/grid/console


Newux4.png

If you need to scale the number of workers, just run the following command:

docker-compose -f <compose-file> scale chrome=X firefox=Y

3.2.1 Upload pwrd images from ISO

If you do not have Internet access to connect to Docker Hub servers and download the images, you will find everything you need in Pandora FMS ISO.

The steps to be followed are:

  • Build the pandora_enterprise ISO in /mnt
  • Copy the file pwrd.tar.gz (600M => 1.7G) to /root
  • Unzip.
  • Import the images.
$ mount /dev/cdrom0 /mnt
$ cp /mnt/Packages/pwrd.tar.gz /root/
$ cd /root
$ tar xvzf pwrd.tar.gz
$ docker load < chrome.node*.tar
$ docker load < firefox.node.*.tar
$ docker load < hub.3.*.tar

To check that the images have been correctly uploaded, the following command will be run:

docker images

3.3 Selenium service infrastructure

Selenium works as a hub where a container, that works as a grid where to deploy the necessary worker containers, is enabled.

Newux9.png

3.4 Pandora FMS Configuration

To use the centralized mode (WUX) it will be necessary to apply the following configuration to the Pandora FMS server.

Regardless of the chosen mode, once started you may start assigning executions from your browsing sessions, adding the WUX Server configuration parameters to the configuration file of your Pandora FMS server.

Assuming that you have deployed your PWRD server on the same server where your Pandora FMS server runs, add the following configuration:

# add to /etc/pandora/pandora_server.conf
wuxserver 1
wux_host 127.0.0.1
wux_port 4444

The configuration file of Pandora FMS server has a new token to clean queued navigation sessions.

clean_wux_sessions 1 (default)

3.5 Appendix: Add workers for Internet Explorer and Microsoft Edge

If it is necessary to launch web transactions against Microsoft browsers, it will be necessary to configure a machine (physical or virtual) with the desired Windows version and configure the driver following the official documentation.

Internet Explorer driver installation documentation:

github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

Info.png

We recommend using driver 3.141 version 32bit to avoid performance 64bit version problems.

 


Microsoft Edge driver installation documentation:

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

To run Selenium, Java must be installed on the Windows device.

To check whether Java is installed, run this command:

java -version

You should get an output like the following:

Newux1.png

The Selenium JAR file will also be required to run the server locally and register it on your grid.

It can be obtained at:

https://www.selenium.dev/downloads/

Newux2.png

To activate the Microsoft Edge server, the following must be run in a terminal in the directory where you have the JAR file:

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"

The command is similar to activate the Internet Explorer server, but the path of the downloaded driver must be specified:

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"

Newux3.png

Template warning.png

The Windows Firewall must be configured to allow traffic on the ports specified in the run command. In the case of examples 5555 and 4444.

 


3.6 Recording

Template warning.png

It should be taken into account that the recordings made in Selenium 2 may not work properly.

 


For Selenium version 3, both old and new recordings will be supported.

In order to record a new session, the Selenium IDE extension must be installed in the desired browser.

The next icon will be the one that allows to start the recording environment once the extension is installed.

Newux10.png

A menu that will allow to start new recording projects will open.

Newux5.png

Once the recording is made, it will result in something like the following:

Newux6.png

Apart from the feature provided by Selenium, Pandora FMS has custom commands to retrieve information from the target to be monitored.

3.6.1 Commands

The list of compatible commands available can be found here.




4 Web User Experience (WUX) with Selenium 2

4.1 Previous settings

4.1.1 Selenium

4.1.1.1 Pandora Web Robot Daemon (PWRD) deployment

Pandora FMS Web Robot Daemon is a service that provides the necessary tools to automate web browsing sessions, using a file that contains a list of the actions necessary to navigate the user's web portal.

It comes integrated with the Pandora FMS server and can be found in the /usr/share/pandora_server/util/pwrd folder when installing the Enterprise server (Linux) or in the module library (Windows).

To download it, go to the following link: https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/

It contains:

  • Firefox browser binary version 47.
  • Pre-built profile for executing web browsing sessions.
  • Session automation server (Selenium server).

4.1.1.2 Selenium server deployment on Windows systems

Prerequisites:

C:\PWR

To download the PWR_Server.zip, go to the following link: https://pandorafms.com/library/pwr-server-for-ux-monitoring/

Do the following file distribution:

  • Unzip the PWR_Server.zip file to C:\PWR\
  • Export Firefox profile to C:\PWR\profile

The use of a profile to carry out checks is not mandatory, however it is recommended particularly when using a proxy or wanting to use password autocompletion. To create a Firefox profile, follow the steps from the following screenshots:


Ux1.JPG


Ux2.JPG


Choose the destination directory:


Ux3.JPG


Start Firefox with the new profile to customize options such as proxy, popup display, etc.:


Ux4.JPG


Next, install the service by executing the provided BAT file service_installer.ba . For the service_installer.bat to work properly, modify the content, typing in the paths that exist in the file as they are installed on your machine. For example, Java can only work if you have correctly configured its PATH. Otherwise, you will have to provide the full PATH inside the file. Finally, start the service:

net start PWRSRV

From this point, the Selenium server is running on your machine. However, you may execute it manually (stopping the service previously) in case you wish to perform debugging tasks, using the following command:

java -jar C:\PWR\server\selenium-server-standalone-2.53.0.jar -firefoxProfileTemplate C:\PWR\profile -port 4444 -v

4.1.1.3 Selenium server deployment on Linux systems

Prerequisites:

The Selenium component of the PWRD daemon requires Java to work, so it needs to be installed:

yum install java 

For PWRD to be able to launch Firefox on your Linux server, it will be necessary to install xorg-x11-server-Xvfb, gtk2 and gtk3 in order to virtualize a graphical environment:

yum install xorg-x11-server-Xvfb gtk2 gtk3

If it is not available in your repositories, you may find the rpm files in the following links: ftp://rpmfind.net/linux/centos/6.6/os/x86_64/Packages/xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm

ftp://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/gtk2-2.24.31-1.el7.x86_64.rpm

To manually install the rpm packages:

yum install xorg-x11-server-Xvfb-1.15.0-22.el6.centos.x86_64.rpm
yum install gtk2-2.24.31-1.el7.x86_64.rpm

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:

cd /usr/share/pandora_server/util/pwrd/
./install_pwrd.sh --install

Once installed, start the service:

/etc/init.d/pwrd start

Use the following script to start the Selenium server:

#!/bin/sh
# Monitoring selenium process
if [[ "`ps aux |grep selenium |grep -v grep |grep -v selenium.sh |wc -l `" != "0" ]]; then
   exit
else
   if [[ "`ps aux |grep Xvfb |grep -v grep | wc -l `" != "0" ]]; then
      Xvfb :99 -ac &
      export DISPLAY=:99
   fi
   export DISPLAY=:99
   java -jar /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar &
fi

Or manually with the following commands:

$ Xvfb :99 -ac &
-> Press Enter to continue
$ export DISPLAY=:99
$ java -jar  /usr/share/pandora_server/util/pwdr/selenium-server-standalone-2.53.1.jar -port 4444 &


In version 730 and later, the possibility of performing the custom installation with a user and a directory different from those of the default installation has been added.

4.1.1.3.1 PWRD operating modes

PWRD provides several operating modes:

  • Standalone: This standard mode will launch a single PWRD instance. Each of these instances will be associated with a Pandora FMS server.
  • HUB: Hub mode. In this mode, the PWRD service will not evaluate the browsing sessions directly, but "nodes" must be registered to execute the tasks. It is the cluster mode of the PWRD service. Each HUB will be assigned to a Pandora FMS server.
4.1.1.3.1.1 PWRD in standalone mode

PWRD in standalone mode will start the daemon and get it ready to execute the actions indicated by the user through WUX Server.


Wux pwrd standalone.png



# Start
/etc/init.d/pwrd start
# see the status
/etc/init.d/pwrd status
# stop
/etc/init.d/pwrd stop


4.1.1.3.1.2 PWRD in "HUB" mode

The hub mode will start the daemon as a load balancer. In this work mode, the system will balance the load among all the nodes that are registered on it, assigning browsing session execution to the nodes according to their workload.

You can see the HUB status at any time by accessing the HUB administration console:

http://hub:4444/grid/console



Wux pwrd hub.png



# Start
/etc/init.d/pwrd start-hub
# see the status
/etc/init.d/pwrd status-hub
# stop
/etc/init.d/pwrd stop-hub


4.1.1.3.1.3 Add PWRD nodes to your HUB

To add a new PWRD node, you will need:

  • A hub (PWRD in HUB mode).
  • PWRD files, on the same or on different machines.
  • TCP / 4444 connectivity from the computer hosting the node to the computer hosting the HUB.

In this working mode, the service will process all those requests queued from the hub (HUB) , giving back the results of the executions. It will be the HUB who will speak exclusively with the WUX Server, for which the one who executes the user's actions is visible.

# Start and sign up in the HUB, replace "hub" with the IP of the PWRD HUB server
/etc/init.d/pwrd start-node http://hub:4444/grid/register
# see the status
/etc/init.d/pwrd status-node
# stop
/etc/init.d/pwrd stop-node

4.1.1.4 Pandora FMS server configuration

To use the centralized mode (WUX), it will be necessary to apply the following configuration to the Pandora FMS server.

Regardless of the chosen mode, once started you may start assigning executions from your browsing sessions, adding the WUX Server configuration parameters to the configuration file of your Pandora FMS server.

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
wuxserver 1
wux_host 127.0.0.1
wux_port 4444


4.1.1.5 Uploading certificates for Firefox

It is possible that some of the configured checks are executed against web pages that use self-signed certificates or signed by a CA not included in those accepted by default in Firefox, so in those cases it will be necessary to load the certificate itself in the Firefox profile that is being used.

The easiest way to do it is to start the browser in a graphical environment, access the URL and add the SSL certificate. Next, we will explain how to do it both in Windows and Linux:

4.1.1.5.1 With PWRD deployed on Windows systems

In this case, since you have a graphical environment, just start the Firefox browser with the profile used for the checks:

Profile 01.png
Profile 02.png

Once started, access the URL with the certificate you want to load and add it as an exception for the browser:

Profile 03.png
Profile 04.png

Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":

Profile 05.png
Profile 06.png
4.1.1.5.2 With PWRD deployed on Linux systems

In general, when a Linux server is installed, it is not included in a graphical desktop environment, so in order to follow the same steps as in the previous case, redirect the graphical Xs to a computer where you do have a graphical desktop environment. This is done differently if we redirect the Xs to a graphical desktop in Linux or Windows.

4.1.1.5.2.1 Redirecting X11 to a Linux desktop

Doing it is very simple, since it will be enough to set an SSH connection to the PWRD server with the parameter "-X":

ssh -X [email protected]_ip_address

Once this is done, if you launch the Firefox browser, it will be shown on your desktop:

firefox -p

In a default installation, you will only see the "default" profile, so it would be advisable to do as in the installation in Windows and create a new profile to use:

Profile 07.png
Profile 08.png
Profile 09.png

In case of saving the profile in a path other than /opt/firefox_profile, it will be necessary to edit the PWRD starting script /etc/init.d/pwrd to indicate the path to the new profile:

PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"

With the created profile, you can start the browser:

Profile 10.png

Once started, access the URL with the certificate you want to load and add it as an exception for the browser:

Profile 11.png
Profile 12.png

Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":

Profile 13.png
Profile 14.png
4.1.1.5.2.2 Redirecting X11 to a Windows desktop

In Windows, first install an X server to be able to redirect, such as Xming. Once installed and started, redirect the Xs.

Using the SSH Putty client, go to the "Connection> SSH> X11" section before connecting, and make sure you check the "Enable X11 forwarding" option and fill in the "X display location" field as "localhost:0":

Profile 15.png

Then go back to the "Session" section and establish the connection:

Profile 16.png

Once the connection is established, if you launch the Firefox browser on the PWRD server, you may see it on the Windows desktop.

firefox -p

In a default installation, you will only see the "default" profile, so it would be advisable to do as in the installation in Windows and create a new profile to use:

Profile 17.png
Profile 18.png
Profile 19.png

In case of saving the profile in a path other than /opt/firefox_profile, it will be necessary to edit the PWRD starting script /etc/init.d/pwrd to indicate the path to the new profile:

PWROPTS=" -firefoxProfileTemplate /path/to/profile/folder"

With the created profile, you can start the browser:

Profile 20.png

Once started, access the URL with the certificate you want to load and add it as an exception for the browser:

Profile 21.png
Profile 22.png

Another possibility, if you want to accept any SSL certificate, would be to go to Firefox options, go to "Privacy & Security" and uncheck the field "Check responding OCSP servers to guarantee the current validity of the certificates":

Profile 23.png
Profile 24.png


4.1.2 Session Recorder (PWR)

Template warning.png

The new Selenium IDE version will be supported by Pandora FMS version 745 onwards, when Selenium 3 is implemented. Transactions recorded in Selenium 2 will not be affected.

 


Template warning.png

Session recordings with Selenium 2 can only be done with Firefox.

 


Before monitoring a user experience, record it. Use the appropriate recording system according to the type of technology you chose.

To record a navigation with PWR, you will need the PWRD recorder available in the module library:

https://pandorafms.com/library/pandora-ux-and-wux-pwr-recorder/

It contains:

Start the PWR_recorder.exe recorder:


PWR recorder.PNG


It will automatically start Firefox with the environment ready to record PWR sessions:


PWR recorder main.png



After accessing the Selenium IDE, you may start recording your user experience:


Ux10.JPG


From that moment on, you will be able to navigate throughout the website that you wish to monitor and the different actions of each step that you take will appear in the recorder.

To stop the recording, use the following button, located in the upper right corner of the recorder:


Ux11.JPG


Once these actions are completed, perform the checks on the website. For example, check the existence of a certain text to make sure that the loaded page is the correct one. To that end, right-click on a section of text on the browser window while you keep recording, and select the option verifyText:


Ux13.JPG


A new step will appear in the recorder indicating the indicated text checking action:


Ux14.JPG


You may play the full sequence using the button Play entire test suite and check that it ends correctly:


Ux15.JPG


Once the validity of the navigation sequence is verified, save it (File -> Save Test Case) to execute it afterwards with Pandora FMS UX. The resulting file will be an HTML document that Pandora FMS UX will interpret.


4.1.2.1 Record a transactional session for Pandora WUX

Pandora FMS WUX allows dividing navigation monitoring into multiple modules, which will represent each one of the steps carried out.

To insert a new control point and generate the phase modules (up to that point), right-click on the point where you want to identify the beginning of the phase.


Pwrd recorder transaction.PNG


Type in the following text as a comment:

phase_start:phase_name

The phase will include the time and result of all the commands found until the following comment:

phase_start:phase_name

All commands executed between phase_start and phase_end tags will be included within that phase.


Pwrd recorder transaction2.PNG


Template warning.png

It should be taken into account that the recordings made in Selenium 2 may not work properly.

 


4.2 Web transaction execution

4.2.1 Standard execution

To launch pre-recorded PWR sessions, call the executable "pandora_ux_x64.exe", which can be downloaded from the following link: "https: //pandorafms.com/library/user-experience-pandora-ux" '

Indicate that the working mode is PWR, and the file that contains the session guidelines. In the path indicated in the -folder parameter, the screenshots will be saved to be shown in case of failure, optional parameter. You may also enter the number of consecutive retries in case of failure, optional parameter. Its execution in Windows is:

pandora_ux_x64.exe -exe PWR -script C:\tests\std.html -retries 3

The following modules will be returned:

  • UX_Status_project_name: if the sequence succeeded or failed.
  • UX_Time_project_name: time taken to complete the sequence.
  • UX_Snapshot_project_name: screenshot right before the error, if any.

Example of successful execution:

<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>

Output with erroneous execution example:

<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>

If everything has turned out right, you may add the execution line to the Pandora FMS agent installed on the machine that you have prepared to run the checks. The line to add to the agent configuration file will look like this (in one line): In Windows:

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\session.html -folder <screenshot path>

In Linux:

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	

Once it reports information to the Pandora FMS server, you will see how the corresponding modules appear. You may enable the view in "hierarchical mode" to see the relationship between them:


Ux33.JPG


As indicated previously, you see the result of the execution (whether it was successful or not) in the module UX_Status_sesion.html, the time spent (in seconds) in the UX_Time_sesion.html module, and another with a screenshot of the last failure in UX_Snapshot_sesion.html, which in this case is empty. It will be on these modules where you may create alerts and show the individual graphs of each module.

Imagen nueva ux.png

4.2.2 Phase-based execution

If you have a transactional recording with Pandora FMS UX PWR, as indicated in previous sections, the system itself will generate the required modules to identify each of the indicated stages, so the execution will not change regarding the previous case. Just indicate the corresponding html file, which in this case will contain the different stages. Windows execution example:

pandora_ux_x64 -exe PWR -script C:\tests\std.html –folder <screenshot path>

The following modules will be returned by stage:

  • UX_Time_project_name.phase_order
  • UX_Status_project_name.phase_order

If there is any phase with an error, the following module will also be created:

  • UX_Snapshot_project_name.phase_order

It will display an image of the web at the time of the error.

The global summary modules identified with the following names will also be returned:

  • UX_Global_Time_project_name
  • UX_Global_Status_project_name
  • UX_Global_Snapshot_project_name

A web image at the time of the error will be displayed.

The agent's execution line would be the same as in the previous case, but with the html file that contains the stated phases.

And when the information correctly reaches Pandora FMS server, it will be displayed as modules in this way. Enabling the view in hierarchical mode in the module list will help you see the information much more clearly:


Ux34.JPG


By accessing the WUXsection of the agent, you may see additional details of the transaction and its stages:

The example below represents a browsing process of our website and the purchase of multiple items, divided into 5 stages to accurately measure the times and know where improvements are needed, or a bottleneck takes place:


Ux44.JPG


4.2.3 Value recovery

Pandora FMS UX is capable of retrieving data directly from the website during the execution of user experience tests.

To use this new feature, add the screenshot command as a comment in the Selenium test:


PWR recorder getValue.png


In the example here, two values are retrieved after navigation and will be represented as modules in Pandora FMS (number and result in text).

The steps to make the plugin collect data are as follows:

  • Add a new comment to your test file with the Selenium recorder.
  • Add the directive to the comment.

Data capture policy

getValue;module name;module data type;regular expression for data capture

What does each field separated by semicolons represent?

  • 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 data types supported by Pandora FMS (generic_proc, generic_data, generic_data_string, async_proc, async_data, async_string...)
  • Perl regular expression to use for data capture: It must be a Perl regular expression, with the information capture command between brackets.

For example, in the text:

 <p> The temperature of the solar panel is: <span class="temperature">54º C</span></p>

If you wish to retrieve the temperature to keep track of the value, specify the regular expression as follows:

<span class="temperature">(\d+\.*\,*\d*).*</span>

In such a way that it will recover the value 54 of the example, or possible values with decimal places.

The full capture directive would be as follows:

getValue;solar panel temperature;generic_data;<span class="temperature">(\d+\.*\,*\d*).*</span>

5 Data management and display

5.1 Create a web analysis module in Pandora FMS Console

Once the browsing session is recorded, it is time to deploy it as a module in Pandora FMS console.

To do it, access any agent linked to a server with the WUX feature enabled and create "Web analysis" module:

Wux module.PNG


Once "create" is selected, fill in all the fields the form presents:

Wux new module form2.PNG
  • Module name: WUX Module (Parent). All sub-modules with the monitoring results will rely on this new module.
  • Target web site: For monitoring website performance statistics.
  • 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.
  • Data history: To save or not the historical information of the modules that monitor this user experience.
  • Textarea section: Text box where to copy (or load) the content of the files from the browsing session that you previously recorded.


5.1.1 Custom macros

Custom macros enabled involve replacing certain text strings present in your browsing session file with certain custom values.

This feature has been improved for web analysis modules, enabling dynamic macros that allow these values to be translated into variable dates and times.

Why this feature?

Suppose you need to monitor, through a browsing session, the correct operation of a meeting room booking web application.

If you set a fixed date and time when filling in the form data, it is possible that the system canceled the booking because at some point it is in the past. For example, you might be trying to book a room for the past week.

It is also possible that you find a time limit to make that reservation, and that the system forces you to book the room within a specific time period, for example, no farther than the current month.

To avoid having to edit the macro every few days, and not worry about the configuration section, you may use dynamic macros, telling the system to always book the room for the next day at the time of performing the test.

In order to use this feature, the values must have a specific format, achieving the following possible replacements:

@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)


Where "n" can be an unsigned (positive) or negative number.

And FORMAT follows the standard of strftime of perl


For example:

@DATE_%Y-%m-%d %H:%M:%S
@DATE_%H:%M:%S_300s
@DATE_%H:%M:%S_-1h

5.2 Data display

The information generated by WUX will be displayed in the form of modules as follows. Enabling the view in hierarchical mode in the module list will help you see the information much more clearly:


WUX modules.PNG


Within this hierarchy you find the following modules:

  • module_Global_Status: It will indicate the global state of the complete navigation.
  • 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.

Example: Error screenshot view.


Wux screenshot.png


Template warning.png

Warning: If you have updated from previous versions to Pandora FMS 7.0NG 712, you must make a small change.

 


In order to store the screenshots generated by WUX Server, you will need to launch the following operations in your database schema:

alter table tagent_status modify column data mediumtext;
alter table tagent_data_string modify column data mediumtext;

If you do not perform, you may not see the full screenshot.

By accessing the WUXsection of the agent, you may see additional details of the transaction and its stages:

Wux nueva imagen.png

Website statistics are summarized in the following concepts:

  • Stats_TT: Total time to load the website.
  • Stats_TDNS: Total time to solve the target's IP address.
  • Stats_TTCP: Time spent connecting through TCP.
  • Stats_TSSL: Time spent establishing SSL communication.
  • Stats_TST: Time elapsed until data transfer started.
  • 'Stats_TTC’: Time transferring data. It will group all the resource transfer times.
  • Stats_TTR: Time taken to transfer the content of the page.
  • Stats_TTR_main: Time used to transfer the HTML code.
  • Stats_TTR_image: Time spent transferring image type resources (png|jpg|jpeg|bmp|tiff|gif|webp|svg).
  • Stats_TTR_css: Time taken to transfer style sheets.
  • Stats_TTR_js: Time spent transferring JavaScript files.

5.3 Assign alerts to a web analytics module

The alerts associated with the web analysis modules follow the same operating dynamics as the entire alert system in Pandora FMS.

For compatibility purposes, it is recommended to assign the alert templates on the sub-elements self-generated by the web analysis module, such as:

  • The status of global navigation.
  • Alerts about time thresholds.
  • Alerts with warning template set to "always" for result screenshot modules.

5.4 New widgets for Dashboards

In order to represent user navigation information, two new types of widgets have been added:

Navigation phase status widget:

Widget wux fases.PNG


Website statistics widget:

Widget wux stats.PNG


6 Desktop User Experience (PDR)

6.1 PDR system deployment (Windows only)

The PDR system only works on Windows systems, and once it is run by the Pandora FMS agent, it must run in process mode, since running in service mode will not work. Also, it will not be possible to lock the desktop session, so it is recommended to use it on virtual machines.

Prerequisites:

  • Windows system in desktop mode with auto start and auto login.

To achieve this configuration, execute:

control userpasswords2

And uncheck the box "Users must enter a username and password to use this computer":


Ux5.JPG


To prepare the environment, create the following directories:

C:\PDR

And unzip the "PDR.rar" file provided in the following link: https://pandorafms.com/library/pdr-cmd-for-ux-monitoring/ in C:\PDR.

6.2 Record a PDR session

To start the recorder, run the following script:

C:\PDR\pdr


Scriptwux22332.png


After the loading process, enter the recording environment:


Ux18.JPG


Select the actions you wish to perform and do a screenshot on the area where you want to apply them. Below you can find a list with the most common ones.

General actions:


Ux19.JPG


Flow control actions:


Ux20.JPG


More language help: http://sikulix-2014.readthedocs.io/en/latest/index.html

When recording the project, a folder will be created that will contain the following elements:

  • .py file with the automation script code.
  • Images to control navigation.

A simple example of execution could be monitoring that your Windows calculator works correctly. We will show the whole process through screenshots.

1. Choose the "click" action and the area where you wish to apply the action. The screen will change to "area selection" mode:


Ux21.JPG


Ux22.JPG


2. Enter the action type and the text "calc". Then enter the actions to wait for the "calculator" area to appear and click on it. Then wait for the calculator window to appear to enter the following actions this way:


Ux23.JPG


3. Then click on the corresponding buttons, selecting the areas as in the previous steps.

4. Finally save the process and run it using the Run button.

Important comments:

  • If you double click on any of the images within the recording environment, you may adjust details of the control screenshot, such as selecting the exact point where to click.
  • It is highly recommended to enter actions such as wait after each click to make sure that the execution will not stop due to an operating system delay.
  • The recorder will search for the area that looks the same as the screenshot, so special care should be taken in case something is highlighted when the button is located above (for example, the calculator buttons change to orange when the mouse is hovering over them).

In the folder where you stored the recording you may see the image files and the Python file.


Ux24.JPG


Nota: You can customize the capture made from the PDR recording engine using the following code:

## OPTIONAL ##capture file names
import shutil
file = "C:\probes\screenshot_prueba.sikuli.png"
focusWindow = App.focusedWindow()
regionImage = capture(focusWindow)
shutil.move(regionImage, file)


This will create an image of the active window in the destination indicated by file, with which you may take a screenshot right when you want. You may customize the screenshot using coordinates. To that end, specify the following syntax:

capture(x, y, w, h)

Where:

X: X position of the rectangle to take a screenshot on.

Y: Y position of the rectangle to take a screenshot on.

W: Screenshot width.

H: Screenshot height.



6.2.1 Record a transactional session with Pandora FMS UX PDR

It is not necessary to record a specific session. Just record the sessions you need in different scripts. It will be Pandora FMS UX who manages the return of results to organize it as a complex transaction. In the next point, we will see how to make the execution call for it to work correctly.

If you are going to make several recordings to create a transactional process, be careful when making the recording and make sure the elements you are looking for are present. It is recommended to manually execute the recordings that you wish to use in a single transactional process continuously, to ensure that the actions proceed as expected.

The following example contains a recording process that will represent the second phase of the process used in the previous example. The result returned by the calculator is copied and pasted into a notebook. The recording looks like this:


Ux40.JPG


And another sequence that will consist of saving the text file in a certain location is included, overwriting the previous one. This offers high flexibility, since it opens the possibility of monitoring these files at the same time, reflecting the needed information in all kinds of checks for heavy desktop applications. This third sequence consists of the following steps:


Ux43.JPG


6.3 PDR session execution

6.3.1 Standard execution

To launch pre-recorded PDR sessions, the working mode indicated is the path to the pdr.cmd file displayed at the corresponding point, the argument of said "-r" file, the file that contains the session directives (-script), the directory where to store the screenshots (-folder) ending in "\", which is optional, where to save the screenshots in the folder where the pdr is located. You may also enter the number of consecutive retries in case of failure, optional parameter.

In the next run, the screen capture is also customized to collect only the active window:

pandora_ux_x64 -exe C:\PDR\pdr -args -r -script C:\pandora_ux\calculadora.sikuli -folder C:\pandora_ux\ -ss_config active -retries 3

The following modules will be returned:

  • UX_Time_project_name.
  • UX_Status_project_name.
  • UX_Control_Snapshot_project_name (only on the first run).

If there is an error at any stage, the following module will also be created:

  • UX_Snapshot_project_name.

And it will show an image of the active window (with -ss_config active) from when the failure took place.

Example of successful execution:

<module>
   <name><![CDATA[UX_Status_calculator.sikuli]]></name>
   <type>generic_proc</type>
   <data><![CDATA[1]]></data>
   <description><![CDATA[C:\pandora_ux\calculator.sikuli execution completed Control snapshot rebuild ]]></description>
   <tags>UX</tags>
   <module_group>UX</module_group>
</module>
<module>
   <name><![CDATA[UX_Time_calculator.sikuli]]></name>
   <type>generic_data</type>
   <data><![CDATA[20.204]]></data>
   <description><![CDATA[C:\pandora_ux\calculator.sikuli execution completed Control snapshot rebuilt ]]></description>
   <tags>UX</tags>
   <module_group>UX</module_group>
   <module_parent>UX_Status_calculator.sikuli</module_parent>
</module>
<module>
   <name><![CDATA[UX_Control_Snapshot_calculator.sikuli]]></name>
   <type>async_string</type>
   <data><![CDATA[data:image/png;base64, IBCAIAAAAOCnfhAAAAAXNSR…/4x79e/7757f8H2C00s1C73yMAAAAASUVORK5CYII=]]></data>
   <description><![CDATA[Control image rebuilt]]></description>
   <tags>UX</tags>
   <module_group>UX</module_group>
   <module_parent>UX_Status_calculator.sikuli</module_parent>
</module>

Example of output with failed execution:

<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>

If everything turned out to be a success, you may add the execution line to the Pandora FMS agent installed on the Windows machine as an agent plugin. The line to add to the agent configuration file will look like this (in a single line):

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"

As you can see, this run has a few more options. The -checkpoint parameter is used to show a screenshot of the result, even if there is no failure. -post will execute actions after the session playback is finished. In this case, the calculator process that started the recording is closed, to prevent the system from failing due to too many open windows or similar processes.

Now that the agent has the execution line module_plugin ready, it is launched in process mode, executing the following from the command line as administrator:

"C:\Program Files\pandora_agent\PandoraAgent.exe" --process

Obviously, the full path to the executable "PandoraAgent.exe" must be the one corresponding to the installation.

When launching it, the actions will be executed automatically according to the recording. From that point onwards the agent process should not be closed, and you should not log in the machine through remote desktop, or the executions could be interrupted. The machine must be left unhandled, that is why its use is recommended in virtual machines.

Imagen nueva pdr.png

Info.png

If you already have automation tests, they can be included in Pandora FMS with the following execution.

 


pandora_ux.64 -exe <exe of the automation system> -args <system arguments> -script <test file path>

6.3.2 Transaction-based execution

If you have recorded different processes with PDR and you have checked they work by playing them continuously, run:

C:\Users\artica\Documents\Producto\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

As it can be seen, just indicate the path of the new script in the -script parameter separated by a comma from the previous script and use the -t parameter with the name of the transaction that will include the different phases . If the process had more phases, the same logic would be followed, for example:

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

The line to add to the agent configuration file, in this case, is the following:

module_plugin C:\Users\artica\Documents\Producto\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"

Thanks to the -checkpoint parameter, you may see screenshots of the result of each phase in the Pandora FMS console.

The following modules will be returned by stage:

  • UX_Time_project_name.phase_order
  • UX_Status_project_name.phase_order

If there is any phase with an error, the following module will also be created:

  • UX_Snapshot_project_name.phase_order

It will also display an image of the web at the time of the failure, should it take place.

The global summary modules identified with the following names will also be returned:

  • UX_Global_Time_project_name
  • UX_Global_Status_project_name
  • UX_Global_Snapshot_project_name


When the agent is running in process mode and the modules are recovered by Pandora FMS you will see them in the console. Again, through the view in "hierarchical mode" you can clearly show the relationship between the modules shown, clearly defining the different phases:


Ux41.JPG


And in the transaction viewer, you can see the detail of the phases and the graph with the times:


Ux42.JPG


The error traps will only be shown when the UX client (PWR) and the PWR server are running on the same machine. Otherwise, the directory for image delivery by the PWR server must be accessible by the client in order to display the image in Pandora FMS.

It will be on these modules where you may create alerts and see the history to build graphs and show the evolution of your systems over time.

It is recommended to create a scheduled task that starts the Pandora FMS agent in process mode when the computer starts. This will not interrupt executions even if the system is forcefully restarted and if it is in automatic login mode without password, the agent will always be run even if the machine is restarted.


Ux26.JPG


Ux27.JPG


Ux28.JPG


Ux29.JPG


Ux30.JPG


Ux31.JPG


Ux32.JPG


That way you will ensure the Pandora FMS agent will always be running in process mode in this Windows system, even when the machine is restarted, being able to always send the information collected by the PDR probe.

Systems with multiple desktops can be troublesome, so it is always recommended to use the configuration described above, on a desktop-mode machine with auto-login and a single desktop.


Go back to Pandora FMS Documentation Index