Documentation ¶
Index ¶
- Variables
- func GetZabbixPriority(severity string) zabbix.PriorityType
- type CustomApplication
- type CustomHost
- func (host *CustomHost) AddApplication(application *CustomApplication)
- func (host *CustomHost) AddItem(item *CustomItem)
- func (host *CustomHost) AddTrigger(trigger *CustomTrigger)
- func (i *CustomHost) Equal(j *CustomHost) bool
- func (host *CustomHost) GetApplicationsByState() (applicationsByState map[State]zabbix.Applications)
- func (host *CustomHost) GetItemsByState() (itemsByState map[State]zabbix.Items)
- func (host *CustomHost) GetTriggersByState() (triggersByState map[State]zabbix.Triggers)
- func (host *CustomHost) PropagateCreatedApplications(applications zabbix.Applications)
- type CustomHostGroup
- type CustomItem
- type CustomTrigger
- type CustomZabbix
- func (z *CustomZabbix) AddHost(host *CustomHost) (updatedHost *CustomHost)
- func (z *CustomZabbix) AddHostGroup(hostGroup *CustomHostGroup)
- func (z *CustomZabbix) GetHostGroupsByState() (hostGroupsByState map[State]zabbix.HostGroups)
- func (z *CustomZabbix) GetHostsByState() (hostByState map[State]zabbix.Hosts)
- func (zabbix *CustomZabbix) PropagateCreatedHostGroups(hostGroups zabbix.HostGroups)
- func (zabbix *CustomZabbix) PropagateCreatedHosts(hosts zabbix.Hosts)
- type HostConfig
- type PrometheusAlertRules
- type PrometheusRule
- type Provisioner
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var StateName = map[State]string{ StateNew: "New", StateUpdated: "Updated", StateEqual: "Equal", StateOld: "Old", }
Functions ¶
func GetZabbixPriority ¶
func GetZabbixPriority(severity string) zabbix.PriorityType
Types ¶
type CustomApplication ¶
type CustomApplication struct { State State zabbix.Application }
type CustomHost ¶
type CustomHost struct { State State zabbix.Host HostGroups map[string]struct{} Applications map[string]*CustomApplication Items map[string]*CustomItem Triggers map[string]*CustomTrigger }
func (*CustomHost) AddApplication ¶
func (host *CustomHost) AddApplication(application *CustomApplication)
func (*CustomHost) AddItem ¶
func (host *CustomHost) AddItem(item *CustomItem)
func (*CustomHost) AddTrigger ¶
func (host *CustomHost) AddTrigger(trigger *CustomTrigger)
func (*CustomHost) Equal ¶
func (i *CustomHost) Equal(j *CustomHost) bool
func (*CustomHost) GetApplicationsByState ¶
func (host *CustomHost) GetApplicationsByState() (applicationsByState map[State]zabbix.Applications)
func (*CustomHost) GetItemsByState ¶
func (host *CustomHost) GetItemsByState() (itemsByState map[State]zabbix.Items)
func (*CustomHost) GetTriggersByState ¶
func (host *CustomHost) GetTriggersByState() (triggersByState map[State]zabbix.Triggers)
func (*CustomHost) PropagateCreatedApplications ¶
func (host *CustomHost) PropagateCreatedApplications(applications zabbix.Applications)
type CustomHostGroup ¶
type CustomItem ¶
func (*CustomItem) Equal ¶
func (i *CustomItem) Equal(j *CustomItem) bool
type CustomTrigger ¶
func (*CustomTrigger) Equal ¶
func (i *CustomTrigger) Equal(j *CustomTrigger) bool
type CustomZabbix ¶
type CustomZabbix struct { Hosts map[string]*CustomHost HostGroups map[string]*CustomHostGroup }
func (*CustomZabbix) AddHost ¶
func (z *CustomZabbix) AddHost(host *CustomHost) (updatedHost *CustomHost)
func (*CustomZabbix) AddHostGroup ¶
func (z *CustomZabbix) AddHostGroup(hostGroup *CustomHostGroup)
func (*CustomZabbix) GetHostGroupsByState ¶
func (z *CustomZabbix) GetHostGroupsByState() (hostGroupsByState map[State]zabbix.HostGroups)
func (*CustomZabbix) GetHostsByState ¶
func (z *CustomZabbix) GetHostsByState() (hostByState map[State]zabbix.Hosts)
func (*CustomZabbix) PropagateCreatedHostGroups ¶
func (zabbix *CustomZabbix) PropagateCreatedHostGroups(hostGroups zabbix.HostGroups)
func (*CustomZabbix) PropagateCreatedHosts ¶
func (zabbix *CustomZabbix) PropagateCreatedHosts(hosts zabbix.Hosts)
type HostConfig ¶
type HostConfig struct { Name string `yaml:"name"` HostGroups []string `yaml:"hostGroups"` Tag string `yaml:"tag"` DeploymentStatus string `yaml:"deploymentStatus"` ItemDefaultApplication string `yaml:"itemDefaultApplication"` ItemDefaultHistory string `yaml:"itemDefaultHistory"` ItemDefaultTrends string `yaml:"itemDefaultTrends"` ItemDefaultTrapperHosts string `yaml:"itemDefaultTrapperHosts"` HostAlertsDir string `yaml:"alertsDir"` TriggerTags map[string]string `yaml:"triggerTags"` }
func LoadHostConfigFromFile ¶
func LoadHostConfigFromFile(filename string) ([]HostConfig, error)
type PrometheusAlertRules ¶
type PrometheusAlertRules struct { Groups []struct { Rules []PrometheusRule `yaml:"rules"` } `yaml:"groups"` }
type PrometheusRule ¶
type PrometheusRule struct { Name string `yaml:"alert"` Annotations map[string]string `yaml:"annotations"` Expression string `yaml:"expr"` Labels map[string]string `yaml:"labels"` }
func LoadPrometheusRulesFromDir ¶
func LoadPrometheusRulesFromDir(dir string) ([]PrometheusRule, error)
type Provisioner ¶
type Provisioner struct { *CustomZabbix // contains filtered or unexported fields }
func New ¶
func New(prometheusUrl, keyPrefix, url, user, password string, hosts []HostConfig) (*Provisioner, error)
func (*Provisioner) ApplyChanges ¶
func (p *Provisioner) ApplyChanges() error
func (*Provisioner) LoadDataFromZabbix ¶
func (p *Provisioner) LoadDataFromZabbix() error
Update created hosts with the current state in Zabbix
func (*Provisioner) LoadRulesFromPrometheus ¶
func (p *Provisioner) LoadRulesFromPrometheus(hostConfig HostConfig) error
Create hosts structures and populate them from Prometheus rules
func (*Provisioner) Run ¶
func (p *Provisioner) Run() error
Click to show internal directories.
Click to hide internal directories.