Python App to push regular updates to status cake
Simple ping test
{
"type": "ping",
"ip": "8.8.8.8",
"statusCakeUrl": "https://push.statuscake.com/?PK=PK&TestID=TestID&time=0"
},
Simple mongo connexion test
{
"type": "mongo",
"user": "user",
"password": "password",
"database": "database",
"ip": "",
"statusCakeUrl": "https://push.statuscake.com/?PK=PK&TestID=TestID&time=0"
}
Simple postgresql connection test
{
"type": "postgresql",
"user": "user",
"password": "password",
"database": "database",
"ip": "localhost",
"port": "5432",
"sslmode": "require",
"statusCakeUrl": "https://push.statuscake.com/?PK=PK&TestID=TestID&time=0"
}
Simple curl test. The result of the curl command is tested with a simple string match
{
"type": "curl",
"url": "",
"textToMatch": "",
"statusCakeUrl": "https://push.statuscake.com/?PK=PK&TestID=TestID&time=0"
}
Simple test to check that a port is opened. Could be use to ensure a service is running as expected.
{
"type": "port",
"port": 3131,
"url": "192.168.1.12",
"statusCakeUrl": "https://push.statuscake.com/?PK=PK&TestID=TestID&time=0"
}
Python is required. There is also a dependency to the pymongo package to test mongo database being up
pip install pymongo psycopg2-binary
create the json to define tests and update it with the tests you need to run and the status cake push URLs
cp testsSample.json tests.json
vi tests.json
add this line to crontab to launch the script every minute (use which pyhton
to check the location of your python
installation)
* * * * * /usr/bin/python /path_to/testRunner.py