Versions in this module Expand all Collapse all v1 v1.1.0 Feb 22, 2025 Changes in this version type Item + Error string + ItemKey string v1.0.0 May 30, 2023 Changes in this version + const ActionEvalTypeAnd + const ActionEvalTypeAndOr + const ActionEvalTypeOr + const AlertCommandStatusAgentUnavailable + const AlertCommandStatusRun + const AlertMessageStatusFailed + const AlertMessageStatusNotSent + const AlertMessageStatusSent + const AlertTypeMessage + const AlertTypeRemoteCommand + const DiscoveryEventValueDiscovered + const DiscoveryEventValueDown + const DiscoveryEventValueLost + const DiscoveryEventValueUp + const EventObjectTypeAutoRegisteredHost + const EventObjectTypeDiscoveredHost + const EventObjectTypeDiscoveredService + const EventObjectTypeItem + const EventObjectTypeLLDRule + const EventObjectTypeTrigger + const EventSourceAutoRegistration + const EventSourceDiscoveryRule + const EventSourceInternal + const EventSourceTrigger + const EveryDay + const EveryMonth + const EveryWeek + const HostAvailabilityAvailable + const HostAvailabilityUnavailable + const HostAvailabilityUnknown + const HostInterfaceAvailabilityAvailable + const HostInterfaceAvailabilityUnavailable + const HostInterfaceAvailabilityUnknown + const HostInterfaceTypeAgent + const HostInterfaceTypeIPMI + const HostInterfaceTypeJMX + const HostInterfaceTypeSNMP + const HostInventoryModeAutomatic + const HostInventoryModeDisabled + const HostInventoryModeManual + const HostSourceDefault + const HostSourceDiscovery + const HostStatusMonitored + const HostStatusUnmonitored + const HostTLSConnectCertificate + const HostTLSConnectPSK + const HostTLSConnectUnencryped + const HostgroupInternalNo + const HostgroupInternalYes + const HostgroupSourceDiscovery + const HostgroupSourcePlain + const InternalEventValueNormal + const InternalEventValueNotSupported + const Once + const ProxyStatusActive + const ProxyStatusPassive + const ProxyTLSConnectCertificate + const ProxyTLSConnectPSK + const ProxyTLSConnectUnencryped + const ScriptExecuteOnAgent + const ScriptExecuteOnProxy + const ScriptExecuteOnServer + const ScriptResponseFailed + const ScriptResponseSuccess + const ScriptScopeActionOperation + const ScriptScopeManualEventAction + const ScriptScopeManualHostOperation + const ScriptTypeIPMI + const ScriptTypeSSH + const ScriptTypeScript + const ScriptTypeTelnet + const ScriptTypeWebhook + const SelectCount + const SelectExtendedOutput + const SortOrderAscending + const SortOrderDescending + const TriggerAlarmStateOK + const TriggerAlarmStateProblem + const TriggerEventValueOK + const TriggerEventValueProblem + const TriggerSeverityAverage + const TriggerSeverityDisaster + const TriggerSeverityHigh + const TriggerSeverityInformation + const TriggerSeverityNotClassified + const TriggerSeverityWarning + const TriggerStateNormal + const TriggerStateUnknown + var ErrMaintenanceHostNotFound = errors.New("Failed to find ID by host name") + var ErrNotFound = &NotFoundError + type APIError struct + Code int + Data string + Message string + func (e *APIError) Error() string + type Action struct + ActionID string + Conditions []ActionCondition + Enabled types.ZBXBoolean + EvaluationType int + EventType int + Name string + Operations []ActionOperation + ProblemMessageBody string + ProblemMessageSubject string + RecoveryMessageBody string + RecoveryMessageEnabled types.ZBXBoolean + RecoveryMessageSubject string + StepDuration types.ZBXDuration + type ActionCondition struct + type ActionGetParams struct + type ActionOperation struct + type Alert struct + ActionID string + AlertID string + AlertType int + ErrorText string + EscalationStep int + EventID string + Hosts []Host + MediaTypeID string + Message string + Recipient string + RetryCount int + Status int + Subject string + Timestamp types.ZBXUnixTimestamp + UserID string + type AlertGetParams struct + SelectHosts SelectQuery + SelectMediaTypes SelectQuery + SelectUsers SelectQuery + type ClientBuilder struct + func CreateClient(apiEndpoint string) *ClientBuilder + func (builder *ClientBuilder) Connect() (session *Session, err error) + func (builder *ClientBuilder) WithCache(cache SessionAbstractCache) *ClientBuilder + func (builder *ClientBuilder) WithCredentials(username string, password string) *ClientBuilder + func (builder *ClientBuilder) WithHTTPClient(client *http.Client) *ClientBuilder + type Event struct + Acknowledged types.ZBXBoolean + EventID string + Hosts []Host + ObjectID int + ObjectType int + Source int + Value int + ValueChanged types.ZBXBoolean + func (e *Event) Timestamp() time.Time + type EventGetParams struct + AcknowledgedOnly bool + EventIDs []string + GroupIDs []string + HostIDs []string + MaxEventID string + MaxTime int64 + MinEventID string + MinTime int64 + ObjectIDs []string + ObjectType int + SelectAcknowledgements SelectQuery + SelectAlerts SelectQuery + SelectHosts SelectQuery + SelectRelatedObject SelectQuery + Value []int + type GetParameters struct + CountOutput bool + EditableOnly bool + EnableTextSearchWildcards bool + ExcludeSearch bool + Filter map[string]interface{} + NodeIDs []string + OutputFields SelectQuery + ResultLimit int + SearchByAny bool + SearchInventory map[string]string + SortField []string + SortOrder string + TextSearch map[string]string + TextSearchByStart bool + type History struct + ItemID int + LogEventID int + Severity int + Source string + Value string + func (h *History) Timestamp() time.Time + type HistoryGetParams struct + History int + HistoryIDs []string + ItemIDs []string + TimeFrom float64 + TimeTill float64 + type Host struct + Available int + Description string + DisplayName string + Groups []Hostgroup + HostID string + Hostname string + Interfaces []HostInterface + Inventory HostInventory + InventoryMode int + Macros []HostMacro + MaintenanceFrom string + MaintenanceID string + MaintenanceStatus string + MaintenanceType string + ProxyHostID string + Source int + Status int + TLSAccept int + TLSConnect int + TLSIssuer string + TLSPSK string + TLSPSKIdentity string + TLSSubject string + type HostGetParams struct + ApplicationIDs []string + DiscoveredServiceIDs []string + GraphIDs []string + GroupIDs []string + HostIDs []string + IncludeTemplates bool + InterfaceIDs []string + ItemIDs []string + MaintenanceIDs []string + MonitoredOnly bool + ProxiesOnly bool + ProxyIDs []string + SelectApplications SelectQuery + SelectDiscoveries SelectQuery + SelectDiscoveryRule SelectQuery + SelectGraphs SelectQuery + SelectGroups SelectQuery + SelectHostDiscovery SelectQuery + SelectInterfaces SelectQuery + SelectInventory SelectQuery + SelectItems SelectQuery + SelectMacros SelectQuery + SelectParentTemplates SelectQuery + SelectScreens SelectQuery + SelectTriggers SelectQuery + SelectWebScenarios SelectQuery + WebCheckIDs []string + type HostInterface struct + Available int + DNS string + Error string + ErrorsFrom *types.ZBXUnixTimestamp + HostID string + IP string + InterfaceID string + Main types.ZBXBoolean + Type int + UseIP types.ZBXBoolean + type HostInterfaceGetParams struct + HostIDs []string + InterfaceIDs []string + ItemIDs []string + TriggerIDs []string + type HostInventory map[string]string + func (hi *HostInventory) UnmarshalJSON(data []byte) error + type HostMacro struct + HostID string + HostMacroID string + Macro string + Value string + type Hostgroup struct + Flags string + GroupID string + Hosts []Host + Internal string + Name string + type HostgroupGetParams struct + GraphIDs []string + GroupIDs []string + HostIDs []string + LimitSelects int + MaintenanceIDs []string + MonitoredHosts int + RealHosts int + SelectDiscoveryRule SelectQuery + SelectGroupDiscovery SelectQuery + SelectHosts SelectQuery + SelectTemplates SelectQuery + Sortfield []string + TemplateIDs []string + TemplatedHosts int + TriggerIDs []string + WithApplications int + WithGraphs int + WithHostsAndTemplates int + WithHttptests int + WithItems int + WithMonitoredHttptests int + WithMonitoredItems int + WithMonitoredTriggers int + WithSimpleGraphItems int + WithTriggers int + type Item struct + HostID string + ItemDescr string + ItemID string + ItemName string + LastClock int + LastValue string + LastValueType int + type ItemGetParams struct + Application string + ApplicationIDs []string + GraphIDs []string + Group string + GroupIDs []string + Host string + HostIDs []string + Inherited bool + InterfaceIDs []string + ItemIDs []string + Monitored bool + ProxyIDs []string + Tags []ItemTagFilter + TemplateIDs []string + Templated bool + TriggerIDs []string + WebItems bool + WithTriggers bool + type ItemTagFilter struct + Operator int + Tag string + Value string + type Maintenance struct + ActionEvalTypeAndOr TagsEvaltype + ActiveSince types.ZBXUnixTimestamp + ActiveTill types.ZBXUnixTimestamp + Description string + MaintenanceID string + Name string + Type MaintenanceType + func (m *Maintenance) Delete(session *Session) error + type MaintenanceCreateParams struct + Groupids []string + HostIDs []string + HostNames []string + Tags []string + Timeperiods []MaintenanceTimeperiods + func (m *MaintenanceCreateParams) FillHostIDs(session *Session) error + type MaintenanceCreateResponse struct + IDs []string + type MaintenanceGetParams struct + Groupids []string + Hostids []string + Maintenanceids []string + SelectGroups SelectQuery + SelectHosts SelectQuery + SelectTimeperiods SelectQuery + SortField []string + type MaintenanceTimeperiods struct + Dayofweek int + Every int + Period int + StartTime int + TimeperiodType int + type MaintenanceType int + type NotFoundError struct + Message string + func (e *NotFoundError) Error() string + type Proxy struct + Description string + Host string + Interface ProxyInterface + ProxyAddresses types.ZBXProxyAddresses + ProxyID string + Status int + TLSAccept int + TLSConnect int + TLSIssuer string + TLSPSK string + TLSPSKIdentity string + TLSSubject string + type ProxyGetParams struct + ProxyIDs []string + SelectHosts SelectQuery + SelectInterface SelectQuery + type ProxyInterface struct + DNS string + HostID string + IP string + InterfaceID string + Port int + UseIP types.ZBXBoolean + func (t *ProxyInterface) UnmarshalJSON(in []byte) error + type Request struct + AuthToken string + JSONRPCVersion string + Method string + Params interface{} + RequestID uint64 + func NewRequest(method string, params interface{}) *Request + type Response struct + Body json.RawMessage + Error APIError + JSONRPCVersion string + RequestID int + StatusCode int + func (c *Response) Bind(v interface{}) error + func (c *Response) Err() error + type Script struct + Command string + Description string + ExecuteOn int + Name string + Scope int + ScriptID string + Type int + type ScriptExecuteRequest struct + HostID string + ScriptID string + type ScriptExecutionResponse struct + Debug interface{} + Response string + Value string + type SelectFields []string + type SelectQuery interface + type Session struct + APIVersion *types.ZBXVersion + Token string + URL string + func NewSession(url string, username string, password string) (session *Session, err error) + func (c *Session) AuthToken() string + func (c *Session) CountHosts(params HostGetParams) (int, error) + func (c *Session) CreateUserMacros(macros ...HostMacro) (hostMacroIds []string, err error) + func (c *Session) DeleteHostInterface(inter HostInterface) (err error) + func (c *Session) DeleteUserMacros(hostMacroIDs ...string) (hostMacroIds []string, err error) + func (c *Session) Do(req *Request) (resp *Response, err error) + func (c *Session) Get(method string, params interface{}, v interface{}) error + func (c *Session) GetActions(params ActionGetParams) ([]Action, error) + func (c *Session) GetAlerts(params AlertGetParams) ([]Alert, error) + func (c *Session) GetEvents(params EventGetParams) ([]Event, error) + func (c *Session) GetHistories(params HistoryGetParams) ([]History, error) + func (c *Session) GetHostInterfaces(params HostInterfaceGetParams) ([]HostInterface, error) + func (c *Session) GetHostgroups(params HostgroupGetParams) ([]Hostgroup, error) + func (c *Session) GetHosts(params HostGetParams) ([]Host, error) + func (c *Session) GetItems(params ItemGetParams) ([]Item, error) + func (c *Session) GetProxies(params ProxyGetParams) ([]Proxy, error) + func (c *Session) GetTriggers(params TriggerGetParams) ([]Trigger, error) + func (c *Session) GetUserMacro(params UserMacroGetParams) ([]HostMacro, error) + func (c *Session) GetVersion() (*types.ZBXVersion, error) + func (c *Session) ScriptExecute(req ScriptExecuteRequest) (ScriptExecutionResponse, error) + func (c *Session) UpdateHostInterface(inter HostInterface) ([]string, error) + func (c *Session) UpdateUserMacros(macros ...HostMacro) (hostMacroIds []string, err error) + func (s *Session) CreateMaintenance(params *MaintenanceCreateParams) (response MaintenanceCreateResponse, err error) + func (s *Session) GetMaintenance(params *MaintenanceGetParams) ([]Maintenance, error) + type SessionAbstractCache interface + Flush func() error + GetSession func() (*Session, error) + HasSession func() bool + SaveSession func(session *Session) error + SetSessionLifetime func(d time.Duration) + type SessionFileCache struct + func NewSessionFileCache() *SessionFileCache + func (c *SessionFileCache) Flush() error + func (c *SessionFileCache) GetSession() (*Session, error) + func (c *SessionFileCache) HasSession() bool + func (c *SessionFileCache) SaveSession(session *Session) error + func (c *SessionFileCache) SetFilePath(filePath string) *SessionFileCache + func (c *SessionFileCache) SetFilePermissions(permissions uint32) *SessionFileCache + func (c *SessionFileCache) SetSessionLifetime(d time.Duration) + type TagsEvaltype int + type Trigger struct + AlarmState int + Description string + Enabled types.ZBXBoolean + Expression string + Groups []Hostgroup + Hosts []Host + LastChange int + LastEvent *Event + Severity int + State int + Tags []TriggerTag + TriggerID string + URL string + type TriggerGetParams struct + ActiveOnly bool + ApplicationIDs []string + ExpandComment bool + ExpandDescription bool + ExpandExpression bool + Functions []string + Group string + GroupIDs []string + Host string + HostIDs []string + InheritedOnly bool + ItemIDs []string + MaintenanceOnly bool + MinSeverity int + MonitoredOnly bool + RecentProblemOnly bool + SelectDependencies SelectQuery + SelectDiscoveryRule SelectQuery + SelectFunctions SelectQuery + SelectGroups SelectQuery + SelectHosts SelectQuery + SelectItems SelectQuery + SelectLastEvent SelectQuery + SelectTags SelectQuery + SkipDependent bool + TemplateIDs []string + TemplatedOnly bool + TriggerIDs []string + WithAcknowledgedEventsOnly bool + WithLastEventUnacknowledgedOnly bool + WithUnacknowledgedEventsOnly bool + type TriggerTag struct + Name string + Value string + type UserMacroGetParams struct + GlobalMacro bool + GlobalMacroIDs []string + GroupIDs []string + HostIDs []string + HostMacroIDs []string + TemplateIDs []string + type UserMacroResponse struct + HostMacroIDs []string