Skip to main content

Assertions

The purpose of monitoring is to enforce compliance to a contract or service level agreements (SLAs). For example, an SLA may describe that the temperature in certain locations should be between 18 and 22 degrees celcius during business hours. The difference between monitoring and automation is that automation is used to control devices. Monitoring only checks is measurements are between certain values and has less implication in case of configuration errors. Automation and monitoring are complementary because automation can be used to make sure that certain conditions are met, for example temperature or humidity, by controlling devices. Monitoring checks if the automation is effective.

Assert

The basis for monitoring is a so called 'assert' block. The block has two inline inputs: one for the name of the topic and one for the expected value. For example, to monitor the luminance of a room drag a Assert value into the workspace. Add a dropdown topic selector and a numerical number input from the Math panel. In the operator select the applicable condition like = or <. If a value should be within a range you can create two statements with a > and a < operator, for example temperature > 18 and temperature < 22. Alternatively you can use the Asset value between block.

Interval

You can specify how often the assertion should be checked by entering a schedule. There are some predefined schedules defined in the dropdown or you can create a custom schedule according to the cron format. This allows checks like Every 15 minutes after the hour on monday-friday.

Wildcard

If you want to monitor the temperature for each room you can create a list of Assert statements. The advantage is that you can specify a seperate expected value for each room. If the expected value is the same you can use a single statement with a wildcard. For example server.cpu.*.load checks the CPU load for all servers.

Output

If you manually run the monitoring item you see an on screen error message if one or more assertions fail. When assertions fail a mail message is sent with the following content:

Topic:office.htc28.floor-0.room-322.temperature
Time: Thu Aug 04 2022 12:51:28 GMT+0200 (Central European Summer Time)
Actual:20
Expected:between 68 and 75

Topic:office.htc28.floor-0.room-323.temperature
Time: Thu Aug 04 2022 12:51:28 GMT+0200 (Central European Summer Time)
Actual:16
Expected:between 68 and 75