Iotic Space can integrate data from many different sources. The IoT being what it is, there is no guarantee that these sources will be reliable. The External Feed Monitor (version 2) or ExtMon2 shows a simple Red/Amber/Green (RAG) webpage with the current status of sources in which you are interested.
It's called External Monitor because it runs outside of Iotic Space and therefore will keep monitoring in the unlikely event of any part of Iotic Space failing.
ExtMon allows you to choose some feeds in Iotic Space and to assign rules to them about how often you expect to see them update. For example if you expect a carpark feed to update every 5 minutes, you can set the maximum age to 300 seconds. The system will then check to see if that feed has been received in the last 5 minutes and set its icon to green. If there's a problem and the feed hasn't been received, then (by default) the system will wait until two times the max age until it goes amber and then three times before it goes red. You can override these defaults (obviously).
---------------- ---------------- ----------------
| | | | | |
| Feed Source | ---->IOTIC SPACE----> | Feed Monitor | | Web Page |
| | | | | |
---------------- ---------------- ----------------
There's a config file (extmon2.ini)[cfg/extmon2.ini] file for the monitor. Fill in the basic config...
[extmon2]
wwwpath = ../www
template = templates/default.html
agent = ../cfg/agent.ini
parameter | type | optional | comment |
---|---|---|---|
wwwpath |
path | no | Path to web files directory |
template |
path | no | Path to your template HTML. Change this to change the layout, look and feel of the webpage |
agent |
path | no | Path to your agent credentials so the monitor can log into Iotic Space |
...and then add the feeds you want to monitor
feeds =
testfeeds
tfl_bikes
; ...etc...
A feed definition can be as simple as this
[testfeeds]
guid = 798c20f92d005c12f2d7116999092520
max_age = 60
parameter | type | optional | comment |
---|---|---|---|
guid |
hex string | no | GUID of the feed you want to monitor |
max_age |
integer | no | Maximum time (in seconds) to wait before you expect your feed to publish |
warn_age |
integer | yes | Time before your feed shows amber (default max_age * 2) |
error_age |
integer | yes | Time before your feed shows amber (default max_age * 3) |
name |
string | yes | Override the feed you're monitoring's label (default actual feed label) |
Download or clone the code from the repo.
To run the Monitor you'll need these dependencies
It's up to you how you install these and set your PYTHONPATH to access them. I did from the root of this repo by using the requirements.txt file to install the dependencies in the 3rd directory...
pip3 install -t 3rd -r requirements.txt
You can see how to run your code later.
There's a run script to run the Monitor.
Change the line to make sure PYTHONPATH includes all your dependencies and point the monitor at your .ini
file
#!/bin/bash
PYTHONPATH=../3rd python3 -m ExtMon2 ../cfg/extmon2.ini