Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Script and configuration for website monitoring

Notifications You must be signed in to change notification settings

BiGCAT-UM/website-monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BiGCaT Website Monitoring

This repository has a website checking script and configurations for the websites we wish to have regularly checked. The script currently checks if the website is online (HTTP 200) and the content of the website.

The configuration file contains four lines that describe the what and how. For example:

url='http://bridgedb.org/'
pkg="org.bridgedb"
report='MainBridgeDbWebsite'
expectedContent='BridgeDb is a framework'

The second and third line are used for reporting in the Jenkins job and must be descriptive and unique. The first line is the URL of the website to test (note that HTTP and HTTPS are different URLs) and the fourth line gives a string that is expected to be part of the HTML, JSON, etc that is returned for the URL (after a HTTP GET call).

Testing the website

The helper script runs on test at the time. For convenience, you can wrap this to run all files and collect results in a JUnit-like XML file with something like this:

rm -f uptime.xml
testCount=`ls -1 *.props | wc -l`
echo "<testsuite tests=\"${testCount}\">\n" >> uptime.xml

for filename in *.props; do
  bash checkWebsite.sh "$filename"
done

echo "</testsuite>" >> uptime.xml

Caveats

The system is really just a poor man's set up and has its limitations. Take into account the following aspects:

  1. the passed url is used for a cURL call to get HTML, but the HTML is not interpreted
  2. the output is reported in an XML file, which sometimes gives problems with characters in URLs that need escaping (encoding)

The first point means that the test cannot test for JavaScript-generated content on the page.

About

Script and configuration for website monitoring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages