monit_client

package
v0.0.0-...-d591811 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MonitMonitorStatusStopped      = 0
	MonitMonitorStatusStarted      = 1
	MonitMonitorStatusInitializing = 2
	ServicePending                 = "pending"
	ServiceStopped                 = "stopped"
	ServiceInitializing            = "initializing"
	ServiceRunning                 = "running"
	ServiceFailing                 = "failing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitClient

type MonitClient struct {
	URL      *url.URL
	User     string
	Password string
	Timeout  time.Duration
}

func NewClient

func NewClient(address, user, password string, timeout time.Duration) *MonitClient

func (*MonitClient) Start

func (c *MonitClient) Start(processName string) error

func (*MonitClient) Status

func (c *MonitClient) Status(processName string) (string, error)

func (*MonitClient) Stop

func (c *MonitClient) Stop(processName string) error

type MonitStatus

type MonitStatus struct {
	XMLName  xml.Name     `xml:"monit"`
	Services []ServiceTag `xml:"service"`
}

func ParseXML

func ParseXML(xmlReader io.Reader) (MonitStatus, error)

type ServiceStatus

type ServiceStatus string

type ServiceTag

type ServiceTag struct {
	XMLName       xml.Name `xml:"service"`
	Name          string   `xml:"name"`
	Status        int      `xml:"status"`
	Monitor       int      `xml:"monitor"`
	PendingAction int      `xml:"pendingaction"`
}

func (ServiceTag) String

func (t ServiceTag) String() string

Jump to

Keyboard shortcuts

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