Documentation
¶
Overview ¶
Package prtg implements the API for PRTG custom sensors. It provides all structs and constants needed to implement your own advanced exe sensor in go.
API reference can be found here: https://prtg.paessler.com/api.htm?username=demo&password=demodemo&tabid=7
Index ¶
Constants ¶
View Source
const ( UnitBytesBandwidth = "BytesBandwidth" UnitBytesMemory = "BytesMemory" UnitBytesDisk = "BytesDisk" UnitBytesFile = "BytesFile" UnitTemperature = "Temperature" UnitPercent = "Percent" UnitTimeResponse = "TimeResponse" UnitTimeSeconds = "TimeSeconds" UnitCustom = "Custom" UnitCount = "Count" UnitCPU = "CPU" UnitSpeedDisk = "SpeedDisk" UnitSpeedNet = "SpeedNet" UnitTimeHours = "TimeHours" )
Units of channel values
View Source
const ( UnitOne = "One" UnitKilo = "Kilo" UnitMega = "Mega" UnitGiga = "Giga" UnitTera = "Tera" UnitByte = "Byte" UnitKiloByte = "KiloByte" UnitMegaByte = "MegaByte" UnitGigaByte = "Gigabyte" UnitTeraByte = "TeraByte" UnitBit = "Bit" UnitKiloBit = "KiloBit" UnitMegaBit = "MegaBit" UnitGigaBit = "GigaBit" UnitTeraBit = "TeraBit" )
Unit of VolumeSize or SpeedSize
View Source
const ( UnitSecond = "Second" UnitMinute = "Minute" UnitHour = "Hour" UnitDay = "Day" )
Unit of speedTime
View Source
const ( OptionAbsolute = "Absolute" OptionDifference = "Difference" OptionAuto = "Auto" OptionAll = "All" )
Options for DecimalMode and Mode
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SensorChannel ¶
type SensorChannel struct {
Name string `json:"channel,omitempty"`
ChannelID *int `json:"channelid,omitempty"`
Value float64 ``
// Options
Unit string `json:",omitempty"`
CustomUnit string `json:",omitempty"`
SpeedSize string `json:",omitempty"`
VolumeSize string `json:",omitempty"`
SpeedTime string `json:",omitempty"`
Mode string `json:",omitempty"`
Float int `json:",omitempty"`
DecimalMode string `json:",omitempty"`
Warning int `json:",omitempty"`
ShowChart *int `json:",omitempty"`
ShowTable *int `json:",omitempty"`
LimitMaxError *float64 `json:",omitempty"`
LimitMaxWarning *float64 `json:",omitempty"`
LimitMinWarning *float64 `json:",omitempty"`
LimitMinError *float64 `json:",omitempty"`
LimitErrorMsg string `json:",omitempty"`
LimitWarningMsg string `json:",omitempty"`
LimitMode int `json:",omitempty"`
ValueLookup string `json:",omitempty"`
NotifyChanged bool `json:",omitempty"`
}
SensorChannel represents a PRTG sensor channel
type SensorResponse ¶
type SensorResponse struct {
SensorResult `json:"prtg"`
}
SensorResponse is the struct returned by the sensor
func (*SensorResponse) AddChannel ¶
func (s *SensorResponse) AddChannel(channel SensorChannel)
AddChannel adds a new channel to a SensorResponse
func (SensorResponse) String ¶
func (s SensorResponse) String() string
String converts the SensorResponse to a JSON formatted string
type SensorResult ¶
type SensorResult struct {
Channels []SensorChannel `json:"result"`
Error int `json:"error,omitempty"`
Text string `json:"text,omitempty"`
}
SensorResult contains the sensors channels and optional error/text
Click to show internal directories.
Click to hide internal directories.