Monitor Resources on the Internet
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Monitor Web resources

This is a monitoring script to check availability of webpages, content delivery, uptime of web servers, content negotiation etc... It can be used in any monitoring infrastructure, such as Nagios or Icinga.


The Perl script requires


perl -w [OPTIONS] -u URL

Here, OPTIONS may be:

  • --url URL or -u URL the URL to the site
  • ---status STATUS or -s STATUS you expect STATUS to be the returned HTTP status code (default: 200)
  • ---no-status do not check the HTTP status
  • ---content "CONTENT" or -c "CONTENT" you expect CONTENT to appear within the response
  • ---referer "REFERER" or -r "REFERER" use REFERER when sending the request
  • ---user-agent "USER AGENT" pretend to be the user agent USER AGENT
  • ---header "KEY=VALUE" expected HTTP header value as KEY=VALUE, multiple options are possible and VALUE may be a regex
  • ---cookie "NAME=VALUE" sent a cookie NAME=VALUE, multiple options possible
  • ---accept "MIME" or -a "MIME" ask for a result of content type MIME, especially useful to check for content negotiation
  • ---follow or -f should we follow redirects?
  • ---timeout INT or -t INT wait INT seconds before timeout
  • ---help or -h show this help

The script's return code and message is to be interpreted by your monitoring infrastructure.


Check a URL is accessible

perl -w -u

Check a URL-shortener does the proper redirection

perl -w -u -s 301 --header location=

Check that your webserver properly redirects HTTP to HTTPS

perl -w -u -s 301 --header location=

Check that a web resource has a specific size and that the webserver is NGINX

perl -w -h content-length=191406 -h "server=nginx.*" -u

Here, the image needs to be exactly of size 191406 Bytes and the regex nginx.* matches to NGINX in any version.

Perform a check using a cookie

perl -w -c userid=karl -c secret=passwd123456 -u

Test content negotiation

Check that you get XML when asking for XML: -u -f -a text/xml --header content-type=xml

Check that you get HTML when asking for HTML: -u -f -a text/html --header content-type=text/html


There is a python tool in src/ that performs some basic test to verify that is working correctly. I'd like to encourage you to add further test when extending!


check_links - Monitor web Resources
Copyright (C) 2017 Martin Scharm <>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <>.