struct

JaneHQ::AlertTarget

Inherits Struct < Value < Object

One thing an alert group watches: a single host, or a whole host group. Forms post these as host:web-01 / group:3 tokens (a host group is referenced by id because its name can be edited, a host by hostname because that is the agent's only wire identifier).

Constants

KIND_GROUP = "group"
KIND_HOST = "host"

Constructors

group(id : Int64, name : String) : AlertTarget
Source
host(hostname : String) : AlertTarget
Source
new(kind : String, ref : String, label : String | Nil = nil)
Source

Class methods

parse(token : String) : AlertTarget | Nil

Parses a form token. Returns nil for anything unrecognized so a hand-made POST can't smuggle in a target kind we don't understand.

Source

Instance methods

display

Monit-style prefix, so a rule reads "Hostgroup PROD TRADING".

Source
group?
Source
kind
Source
label

What to show in the UI: the hostname, or the host group's current name.

Source
token
Source