forked from zabbix-tools/go-zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dhost.go
46 lines (43 loc) · 1.6 KB
/
dhost.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package zabbix
// Retrieve discovered hosts by discovery rule response data
type DiscoveryGetHostResponse []struct {
Dhostid string `json:"dhostid"`
Druleid string `json:"druleid"`
Dservices []struct {
Dcheckid string `json:"dcheckid"`
Dhostid string `json:"dhostid"`
DNS string `json:"dns"`
Dserviceid string `json:"dserviceid"`
IP string `json:"ip"`
Key string `json:"key_"`
Lastdown string `json:"lastdown"`
Lastup string `json:"lastup"`
Port string `json:"port"`
Status string `json:"status"`
Type string `json:"type"`
Value string `json:"value"`
} `json:"dservices"`
Lastdown string `json:"lastdown"`
Lastup string `json:"lastup"`
Status string `json:"status"`
}
type DiscoveryGetHostParamsRequest struct {
LimitSelect int64 `json:"limitSelects"`
CountOoutput bool `json:"countOutput"`
Editable bool `json:"editable"`
ExcludeSearch bool `json:"excludeSearch"`
PreserveKeys bool `json:"preservekeys"`
Dhostids []string `json:"dhostids"`
Druleids []string `json:"druleids"`
Dserviceids []string `json:"dserviceids"`
SortField []string `json:"sortfield"`
SelectDRules SelectQuery `json:"selectDRules"`
SelectDServices SelectQuery `json:"selectDServices"`
Ouput SelectQuery `json:"output"`
GetParameters
}
func (c *Session) GetDHosts(params DiscoveryGetHostParamsRequest) (DiscoveryGetHostResponse, error) {
respData := make(DiscoveryGetHostResponse, 0)
err := c.Get("dhost.get", params, &respData)
return respData, err
}