# sites-watcher-pi **Repository Path**: pacopink/sites-watcher-pi ## Basic Information - **Project Name**: sites-watcher-pi - **Description**: A web sites watcher to run on Raspberry Pi 3 and NXEZ Swiss Army Knife board - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-28 - **Last Updated**: 2021-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README As a SRE, you may have several web services to look after. This program uses Raspberry Pi 3 Model B + NXEZ Swiss Army Knife board to provide a solution to watch the availablity and delay level of your web services. There is a 4-digit ditgital display, they are used to display the index of the URL you configured in the 'config.py' file, theoretically you can watch 9999 URL, although it is not practical, but it is useful if you use it to watch some tens of URLs, each URL status will be displayed on the board for 1 second, when it is normal, the first 6 of the 8 leds will show the delay level: 1 led if <250 ms 2 led if <500 ms 3 led if <1000 ms 4 led if <1500 ms 5 led if <2000 ms 6 led if <3000 ms If the URL response is timeout or does not meet the expectation, YELLOW and RED leds will blink and the speaker will make a loud 'BeepBeepBeep' alarm. To avoid long block when waiting for HTTP response, every request runs with a 3 seconds timeout, and a 16-thread thread pool is leveraged, as a result, if the no. of threads in pool is greater than the URLs you are watching, the max blocking time will be more predictable. The digital display will be off and the 2 GREEN leds will be on when HTTP request testing are on-going, it may take some seconds. Chang Log 2017-06-11 ==================== When some watched service failed, you may want to set-off the beeper so that it won't be too noisy to interupt your toubleshooting. this version use a beep_flag to control this, when program starts up, beep_flag will read from dip_switch#2 to get the value, and you can change it by changing the dip_switch#2, when dip_switch#2 is 'ON', the beep alarm is on, vice versa. Config: edit config.py Usage: python main.py