This plugin uses the selenium tool to do web navigation simulations using an standard web browser. It generates two modules (generic_proc and generic_data types) for each task.
For more information visit the following website: http://pandorafms.com/index.php?sec=Library&sec2=repository&lng=en&action=view_PUI&id_PUI=426
12. 6.2. Windows
6.2.1. System Requirements
The system requirements are:
• Java virtual machine
• Access to the port TCP 4444 from that machine that the agent who will execute the plugin
has.
• Access to the web navigation from this machine to the webs (intranet or internet) that want
to execute web monitoring tasks.
• Firefox or Chrome browsers or other supported by Selenium (please, consider that you
should specify this in the Pandora Agent plugin).
◦ For browsers differents to Firefox, it is necessary to install the “drivers” for each browser.
6.2.2. Selenium Installing
The steps to install Selenium in Microsoft Windows.
• Due to problems of the Microsoft corporation with Oracle, the Java package is not available
in the OpenSUSE official repositories, but you can download it from the following URL:
http://www.java.com
• And download the Selenium jar package from the official web at:
http://seleniumhq.org/download/
• That in this page you can find in the section with the following name:
Selenium Server (formerly the Selenium RC Server)
• To execute the monitoring in the Firefox browser you don't need to do anything, except
having it installed in this machine.
Page 12
17. And add one line similar to the one that is marked in red, for example:
module_plugin SeleniumPlugin.pl /var/selenium_plugin_example 192.168.70.198 4444 *iexplore
Where it is:
module_plugin SeleniumPlugin.pl <path_script_tareas_monitorización> <ip_selenium>
<puerto_selenium> <navegador>
And the parameters are:
• path_script_tareas_monitorización: The path to the task script that should have reading
permission from the Pandora agent.
• ip_selenium: The ip from the machine that is executing the Selenium.
• puerto_selenium: The port of the Selenium server, that is usually the 4444.
• navegador: The browser where doing the navigation simulation . You have two options:
*iexplore (only windows) and *firefox (for both is compulsory to have it installed in the
Selenium machine).
The task script could be created in a manual way with a simple text editor or with the tool that we
are going to explain in other sections of this manual, the Selenium Firefox extension for Pandora
FMS. Anyway, you will have an annex with information to create from a text editor or edit one
created by the Firefox extension.
Page 17
25. • attach_file: Command that adds the file to the control that upload files from the form given
as first parameter. The second parameter is the path to the file to upload to the web.
• capture_entire_page_screenshot: saves an screenshot of the browser in that moment, with
the first parameter to the file to save the screenshot.
• capture_entire_page_screenshot_to_string: Saves a browser screenshot in one string in
BASE64 and PNG format.
• check: Select the web confirmation box passed as first parameter.
• choose_cancel_on_next_confirmation: In the confirmation window that is generated by
the web javascript, press on the cancel button.
• click: The Selenium click on the web item that has passed as first parameter the objective of
clicking.
• close: The Selenium at this stage of the script line will close the browser.
• create_cookie: Creates a cookie of the web in the browse, with the pair name:value, where
the name is first parameter and the value is the second.
• delete_all_visible_cookies: Delete the name pairs from the browser: Value of a cookie from
the web.
• delete_cookie: Delete the name pair :Value of the cookie from the browser.
• double_click: does double click on the web item that has passed as first parameter the
objective of doing double click.
• focus: focus in the browser the web item that has passed as first parameter the objective to
do focus.
• get_attribute:gets the value of the attribute of the html item that is passed as first
parameter.
• get_body_text: Extracts all the content of the browser web page as it would be a text. It's
possible to pass as first parameter one regular expression that will try match instead of
return all the page content.
• get_cookie_by_name: Returns the value of the cookie passing as first parameter the name
of that cookie.
• get_html_source: Returns the content as html of all the browser web page as if it would be
a text. It is possible to pass as first parameter a regular expression that will try to match
instead of return all the page content.
• get_location: Returns the complete URL in this specific moment of the script, of the browser
Page 25
26. in the navigation simulation.
• get_text: Returns the text of an item selected through the first parameter.
• get_table: Returns the content of a table selected through the first parameter.
• get_title: Returns the title of the page where the script is in the moment when the command
is called.
• get_value: Returns the value of a form field that is selected through the first parameter.
• go_back: Does the web browser task of “going back”.
• is_cookie_present: Checks if the cookie value that is passed through the first parameter
exists.
• is_text_present: Checks that the text is present in the web, passing a regular expression as
first parameter.
• is_visible: Checks that the item is visible, passed the location in the first parameter.
• open: Open the web in Selenium with the URL passed as first parameter.
• pause: Wait for the Selenium simulation during the time in miliseconds selected in the first
parameter.
• refresh: Refresh in the browser when Selenium finds this command line in the script.
• select: Select a value from a drop list, being the first parameter the location of the drop list
in the web, and the second parameter is the value of the list to select.
• select_window: Select the float window selected by the ID that comes in the first
parameter.
• set_timeout: Pass some time in miliseconds as first parameter to Selenium in order that the
script would be completed, if it doesn't meet the requirements, it returns status error of the
task module.
• submit: Executes the data sending from a form selected by the first parameter.
• type: Writes in the text box selected by the first parameter, and with the second parameter
the text to fill in by Selenium.
• type_keys: Writes also in the text box but key by key as the taping of a real user in
navigation. The box text is selected in the first parameter and the second the keys to press
selected as text.
• uncheck: Does an unchecking in the checking box selected by the first parameter.
• wait_for_page_to_load: Selenium wait as many miliseconds as there are passed in the first
parameter to the page finish loading.
Page 26