structs

package
v0.0.0-...-68f7547 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NotificationNormal notification reason
	NotificationNormal = C.NOTIFICATION_NORMAL
	// NotificationAcknowledgement notification reason
	NotificationAcknowledgement = C.NOTIFICATION_ACKNOWLEDGEMENT
	// NotificationFlappingstart notification reason
	NotificationFlappingstart = C.NOTIFICATION_FLAPPINGSTART
	// NotificationFlappingstop notification reason
	NotificationFlappingstop = C.NOTIFICATION_FLAPPINGSTOP
	// NotificationFlappingdisabled notification reason
	NotificationFlappingdisabled = C.NOTIFICATION_FLAPPINGDISABLED
	// NotificationDowntimestart notification reason
	NotificationDowntimestart = C.NOTIFICATION_DOWNTIMESTART
	// NotificationDowntimeend notification reason
	NotificationDowntimeend = C.NOTIFICATION_DOWNTIMEEND
	// NotificationDowntimecancelled notification reason
	NotificationDowntimecancelled = C.NOTIFICATION_DOWNTIMECANCELLED
	// NotificationCustom notification reason
	NotificationCustom = C.NOTIFICATION_CUSTOM

	// HostNotification notification type
	HostNotification = C.HOST_NOTIFICATION
	// ServiceNotification notification type
	ServiceNotification = C.SERVICE_NOTIFICATION
)

Variables

This section is empty.

Functions

func CastNotificationReasonToString

func CastNotificationReasonToString(typ int) string

func CastNotificationTypeToString

func CastNotificationTypeToString(typ int) string

func GetVaultMacroName

func GetVaultMacroName(data unsafe.Pointer) string

GetVaultMacroName returns macro name from pointer

func SetVaultMacroValue

func SetVaultMacroValue(data unsafe.Pointer, value string)

SetVaultMacroValue sets vault macro value

Types

type ContactNotificationCheck

type ContactNotificationCheck struct {
	Process
	NotificationType   int
	StartTime          Timeval
	EndTime            Timeval
	HostName           string
	ServiceDescription string
	ReasonType         int
	State              int
	Output             string
	AckAuthor          string
	AckData            string
	Escalated          int
	ObjectPtr          unsafe.Pointer
	ContactName        string
}

ContactNotificationCheck notification check structure

func CastContactNotificationCheck

func CastContactNotificationCheck(data unsafe.Pointer) ContactNotificationCheck

CastContactNotificationCheck tries to cast the pointer to an go struct

type Host

type Host struct {
	MetaHostAndService
	Name  string
	Alias string
	// CheckCommand contains args
	CheckCommand string
	// Command is the pure pluginname
	Command string
}

Host represents a naemon host

func CastHost

func CastHost(data unsafe.Pointer) Host

CastHost tries to cast the pointer to an go struct

type HostCheck

type HostCheck struct {
	Process
	HostName       string
	CheckType      int
	CurrentAttempt int
	MaxAttempts    int
	StateType      int
	State          int
	Timeout        int
	CommandName    string
	CommandArgs    string
	CommandLine    string
	StartTime      Timeval
	EndTime        Timeval
	EarlyTimeout   int
	ExecutionTime  float64
	Latency        float64
	ReturnCode     int
	Output         string
	LongOutput     string
	PerfData       string
	ObjectPtr      unsafe.Pointer
}

HostCheck host check structure

func CastHostCheck

func CastHostCheck(data unsafe.Pointer) HostCheck

CastHostCheck tries to cast the pointer to an go struct

type HostList

type HostList []Host

HostList is a list of hosts

func (HostList) GenMetaHostAndServiceList

func (host HostList) GenMetaHostAndServiceList() MetaHostAndServiceList

GenMetaHostAndServiceList will create a MetaHostAndServiceList

type HostStatus

type HostStatus struct {
	Process
	ObjectPtr unsafe.Pointer
}

func CastHostStatus

func CastHostStatus(data unsafe.Pointer) HostStatus

CastHostStatus tries to cast the pointer to an go struct

type MetaHostAndService

type MetaHostAndService struct {
	DisplayName              string
	ChecksEnabled            int
	CheckType                int
	IsFlapping               int
	CurrentState             int // 0: up, 1: down, 2: unreachable. See stateTypes
	ScheduledDowntimeDepth   int
	PendingFlexDowntimeDepth int
}

MetaHostAndService contains data for host and service

func CastMetaHostAndService

func CastMetaHostAndService(data unsafe.Pointer, typ MetaType) MetaHostAndService

CastMetaHostAndService tries to cast the pointer to an go struct

type MetaHostAndServiceList

type MetaHostAndServiceList []MetaHostAndService

MetaHostAndServiceList is a list of MetaHostAndService

type MetaType

type MetaType int

MetaType is needed to differentiate the void pointer in the constructor

const (
	MetaHost MetaType = iota
	MetaService
)

type NotificationCheck

type NotificationCheck struct {
	Process
	NotificationType   int
	StartTime          Timeval
	EndTime            Timeval
	HostName           string
	ServiceDescription string
	ReasonType         int
	State              int
	Output             string
	AckAuthor          string
	AckData            string
	Escalated          int
	ContactsNotified   int
	ObjectPtr          unsafe.Pointer
}

NotificationCheck notification check structure

func CastNotificationCheck

func CastNotificationCheck(data unsafe.Pointer) NotificationCheck

CastNotificationCheck tries to cast the pointer to an go struct

type Process

type Process struct {
	Type      int
	Flags     int
	Attr      int
	Timestamp Timeval
}

Process will be returned by process data

func CastProcess

func CastProcess(data unsafe.Pointer) Process

CastProcess tries to cast the pointer to an go struct

type Service

type Service struct {
	MetaHostAndService
	HostName    string
	Description string
	// CheckCommand contains args
	CheckCommand string
	// Command is the pure pluginname
	Command string
}

Service represents a naemon service

func CastService

func CastService(data unsafe.Pointer) Service

CastService tries to cast the pointer to an go struct

type ServiceCheck

type ServiceCheck struct {
	Process
	Service
	CheckType      int
	CurrentAttempt int
	MaxAttempts    int
	StateType      int
	State          int
	Timeout        int
	StartTime      Timeval
	EndTime        Timeval
	EarlyTimeout   int
	ExecutionTime  float64
	Latency        float64
	ReturnCode     int
	Output         string
	LongOutput     string
	PerfData       string
	ObjectPtr      unsafe.Pointer
}

ServiceCheck service check structure

func CastServiceCheck

func CastServiceCheck(data unsafe.Pointer) ServiceCheck

CastServiceCheck tries to cast the pointer to an go struct

type ServiceList

type ServiceList []Service

ServiceList is a list of services

func (ServiceList) GenMetaHostAndServiceList

func (service ServiceList) GenMetaHostAndServiceList() MetaHostAndServiceList

GenMetaHostAndServiceList will create a MetaHostAndServiceList

type Timeval

type Timeval struct {
	TvSec  int
	TvUsec int
}

Timeval represents the c struct

func CastTimeval

func CastTimeval(data unsafe.Pointer) Timeval

CastTimeval tries to cast the pointer to an go struct

func CastTimevalStruct

func CastTimevalStruct(data C.struct_timeval) Timeval

CastTimevalStruct cast the C struct to an go struct

Jump to

Keyboard shortcuts

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