Documentation ¶
Index ¶
- type Action
- type Checkable
- type Client
- type Command
- type Downtime
- type DowntimeResults
- type Host
- type HostCreate
- type HostGroup
- type HostGroupCreate
- type HostGroupResults
- type HostResults
- type MockClient
- func (s *MockClient) CreateHost(host Host) error
- func (s *MockClient) CreateHostGroup(hostGroup HostGroup) error
- func (s *MockClient) CreateService(service Service) error
- func (s *MockClient) DeleteHost(name string) error
- func (s *MockClient) DeleteHostGroup(name string) error
- func (s *MockClient) DeleteService(name string) error
- func (s *MockClient) GetHost(name string) (Host, error)
- func (s *MockClient) GetHostGroup(name string) (HostGroup, error)
- func (s *MockClient) GetService(name string) (Service, error)
- func (s *MockClient) ListDowntimes(query string) ([]Downtime, error)
- func (s *MockClient) ListHostGroups(query string) ([]HostGroup, error)
- func (s *MockClient) ListHosts(query string) ([]Host, error)
- func (s *MockClient) ListServices(query string) ([]Service, error)
- func (s *MockClient) ProcessCheckResult(service Service, action Action) error
- func (s *MockClient) UpdateHost(host Host) error
- func (s *MockClient) UpdateHostGroup(hostGroup HostGroup) error
- func (s *MockClient) UpdateService(service Service) error
- type Object
- type PerfData
- type Results
- type Service
- type ServiceCreate
- type ServiceResults
- type TimeStamp
- type Vars
- type WebClient
- func (s *WebClient) CreateHost(host Host) error
- func (s *WebClient) CreateHostGroup(hostGroup HostGroup) error
- func (s *WebClient) CreateObject(path string, create interface{}) error
- func (s *WebClient) CreateService(service Service) error
- func (s *WebClient) DeleteHost(name string) (err error)
- func (s *WebClient) DeleteHostGroup(name string) (err error)
- func (s *WebClient) DeleteService(name string) (err error)
- func (s *WebClient) GetHost(name string) (Host, error)
- func (s *WebClient) GetHostGroup(name string) (HostGroup, error)
- func (s *WebClient) GetService(name string) (Service, error)
- func (s *WebClient) ListDowntimes(query string) (downtimes []Downtime, err error)
- func (s *WebClient) ListHostGroups(query string) (hostGroups []HostGroup, err error)
- func (s *WebClient) ListHosts(query string) (hosts []Host, err error)
- func (s *WebClient) ListServices(query string) (services []Service, err error)
- func (s *WebClient) ProcessCheckResult(service Service, action Action) error
- func (s *WebClient) UpdateHost(host Host) error
- func (s *WebClient) UpdateHostGroup(hostGroup HostGroup) error
- func (s *WebClient) UpdateObject(path string, create interface{}) error
- func (s *WebClient) UpdateService(service Service) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { ExitStatus int `json:"exit_status"` PluginOutput string `json:"plugin_output"` PerformanceData PerfData `json:"performance_data,omitempty"` CheckCommand Command `json:"check_command,omitempty"` CheckSource string `json:"check_source,omitempty"` ExecutionStart TimeStamp `json:"execution_start,omitempty"` ExecutionEnd TimeStamp `json:"execution_end,omitempty"` TTL int `json:"ttl"` Filter string `json:"filter"` Type string `json:"type"` }
type Client ¶
type Client interface { GetHost(string) (Host, error) CreateHost(Host) error ListHosts(string) ([]Host, error) DeleteHost(string) error UpdateHost(Host) error GetHostGroup(string) (HostGroup, error) CreateHostGroup(HostGroup) error ListHostGroups(string) ([]HostGroup, error) DeleteHostGroup(string) error UpdateHostGroup(HostGroup) error ListDowntimes(string) ([]Downtime, error) GetService(string) (Service, error) CreateService(Service) error ListServices(string) ([]Service, error) DeleteService(string) error UpdateService(Service) error ProcessCheckResult(Service, Action) error }
type Downtime ¶
type Downtime struct { Active bool `json:"active"` Author string `json:"author"` Comment string `json:"comment"` EndTime float64 `json:"end_time"` Fixed bool `json:"fixed"` Host string `json:"host_name"` Name string `json:"name,omitempty"` Service string `json:"service_name"` StartTime float64 `json:"start_time"` Type string `json:"type"` Zone string `json:"zone"` }
type DowntimeResults ¶
type DowntimeResults struct { Results []struct { Downtime Downtime `json:"attrs"` } `json:"results"` }
type Host ¶
type Host struct { Name string `json:"name,omitempty"` DisplayName string `json:"display_name"` Address string `json:"address,omitempty"` Address6 string `json:"address6,omitempty"` CheckCommand string `json:"check_command,omitempty"` Notes string `json:"notes"` NotesURL string `json:"notes_url"` CheckPeriod string `json:"check_period,omitempty"` Vars Vars `json:"vars"` Groups []string `json:"groups,omitempty"` Zone string `json:"zone,omitempty"` }
func (Host) GetCheckCommand ¶
func (Host) GetNotesURL ¶
type HostCreate ¶
type HostGroup ¶
type HostGroupCreate ¶
type HostGroupResults ¶
type HostGroupResults struct { Results []struct { HostGroup HostGroup `json:"attrs"` } `json:"results"` }
type HostResults ¶
type HostResults struct { Results []struct { Host Host `json:"attrs"` } `json:"results"` }
type MockClient ¶
type MockClient struct { Hostgroups map[string]HostGroup Hosts map[string]Host Services map[string]Service Actions map[string][]Action // contains filtered or unexported fields }
func NewMockClient ¶
func NewMockClient() (c *MockClient)
func (*MockClient) CreateHost ¶
func (s *MockClient) CreateHost(host Host) error
func (*MockClient) CreateHostGroup ¶
func (s *MockClient) CreateHostGroup(hostGroup HostGroup) error
func (*MockClient) CreateService ¶
func (s *MockClient) CreateService(service Service) error
func (*MockClient) DeleteHost ¶
func (s *MockClient) DeleteHost(name string) error
func (*MockClient) DeleteHostGroup ¶
func (s *MockClient) DeleteHostGroup(name string) error
func (*MockClient) DeleteService ¶
func (s *MockClient) DeleteService(name string) error
func (*MockClient) GetHostGroup ¶
func (s *MockClient) GetHostGroup(name string) (HostGroup, error)
func (*MockClient) GetService ¶
func (s *MockClient) GetService(name string) (Service, error)
func (*MockClient) ListDowntimes ¶
func (s *MockClient) ListDowntimes(query string) ([]Downtime, error)
func (*MockClient) ListHostGroups ¶
func (s *MockClient) ListHostGroups(query string) ([]HostGroup, error)
func (*MockClient) ListServices ¶
func (s *MockClient) ListServices(query string) ([]Service, error)
func (*MockClient) ProcessCheckResult ¶
func (s *MockClient) ProcessCheckResult(service Service, action Action) error
func (*MockClient) UpdateHost ¶
func (s *MockClient) UpdateHost(host Host) error
func (*MockClient) UpdateHostGroup ¶
func (s *MockClient) UpdateHostGroup(hostGroup HostGroup) error
func (*MockClient) UpdateService ¶
func (s *MockClient) UpdateService(service Service) error
type Service ¶
type Service struct { Name string `json:"name,omitempty"` DisplayName string `json:"display_name"` HostName string `json:"host_name"` CheckCommand string `json:"check_command"` EnableActiveChecks bool `json:"enable_active_checks"` Notes string `json:"notes"` NotesURL string `json:"notes_url"` ActionURL string `json:"action_url"` Vars Vars `json:"vars"` Zone string `json:"zone,omitempty"` CheckInterval float64 `json:"check_interval"` RetryInterval float64 `json:"retry_interval"` MaxCheckAttempts float64 `json:"max_check_attempts"` CheckPeriod string `json:"check_period,omitempty"` State float64 `json:"state,omitempty"` LastStateChange float64 `json:"last_state_change,omitempty"` }
func (Service) GetCheckCommand ¶
func (Service) GetNotesURL ¶
type ServiceCreate ¶
type ServiceResults ¶
type ServiceResults struct { Results []struct { Service Service `json:"attrs"` } `json:"results"` }
type WebClient ¶
type WebClient struct { URL string Username string Password string Debug bool DisableKeepAlives bool Zone string TLSConfig *tls.Config // contains filtered or unexported fields }
func (*WebClient) CreateHost ¶
func (*WebClient) CreateHostGroup ¶
func (*WebClient) CreateObject ¶
func (*WebClient) CreateService ¶
func (*WebClient) DeleteHost ¶
func (*WebClient) DeleteHostGroup ¶
func (*WebClient) DeleteService ¶
func (*WebClient) ListDowntimes ¶
func (*WebClient) ListHostGroups ¶
func (*WebClient) ListServices ¶
func (*WebClient) ProcessCheckResult ¶
func (*WebClient) UpdateHost ¶
func (*WebClient) UpdateHostGroup ¶
func (*WebClient) UpdateObject ¶
func (*WebClient) UpdateService ¶
Click to show internal directories.
Click to hide internal directories.