{"id":23080083,"url":"https://github.com/opsdis/check_selenium_docker","last_synced_at":"2025-08-15T22:30:42.806Z","repository":{"id":54729367,"uuid":"243257374","full_name":"opsdis/check_selenium_docker","owner":"opsdis","description":"Synthetic website monitoring with Selenium and Docker.","archived":false,"fork":false,"pushed_at":"2021-02-16T12:38:22.000Z","size":102,"stargazers_count":8,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-08T12:50:48.126Z","etag":null,"topics":["dockerfile","icinga2","nagios-plugin","op5-monitor","selenium"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opsdis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-26T12:29:16.000Z","updated_at":"2024-03-18T15:20:11.000Z","dependencies_parsed_at":"2022-08-14T01:01:00.251Z","dependency_job_id":null,"html_url":"https://github.com/opsdis/check_selenium_docker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Fcheck_selenium_docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Fcheck_selenium_docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Fcheck_selenium_docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsdis%2Fcheck_selenium_docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opsdis","download_url":"https://codeload.github.com/opsdis/check_selenium_docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229964405,"owners_count":18152034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","icinga2","nagios-plugin","op5-monitor","selenium"],"created_at":"2024-12-16T13:04:26.973Z","updated_at":"2024-12-16T13:04:27.808Z","avatar_url":"https://github.com/opsdis.png","language":"Python","readme":"check_selenium_docker\n-----------------------\n\n- [Overview](#overview)\n  * [Highlights](#highlights)\n- [Workflow](#metrics-naming)\n- [System requirements](#system-requirements)\n  * [ITRS OP5 Monitor example](#itrs-op5-monitor-example)\n- [Docker image](#docker-image)\n- [Plugin](#plugin)\n- [Add new test scenarios](#add-new-test-scenarios)\n- [Execute the plugin](#execute-the-plugin)\n- [License](#license)\n\n# Overview #\nSynthetic website monitoring with Selenium and Docker.\n\ncheck_selenium_docker is a Nagios based plugin that spins up a Docker container, executes the test and, once the test is finished and the result has been reported back to the monitoring solution, removes the Docker container.\n\n### Highlights ###\n\n* Works with any Nagios compatible system such as ITRS OP5 Monitor, Icinga2 or Nagios.\n* Every test is executed in a fresh environment. (https://www.selenium.dev/documentation/en/guidelines_and_recommendations/fresh_browser_per_test/)\n* Will remove the Docker container as soon as the test is complete. Requires no manual cleanup of stopped containers.\n\n# Workflow #\n\nInstall Selenium IDE for Chrome (https://selenium.dev/downloads).\n\nRecord your test.\n\nExport the test and copy the .side file to the server that will run the docker image.\n\nA Docker container will execute the test and report the test results back to the monitoring system.\n\n![Workflow](img/selenium_docker.png)\n\n# System requirements #\nThe following prerequisites must be installed on the server that will execute the plugin.\n\n* Python 3 with the docker module\n* docker-ce\n\n## ITRS OP5 Monitor example ##\n\n```\n# Install docker-ce\nyum install -y yum-utils \\\n  device-mapper-persistent-data \\\n  lvm2\n\nyum-config-manager \\\n    --add-repo \\\n    https://download.docker.com/linux/centos/docker-ce.repo\n\nyum install docker-ce\n\n# Add user 'monitor' to group 'docker'\nusermod -aG docker monitor\n\n# Start and enable docker\nsystemctl start docker \u0026\u0026 systemctl enable docker\n\n# Install the docker Python 3 module\npip-3 install docker\n\n# (Optional) Add versionlock to docker-ce\nyum install yum-plugin-versionlock\nyum versionlock docker-ce\n\n# (Optional) Remove versionlock from docker-ce\nyum versionlock clear\n```\n\n\n# Docker image #\n\nBuild the Docker image:\n\n```\ngit clone https://github.com/opsdis/check_selenium_docker\ncd check_selenium_docker/dockerimage/\ndocker build . --tag opsdis/selenium-chrome-node-with-side-runner\n```\n\n\n# Plugin #\n\nCopy the plugin to the plugin directory and make it executable:\n\n```\ncp check_selenium_docker.py /opt/plugins/custom/\nchmod +x /opt/plugins/custom/check_selenium_docker.py\n```\n\nAdd a new check_command to Monitor:\n\n```\ncheck_selenium_docker\n$USER1$/custom/check_selenium_docker.py $ARG1$\n```\n\n\n# Add new test scenarios #\n\nCreate a new main directory (/opt/plugins/custom/selenium) in the main directory create a new directory \npreferably named as the URL used in the test (/opt/plugins/custom/selenium/opsdis.com):\n\n```\nmkdir /opt/plugins/custom/selenium\nmkdir /opt/plugins/custom/selenium/opsdis.com\n```\n\nCreate two subdirectories, out and sides:\n\n```\nmkdir /opt/plugins/custom/selenium/opsdis.com/{out,sides}\n```\n\nAdd the side-file to the sides subdirectory and modify the permissions:\n\n```\nchmod 777 /opt/plugins/custom/selenium/opsdis.com/out/\nchmod 755 /opt/plugins/custom/selenium/opsdis.com/sides/opsdis.com.side\n```\n\nThe directory structure should look like this:\n\n```\n├── opsdis.com\n│   ├── out\n│   └── sides\n│       └── opsdis.com.side\n```\n\n# Execute the plugin #\n\n```\n/opt/plugins/custom/check_selenium_docker.py /opt/plugins/custom/selenium/opsdis.com\nOK: Passed 1 of 1 tests. | 'passed'=1;;;; 'failed'=0;;;; 'exec_time'=6s;;;;\n\n```\n\n# License \ncheck_selenium_docker is licensed under GPL version 3.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Fcheck_selenium_docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopsdis%2Fcheck_selenium_docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsdis%2Fcheck_selenium_docker/lists"}