dmon

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkChannel   common.Channel = "dmon_network_out"
	StructureChannel common.Channel = "dmon_structure_out"
)
View Source
const (
	NetworkType   common.PayloadType = "network"
	StructureType common.PayloadType = "structure"
)
View Source
const (
	NetworkGeneralSubType     common.PayloadSubType = "general"
	StructureHostSubType      common.PayloadSubType = "host"
	StructureNetworkSubType   common.PayloadSubType = "network"
	StructureContainerSubType common.PayloadSubType = "container"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkGeneral

type NetworkGeneral struct {
	common.Header
	IPSrc             string  `json:"IPSrc"`             // Source Address, ip.src
	IPDst             string  `json:"IPDst"`             // Destination Address, ip.dst
	Protocol          string  `json:"Protocol"`          // Protocol, _ws.col.protocol
	FrameNumber       uint64  `json:"FrameNumber"`       // Frame number, frame.number (uint32)
	FrameTimeDelta    float64 `json:"FrameTimeDelta"`    // Time delta from previous captured frame, frame.time_delta (FT_RELATIVE_TIME->float64)
	FrameTimeRelative float64 `json:"FrameTimeRelative"` // Time since reference or first frame, frame.time_relative (FT_RELATIVE_TIME->float64)
	TCPStream         uint64  `json:"TCPStream"`         // Stream index, tcp.stream (uint32)
	TCPSrcPort        string  `json:"TCPSrcPort"`        // Source Port, tcp.srcport
	TCPDstPort        string  `json:"TCPDstPort"`        // Destination Port, tcp.dstport
	TCPTimeDelta      float64 `json:"TCPTimeDelta"`      // Time since previous frame in this TCP stream, tcp.time_delta (FT_RELATIVE_TIME->float64)
	TCPTimeRelative   float64 `json:"TCPTimRelative"`    // Time since first frame in this TCP stream, tcp.time_relative (FT_RELATIVE_TIME->float64)
	IsRequest         string  `json:"IsRequest"`         // Request, http.request (bool)
	RequestNumber     string  `json:"RequestNumber"`     // Request number, http.request_number (uint32->string, WARN: "" == NaN)
	RequestMethod     string  `json:"RequestMethod"`     // Request method, http.request.method
	RequestFullURI    string  `json:"RequestFullURI"`    // Full request URI, http.request.full_uri
	IsResponse        string  `json:"IsResponse"`        // Response, http.response (bool)
	ResponseNumber    string  `json:"ResponseNumber"`    // Response number, http.response_number (uint32)
	ResponseCode      string  `json:"ResponseCode"`      // Status code, http.response.code (uint24bit->string, WARN: "" == NaN)
	ResponseCodeDesc  string  `json:"ResponseCodeDesc"`  // Status code description, http.response.code.desc
	ResponseForURI    string  `json:"ResponseForURI"`    // Request URI, http.response_for.uri
	ResponseTime      string  `json:"ResponseTime"`      // Time since request, http.time (FT_RELATIVE_TIME->string, WARN: "" == NaN)
}

NOTE: FT_RELATIVE_TIME is a Wireshark/libpcap type for time delta values Precision: example value: 1.123456789 => seconds.nanoseconds Converted by default to float64

func NewNetworkGeneral

func NewNetworkGeneral(packet []string) (*NetworkGeneral, error)

func (*NetworkGeneral) Display

func (n *NetworkGeneral) Display(e func() *zerolog.Event)

func (*NetworkGeneral) Marshal

func (n *NetworkGeneral) Marshal() ([]byte, error)

type StructureContainer

type StructureContainer struct {
	common.Header
	ID          string                                 `json:"ID"`
	Name        string                                 `json:"Name"`
	Image       string                                 `json:"Image"`
	Stats       StructureContainerStats                `json:"Stats"`
	Locale      string                                 `json:"Locale"`
	Timezone    string                                 `json:"Timezone"`
	IPAddresses map[string]string                      `json:"IPAddresses"`
	Ports       map[string][]StructureContainerNetwork `json:"Ports"`
}

func NewStructureContainer

func NewStructureContainer(
	container *types.Container,
	containerJSONBase *types.ContainerJSONBase,
	containerStats *StructureContainerStats,
	locale, timezone string,
) *StructureContainer

func (*StructureContainer) Display

func (s *StructureContainer) Display(e func() *zerolog.Event)

func (*StructureContainer) Marshal

func (s *StructureContainer) Marshal() ([]byte, error)

type StructureContainerNetwork

type StructureContainerNetwork struct {
	PrivatePort uint16 `json:"PrivatePort"`
	PublicPort  uint16 `json:"PublicPort"`
	Type        string `json:"Type"`
}

type StructureContainerStats

type StructureContainerStats struct {
	CPURawUsage       float64 `json:"CPURawUsage"`       // cpu usage in bytes
	CPUSystemRawUsage float64 `json:"CPUSystemRawUsage"` // system cpu usage in bytes
	CPUsOnline        float64 `json:"CPUOnline"`         // number of online cpus
	CPUPercUsage      string  `json:"CPUPercUsage"`      // cpu usage percentage
	MemoryRawLimit    float64 `json:"MemoryRawLimit"`    // memory limit in bytes
	MemoryRawUsage    float64 `json:"MemoryRawUsage"`    // memory usage in bytes
	MemoryPercUsage   string  `json:"MemoryPercUsage"`   // memory usage percentage
	NetworkRxRaw      float64 `json:"NetworkRxRaw"`      // network rx bytes
	NetworkTxRaw      float64 `json:"NetworkTxRaw"`      // network tx bytes
	BlockIORawRead    float64 `json:"BlockIORawRead"`    // block i/o read bytes
	BlockIORawWrite   float64 `json:"BlockIORawWrite"`   // block i/o write bytes
	PIDsCurrent       float64 `json:"PIDsCurrent"`       // current number of pids
	PIDsLimit         float64 `json:"PIDsLimit"`         // max number of pids
}

type StructureHost

type StructureHost struct {
	common.Header
	OperatingSystem string `json:"OperatingSystem"`
	OSType          string `json:"OSType"`
	Architecture    string `json:"Architecture"`
	Name            string `json:"Name"`
	NCPU            int    `json:"NCPU"`
	MemTotal        int64  `json:"MemTotal"`
	KernelVersion   string `json:"KernelVersion"`
}

func NewStructureHost

func NewStructureHost(host *types.Info) *StructureHost

func (*StructureHost) Display

func (s *StructureHost) Display(e func() *zerolog.Event)

func (*StructureHost) Marshal

func (s *StructureHost) Marshal() ([]byte, error)

type StructureNetwork

type StructureNetwork struct {
	common.Header
	ID   string `json:"ID"`
	Name string `json:"Name"`
}

func NewStructureNetwork

func NewStructureNetwork(network *types.NetworkResource) *StructureNetwork

func (*StructureNetwork) Display

func (s *StructureNetwork) Display(e func() *zerolog.Event)

func (*StructureNetwork) Marshal

func (s *StructureNetwork) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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