Templates

A template is a saved copy of sensors that have been set up and proved to work, so the same checks can be put on the next device in a moment rather than configured again by hand. The usual way to make one is to get a sensor right on a real device first, then save it.

Two kinds

KindHoldsUsed
Sensor templateOne sensorWhen adding a sensor, from From template in the Add dialogue
Device templateEvery sensor that was on a deviceOn a device, from Apply in its Templates panel

A device template is a set of sensors, not a device. The device's own name, address, icon, notes and rollup are not part of it.

What a template carries

CopiedNot copied
  • Sensor type and name
  • Interval, connect and response timeouts, and failures before a probe calls it down
  • The request: URL path, method, headers and body, SNMP object, query, command and so on
  • User function and its arguments
  • Slots, meaning the extractions, their units and labels
  • Rules
  • Store raw response, chart settings and retention
  • The address or target override, which the device supplies
  • Credentials, which resolve from wherever the new sensor sits in the tree
  • Probe groups
  • Rollup settings, including counts towards its parent
  • Schedules and action bindings

A template copies what was last saved, not unsaved edits on the screen. It is a copy, not a link: editing a template never changes sensors already made from it, and editing those sensors never changes the template.

Keeping a template portable

Because addresses and credentials are left behind, a well made template works anywhere. Keep it that way by never typing a secret into a request. Write a token instead, and hold the value as a credential in the tree:

Written in the requestFilled in from
Authorization: Bearer {{bearer}}The HTTP(S) credential's bearer token
X-API-Key: {{apikey}}The HTTP(S) credential's API key
Authorization: Basic {{basicauth}}The HTTP(S) credential's username and password
/api/{{tenantcode}}/statusA Substitution credential named tenantcode

Each sensor made from the template then picks up the values that apply where it sits. See Credentials.

Saving a template

  • One sensor: select the sensor in Configuration and use the Save as template panel at the foot of it. Give it a name, or leave the name empty to use the sensor's.
  • A whole device: select the device and use Save sensors as template in its Templates panel. Every sensor on the device goes into one template. Remove any that should not travel under Setup, Templates.

Template names are unique within your estate. A new template is always saved to your estate only.

Using a template

Adding one sensor

Press Add on the Estate panel, choose Sensor and the device it goes under, then pick the template in From template. The template decides the sensor type, and its interval is used in place of the one on the form. Tick the probe groups that should watch it, which is still required. Left empty, the name is taken from the template, numbered if that name is already in use on the device.

Applying a device template

Select the device, choose the template under Apply in its Templates panel and apply it. Every sensor in the template is added to the device. A sensor whose name is already in use on the device is skipped and listed, so applying twice never makes duplicates and never overwrites anything.

The sensors added have no probe groups, so nothing is polled yet. Open each new sensor, tick its probe groups and save it. While you are there, check the credentials line on the sensor, which says where its credential resolves from, or that nothing does.

The Templates page

Setup, Templates lists your estate's templates and any global ones, with each one's type, where DEVICE marks a device template, and its scope. Review opens a template, where you can:

  • rename it;
  • change each sensor's interval, timeouts and failure count;
  • read and correct the request, field by field;
  • change a rule's value and whether it gives WARN or CRIT;
  • remove a sensor from a device template;
  • delete the template. Sensors already made from it are untouched.

The user function, the slots, and a rule's slot and operator are read only here. To change those, change a real sensor, prove it, and save it as a new template. The request fields are not checked on this page, so a mistake only shows when a sensor is made from the template.

Global templates

A global template is offered to every estate. Global templates are marked Global in the list and (global) in the pickers. Only an administrator can make a template global or change one. Before making a template global, read its request through: headers, URLs and bodies are exactly where a token typed in by hand would be, and every estate would receive it.