checkmk

package module
v0.0.0-...-a9e0b74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 10 Imported by: 0

README

go-checkmk

Quickstart

go get github.com/ao-com/go-checkmk

Creating a new client:

client := checkmk.NewClient("url", "username", "password")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog []*AuditLogEntry

AuditLog is a slice of audit log entries

func (*AuditLog) FindEntriesByDescription

func (auditLog *AuditLog) FindEntriesByDescription(description string) []*AuditLogEntry

FindEntriesByDescription returns audit log entries based on a matching description

func (*AuditLog) FindEntriesByUsername

func (auditLog *AuditLog) FindEntriesByUsername(username string) []*AuditLogEntry

FindEntriesByUsername returns audit log entries based on a matching username

func (*AuditLog) ParseFromReader

func (auditLog *AuditLog) ParseFromReader(r io.Reader) error

ParseFromReader populates the audit log with entries found in the reader

type AuditLogEntry

type AuditLogEntry struct {
	Host        string
	Date        time.Time
	Username    string
	Description string
}

AuditLogEntry represents a row in the audit log

type Client

type Client struct {
	URL        string
	Username   string
	Password   string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client struct for check mk

func NewClient

func NewClient(url string, username string, password string) Client

NewClient will create a new check mk client

func (Client) ActivateChanges

func (client Client) ActivateChanges() error

ActivateChanges activates any pending changes in check_mk

func (Client) AddHost

func (client Client) AddHost(hostname string, folder string) (bool, error)

AddHost adds a host to check mk returns

func (Client) AuditLog

func (client Client) AuditLog() (AuditLog, error)

AuditLog returns the default audit log which consists of today's entries

func (Client) GetDowntimesForHost

func (client Client) GetDowntimesForHost(host string) (Downtimes, error)

GetDowntimesForHost returns downtime entries for a given host

func (Client) IsAuthenticated

func (client Client) IsAuthenticated() (bool, error)

IsAuthenticated checks if the client is successfully authenticated

func (Client) RemoveHost

func (client Client) RemoveHost(hostname string) error

RemoveHost removes a host from check mk

func (Client) ScheduleHostDowntime

func (client Client) ScheduleHostDowntime(host string, minutes int, comment string) error

ScheduleHostDowntime places a given host in downtime for a given amount of minutes

type DowntimeEntry

type DowntimeEntry struct {
	Origin           string
	Author           string
	Entry            string
	Start            string
	End              string
	Mode             string
	FlexibleDuration string
	Recurring        string
	Comment          string
}

DowntimeEntry represents a row in the downtimes view

type Downtimes

type Downtimes []*DowntimeEntry

Downtimes is a slice of downtime entries

func (*Downtimes) ParseFromReader

func (downtimes *Downtimes) ParseFromReader(r io.Reader) error

ParseFromReader populates downtimes with entries found in the reader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL