Server Status over HTTP HEAD, a.k.a. SSoHH, is a simple servers monitoring solution based on HTTP HEAD request. It uses a client-server architecture:
- Client - Send its status information as User Agent string in HTTP HEAD requests to the server
- Server - Parse web server log (Nginx) to extract the status information, and present on a web page
In client_set.sh file:
| property | meaning |
|---|---|
| SSOHH_TAG | Private tag in requests for identify the clients |
| ENDPOINT | Web server endpoint receives requests |
| INTERVAL | Interval in minutes (default 5) between each request |
In reducer.py file:
| property | meaning |
|---|---|
| config_tag | Should be consistent with SSOHH_TAG in client_set.sh |
| config_log_path | Absolute path of access.log logs requests from clients |
| config_page_path | Absolute path of the generated web page |
Copy configured client_set.sh to each *nix machine to be monitored, chmod +x client_set.sh to make it executable. And then execute one of the following commands according to their environment:
./client_set.sh pifor Raspbian on Raspberry Pi./client_set.sh bbbfor Debian on BeagleBone Black./client_set.sh linuxfor Ubuntu Linux./client_set.sh macfor OS X on Macintosh
You may add/edit MONITOR in client_set.sh to customize the metrics. Sections in MONITOR should match the regular expression \[(?P<key>.*?)\](?P<value>.*?);. And this regular expression can also be customized by changing section_pattern in reducer.py.
Ensure reducer.py and template.html are configured and in the same directory, add the following line to crontab:
* * * * * (sleep 10; python3 /your/path/to/ssohh/reducer.py)Start the web server to host the generated page, and open your browser to visit it. (You may need to execute the script manually if it hasn't been executed by crontab yet.)
- Keep
SSOHH_TAGconfidential if you don't want to see any faked lines - Use exclusive web server endpoint and access.log for SSoHH
- Not supported on Microsoft Windows Server
- Log rotation may cause missing lines on the page, especially for machines that have been disconnected for a while
hostnameis the only identification for each machine, duplicate or modification will cause missing/additional lines on the page
