Configuration

Basic Examples

Let’s start with an example to illustrate what check_site_simple can do for you.

Checking the start-page

$ ./check_site_simple -U https://example.com --contains="My Company Name Inc."

This will check if https://example.com is accessible. It will also check if the HTML-file returned contains the string “My Company Name Inc.” or if broken links are somewhere on this page.

Example Output

If the check finds the required content and no broken link it will return with a one-liner:

CHECK_SITE_SIMPLE OK - 1 page checked, 0 pages with error

The --contains parameters value will be compare only against the user-visible part of the webpage. It can not be used to check strings inside of html-tags like a target in <a href>. This is because the intention of check_site_simple is to check sites from a visitors perspective.


In case of an error the check will return an extra line describing the error in detail, so that it can get fixed quickly:

CHECK_SITE_SIMPLE CRITICAL - 1 page checked, 1 page with error
https://example.com (CONTENT 'My Company Name Inc.' was NOT found)

Checking a whole site

Of course errors are typically somewhere in the sites content. Thanks to an integrated crawler check_site_simple will find them regardless of how deep they are are buried beneath the sites homepage. Just add the --crawl switch to the command.

$ ./check_site_simple -U https://example.com --contains="My Company Name Inc." --crawl

Now every page directly or indirectly linked from the start-page (but within the example.com domain of course!) will get checked.

If anything is OK we will get a one-liner again:

CHECK_SITE_SIMPLE OK - 256 page checked, 0 pages with error

In case of errors each of it will get it’s own line for a detailed description:

CHECK_SITE_SIMPLE OK - 256 pages checked, 3 pages with error

https://example.com/contact.html (CONTENT 'My Company Name Inc.' was NOT found)

https://www.somehwere.com/docs/A3kuf.html (ERROR: 404 Not Found (source: https://example.com/products/new_product.html)

https://other.com/internal/hello.html (ERROR: 403 Forbidden (source: https://example.com/partners/index.html)

Over time you will find more and more use cases for --contains. We have not mentioned the --no-contains parameter yet. The programs --help provides more details. Also do not forget to look into the Advanced Examples at the end of this manual.