opsdis / check_selenium_docker Goto Github PK
View Code? Open in Web Editor NEWSynthetic website monitoring with Selenium and Docker.
License: GNU General Public License v3.0
Synthetic website monitoring with Selenium and Docker.
License: GNU General Public License v3.0
At entry_point.sh
all side files are processed by runner
selenium-side-runner (...) /sides/*.side
But plugin script check_selenium_docker.py
wait for and process only the first json output:
side = glob.glob(path + '/sides/*.side')
side_file = open(side[0],'r')
(...)
result = path + '/out/' + side_json['name'] + '.json'
(...)
while not os.path.isfile(result) and waitedfor <= timeout:
It also calculates exec_time
and prints failureMessage
based only on the first failed test. If side file contains more than one Test Suite then could be more failed tests:
int(str(json_input['testResults'][0]['endTime'])[:-3]) - int(str(json_input['startTime'])[:-3])
(...)
" tests. Error message: " + str(json_input['testResults'][0]['message']) +
And finally runner's output failure messages are quite long and multi-line which is a bit in a contrary with a Nagions Guidelines that encourages brevity.
I fixed it all in my fork. I will do a PR if you would like to merge it.
ps. Good job with this plugin :).
Im trying to create a selenium check, but keep getting the error
PermissionError: [Errno 13] Permission denied '/opt/plugins/custom/selenium/qaLogin/out/QALogin.json'
when I run it through the Nagios website. The QALogin.json file is set to:
-rw-r--r--. 1 nagios nagios 886 Aug 6 23:17 QALogin.json
I can run it manually as the nagios user and verified the out and sides directories are being mapped to during the docker container run.
It just wont work during the nagios checks and I cannot figure out why. Any help will be appreciated.
Here is the complete error.
(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/lib64/nagios/plugins/check_selenium_docker.py", line 39, in
os.remove(result)
PermissionError: [Errno 13] Permission denied: '/opt/plugins/custom/selenium/qaLogin/out/QALogin.json'
[1596757748.377441] [016.2] [pid=848] Parsing check output...
Short Output: (No output on stdout) stderr: Traceback (most recent call last):
Long Output: File "/usr/lib64/nagios/plugins/check_selenium_docker.py", line 39, in \n os.remove(result)\nPermissionError: [Errno 13] Permission denied: '/opt/plugins/custom/selenium/qaLogin/out/QALogin.json'
Traceback (most recent call last):
File "./check_selenium_docker.py", line 70, in <module>
exec_time = int(str(json_input['testResults'][0]['endTime'])[:-3]) - int(str(json_input['startTime'])[:-3])
IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.