Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CommentTypeUser represents an user comment type CommentTypeUser = 1 // CommentTypeDowntime represents a downtime comment type CommentTypeDowntime = 2 // CommentTypeFlapping represents a flap comment type CommentTypeFlapping = 3 // CommentTypeAcknowledgement represents a acknowledge comment type CommentTypeAcknowledgement = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
Catalog represents the states catalog in a poller worker
func NewCatalog ¶
NewCatalog returns a new states catalog instance
type Config ¶
type Config struct {
Nodes []NodeConfig `yaml:"nodes"`
}
Config represents the poller configuration struct
type Host ¶
type Host struct {
Name string
State int64
StateChanged time.Time
Comments []Comment
Links [][2]string
Services []*Service
Groups []string
Catalog *Catalog
}
Host represents a host entry in a states catalog
type LinkConfig ¶
type LinkConfig struct {
Label string `yaml:"label"`
HostURL string `yaml:"host_url"`
ServiceURL string `yaml:"service_url"`
}
LinkConfig represents a link entry in a poller's node
type NodeConfig ¶
type NodeConfig struct {
Name string `yaml:"name"`
Label string `yaml:"label"`
Address string `yaml:"remote_addr"`
Links []LinkConfig `yaml:"links"`
PollInterval int `yaml:"poll_interval"`
}
NodeConfig represents a node entry in the poller
type Poller ¶
type Poller struct {
Workers []*Worker
// contains filtered or unexported fields
}
Poller represents a poller instance
func (*Poller) GetHostByName ¶
GetHostByName returns an host based on its name, or nil if not found
type Service ¶
type Service struct {
Name string
State int64
StateChanged time.Time
Comments []Comment
Links [][2]string
Output string
Groups []string
Host *Host
}
Service represents a service entry in a states catalog host
type Worker ¶
type Worker struct {
Catalog *Catalog
Config NodeConfig
// contains filtered or unexported fields
}
Worker represents a worker instance in a poller
func NewWorker ¶
func NewWorker(c NodeConfig, wg *sync.WaitGroup) *Worker
NewWorker returns a new worker instance
Click to show internal directories.
Click to hide internal directories.