Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOpts = ConnectionOpts{
Endpoint: "localhost:8080",
CertPath: ".certs/procjonagent.pem",
KeyCertPath: ".certs/procjonagent.key",
RootCertPath: ".certs/ca.pem",
}
Functions ¶
func NewConnection ¶
func NewConnection(opts *ConnectionOpts) (*grpc.ClientConn, error)
NewConnection initializes connection to given endpoint. Certificates in ConnectionOpts must be provided. Connection must be closed. This is done in (*Service) Run function.
Types ¶
type ConnectionOpts ¶
type Elasticsearch ¶
type Elasticsearch struct { Host string Client httpClient }
Elasticsearch monitors Elsaticsearch cluster. It consumes cluster health API: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html. When error eccurs using API, status "unknown" is returned.
func (*Elasticsearch) GetCurrentStatus ¶
func (e *Elasticsearch) GetCurrentStatus() uint32
GetCurrentStatus fetches Elasticsearch /_cluster/health APT to get status.
func (*Elasticsearch) GetStatuses ¶
func (e *Elasticsearch) GetStatuses() []string
GetStatuses just returns al posiible statuses for Elasticsearch.
type Ping ¶
type Ping struct { }
Ping is simplest agenter. It can be used to monitor host. When host loses connection with procjon, procjon will send availability update to Slack.
func (*Ping) GetCurrentStatus ¶
GetCurrentStatus returns always 0.
func (*Ping) GetStatuses ¶
GetStatuses return only "ok" status.
type SystemdUnit ¶
type SystemdUnit struct { Name string Connection listUnits }
SystemdUnit monitors any systemd unit. Please refer to https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html#Properties1 for list of possible unit statuses.
func (*SystemdUnit) GetCurrentStatus ¶
func (m *SystemdUnit) GetCurrentStatus() uint32
GetCurrentStatus of SystemdUnit.Name from dbus.
func (*SystemdUnit) GetStatuses ¶
func (m *SystemdUnit) GetStatuses() []string
GetStatuses returns possible statuses defined for SystemdUnit.