Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHostID ¶
CheckHostID returns a compound key constisting of a check id and a host id.
Types ¶
type Check ¶
type Check struct { database.Object `storm:"inline"` Name string `json:"name" validate:"required"` AgentID string `json:"agent" validate:"required"` Hosts []string `json:"hosts"` Interval time.Duration `json:"interval"` Arguments json.RawMessage `json:"arguments"` Expressions []string `json:"expressions"` ContactGroups []string `json:"contactgroups"` }
Check defines a check to be conducted by Gansoi.
type CheckResult ¶
type CheckResult struct { ID int64 `json:"id,omitempty" storm:"id,increment"` CheckHostID string `json:"check_host_id,omitempty" storm:"index"` CheckID string `json:"check_id" storm:"index"` HostID string `json:"host_id"` Node string `json:"node_id,omitempty"` Error string `json:"error"` TimeStamp time.Time `json:"timestamp"` Results plugins.AgentResult `json:"results"` }
CheckResult describes the result of one or more checks after a single node has executed the check.
func RunCheck ¶
func RunCheck(transport transports.Transport, check *Check) (checkResult *CheckResult)
RunCheck will run a check and return a CheckResult.
type MetaStore ¶
MetaStore will keep a list of checks to execute.
type Scheduler ¶
type Scheduler struct { Results chan *CheckResult // contains filtered or unexported fields }
Scheduler takes care of scheduling checks on the local node. For now it will spin four times each second.
func NewScheduler ¶
func NewScheduler(db database.ReadWriteBroadcaster, nodeName string) *Scheduler
NewScheduler instantiates a new scheduler.
Click to show internal directories.
Click to hide internal directories.