Python script to check multiple URL routes against an expected HTTP status code.
- Python3 >=3.7
- pip3
Install required modules.
$ pip3 install -r requirements.txt
Create configuration file.
$ cp dist/config.yaml.dist config.yaml
Fit configuration for your needs.
domain: https://my-domain.com
expectedHttpStatusCode: 200
routes:
- /index.html
- /my/sub/dir/index.html
Run check script with your configuration.
$ python3 http_status_check.py --config=/<path>/config.yaml
Enable debug output by adding --debug
flag.
Configuration (./test/config.yaml
):
domain: https://www.google.de
expectedHttpStatusCode: 200
routes:
- /
- /imghp?hl=de&tab=wi&ogbl
Execution:
$ python3 http_status_check.py --config=./test/config.yaml
Output:
[INFO] Read configuration from ./test/config.yaml
[INFO] Run checks
[OK] https://www.google.de/ returns HTTP status 200
[OK] https://www.google.de/imghp?hl=de&tab=wi&ogbl returns HTTP status 200
[OK] Done.