Documentation
¶
Index ¶
- Constants
- Variables
- func AddAlarm(m *Alarm) (id int64, err error)
- func AddManager(m *Manager) (id int64, err error)
- func Chanagepwd(Md *Chpwd) (err error)
- func CreateAlarmXlsx(Filedata []Alarm, cnt, start, end int64) ([]byte, error)
- func CreateHistoryXlsx(Filedata []History, v ListQueryAll, start, end int64) ([]byte, error)
- func CreateTrenXlsx(Filedata []Trend, v ListQueryAll, start, end int64) ([]byte, error)
- func Crt(Filedata []FileSystemDataALL, host, itemtype string, start, end int64) ([]byte, error)
- func DatabaseInit()
- func ExpInspect(groupname string, Insp []Insp) ([]byte, error)
- func ExportAlarm(begin, end time.Time, hosts string) ([]byte, error)
- func GetConfKey(v string) string
- func GetHistoryDataFileName(v ListQueryAll, start, end int64) ([]byte, error)
- func GetPdfImageHolder(grupinfo GraphInfo, start, end string, wg *sync.WaitGroup, ...)
- func GetTrenDataFileName(v ListQueryAll, start, end int64) ([]byte, error)
- func LoginZabbixWeb(ZabbixWeb, ZabbixUser, ZabbixPass string)
- func ModelsInit(...)
- func MsAdd(token, tenantid string, message []byte) (int64, error)
- func RemoveRepeatedElement(arr []string) (newArr []string)
- func Round(f float64, n int) float64
- func SaveImagePDF(hostids []string, start, end string) ([]byte, error)
- func TableName(str string) string
- type Alarm
- type AlarmList
- type AnalysisList
- type Application
- type ApplicationItem
- type ApplicationList
- type Auth
- type AvailableType
- type Chpwd
- type EndTrigger
- type EventTpl
- type ExpList
- type FileSystemData
- type FileSystemDataALL
- type FileSystemDataVue
- type FileSystemInfo
- type GIDList
- type GraphByteInfo
- type GraphExpQuery
- type GraphIDList
- type GraphInfo
- type GraphList
- type GraphListQuery
- type GroupHosts
- type History
- type HistoryList
- type Host
- type HostGet
- type HostGroup
- type HostGroupBYGroupID
- type HostGroupBYGroupIDList
- type HostGroupID
- type HostGroupIds
- type HostGroups
- type HostGroupsList
- type HostGroupsPlist
- type HostInterface
- type HostInterfaces
- type HostList
- type HostTree
- type HostTreeList
- type Hosts
- type HostsData
- type IndexInfo
- type InfoRes
- type Insp
- type InterfaceType
- type InternalType
- type Item
- type ItemList
- type Items
- type Itm
- type Jar
- type LastTriggers
- type ListAnalysisAlarm
- type ListExportAlarm
- type ListHosts
- type ListQuery
- type ListQueryAlarm
- type ListQueryAll
- type ListQueryNew
- type MailMessage
- type Manager
- type ManagerInfo
- type Params
- type Pie
- type Problems
- type ProblemsRes
- type SendALarm
- type SmsMessage
- type StatusType
- type Template
- type TemplateList
- type Token
- type Trend
- type TrendList
- type TriggersRes
- type WeixinMessage
Constants ¶
const ( Available AvailableType = 1 Monitored StatusType = 0 Unmonitored StatusType = 1 Agent InterfaceType = 1 SNMP InterfaceType = 2 IPMI InterfaceType = 3 JMX InterfaceType = 4 NotInternal InternalType = 0 Internal InternalType = 1 )
const aliav
Variables ¶
var (
API = &zabbix.API{}
)
var JAR = new(Jar)
JAR st
Functions ¶
func AddManager ¶
AddManager insert a new Manager into database and returns last inserted Id on success.
func CreateAlarmXlsx ¶
CreateAlarmXlsx excel table
func CreateHistoryXlsx ¶
func CreateHistoryXlsx(Filedata []History, v ListQueryAll, start, end int64) ([]byte, error)
CreateHistoryXlsx excel table
func CreateTrenXlsx ¶
func CreateTrenXlsx(Filedata []Trend, v ListQueryAll, start, end int64) ([]byte, error)
CreateTrenXlsx excel table
func Crt ¶
func Crt(Filedata []FileSystemDataALL, host, itemtype string, start, end int64) ([]byte, error)
Crt excel table
func ExpInspect ¶
ExpInspect 按组巡检报告导出
func ExportAlarm ¶
ExportAlarm export
func GetConfKey ¶ added in v1.1.2
func GetHistoryDataFileName ¶
func GetHistoryDataFileName(v ListQueryAll, start, end int64) ([]byte, error)
GetHistoryDataFileName trend data 获取详情数据并输出到excel文件,返回[]byte
func GetPdfImageHolder ¶
func GetPdfImageHolder(grupinfo GraphInfo, start, end string, wg *sync.WaitGroup, pdfHolder chan<- gopdf.ImageHolder)
GetPdfImageHolder func
func GetTrenDataFileName ¶
func GetTrenDataFileName(v ListQueryAll, start, end int64) ([]byte, error)
GetTrenDataFileName trend data 获取趋势数据并输出为[]bytes
func LoginZabbixWeb ¶ added in v1.1.2
func LoginZabbixWeb(ZabbixWeb, ZabbixUser, ZabbixPass string)
LoginZabbixWeb a
func ModelsInit ¶
func ModelsInit(zabbix_web, zabbix_user, zabbix_pass, dbtype, dbhost, dbuser, dbpass, dbname, dbport string)
ModelsInit p
func RemoveRepeatedElement ¶
RemoveRepeatedElement 数组去重
func SaveImagePDF ¶
SaveImagePDF 导出图形到PDF
Types ¶
type Alarm ¶
type Alarm struct {
ID int `orm:"column(id);auto" json:"id"`
//v2 add begin
TenantID string `orm:"column(tenant_id);size(255)" json:"tenant_id"`
HostID string `orm:"column(host_id);size(255)" json:"host_id"`
Hostname string `orm:"column(hostname);size(200)" json:"hostname"`
Host string `orm:"column(host);size(200)" json:"host"`
HostsIP string `orm:"column(host_ip);size(200)" json:"host_ip"`
TriggerID int64 `orm:"column(trigger_id);size(200)" json:"trigger_id"`
ItemID int64 `orm:"column(item_id);size(200)" json:"item_id"`
ItemName string `orm:"column(item_name);size(200)" json:"item_name"`
ItemValue string `orm:"column(item_value);size(200)" json:"item_value"`
//v2 add end
Hgroup string `orm:"column(hgroup);size(200)" json:"hgroup"`
Occurtime time.Time `orm:"column(occurtime);type(datetime)" json:"occurtime"`
Level string `orm:"column(level);size(200)" json:"level"`
Message string `orm:"column(message);size(200)" json:"message"`
Hkey string `orm:"column(hkey);size(200)" json:"hkey"`
Detail string `orm:"column(detail);size(200)" json:"detail"`
Status string `orm:"column(status);size(200)" json:"status"`
EventID int64 `orm:"column(event_id);size(200)" json:"eventid"`
}
Alarm struct
func GetAlarmByID ¶
GetAlarmByID retrieves Alarm by Id. Returns error if Id doesn't exist
type AlarmList ¶
type AlarmList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Alarm `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
AlarmList struct
type AnalysisList ¶
type AnalysisList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Level []string `json:"level"`
LevelCount []Pie `json:"level_count"`
Host []string `json:"host"`
HostCount []int `json:"host_count"`
} `json:"data"`
}
AnalysisList struct
type Application ¶
type Application struct {
Applicationid string `json:"applicationid"`
Name string `json:"name"`
Items []ApplicationItem `json:"items"`
}
Application struct
func GetApplicationByHostid ¶
func GetApplicationByHostid(hostid string) ([]Application, int64, error)
GetApplicationByHostid st
type ApplicationItem ¶
type ApplicationItem struct {
ItemID string `json:"itemid"`
Name string `json:"name"`
ValutType string `json:"value_type"`
Units string `json:"units"`
}
ApplicationItem struct
type ApplicationList ¶
type ApplicationList struct {
Code int `json:"code"`
Message string `json:"mess age"`
Data struct {
Items []Application `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
ApplicationList struct
type Auth ¶
type Auth struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Token string `json:"token"`
} `json:"data"`
}
Auth struct
type Chpwd ¶
type Chpwd struct {
Name string `json:"name"`
Oldpwd string `json:"oldpwd"`
Pwd1 string `json:"pwd1"`
Pwd2 string `json:"pwd2"`
}
Chpwd struct aa
type EndTrigger ¶
type EndTrigger struct {
Acknowledged string `json:"acknowledged"`
Hostid string `json:"hostid"`
Name string `json:"name"`
Lastchange string `json:"lastchange"`
LastEventName string `json:"lasteventname"`
Severity string `json:"severity"`
Eventid string `json:"eventid"`
Objectid string `json:"objectid"`
}
EndTrigger struct
type EventTpl ¶ added in v1.1.0
type EventTpl struct {
HostsID string `json:"host_id"`
HostHost string `json:"host_host"`
Hostname string `json:"hostname"`
HostsIP string `json:"host_ip"`
HostGroup string `json:"host_group"`
EventTime string `json:"event_time"`
Severity string `json:"severity"`
TriggerID int64 `json:"trigger_id"`
TriggerName string `json:"trigger_name"`
TriggerKey string `json:"trigger_key"`
TriggerValue string `json:"trigger_value"`
ItemID int64 `json:"item_id"`
ItemName string `json:"item_name"`
ItemValue string `json:"item_value"`
EventID int64 `json:"event_id"`
}
type ExpList ¶
type ExpList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []FileSystemDataALL `json:"items"`
MountPoint []string `json:"mountpoint"`
FileName string `json:"filename"`
} `json:"data"`
}
ExpList struct
type FileSystemData ¶
type FileSystemData struct {
MountPoint string `json:"mountpoint"`
ItemID string `json:"itemid"`
ItemName string `json:"itemname"`
ItemKey string `json:"itemkey"`
Clock string `json:"clock"`
Num string `json:"num"`
ValueMin string `json:"value_min"`
ValueAvg string `json:"value_avg"`
ValueMax string `json:"value_max"`
}
FileSystemData data
type FileSystemDataALL ¶
type FileSystemDataALL struct {
MountPoint string `json:"mountpoint"`
FileSystemDataADD []FileSystemData `json:"filesystemdata"`
}
FileSystemDataALL struct
func GetTrenDataTable ¶
func GetTrenDataTable(itd []Itm, itemkey, host, ItemType string, start, end int64) ([]FileSystemDataALL, []byte, error)
GetTrenDataTable funcitemtype 获取主机数据信息并输出到[]bytes
type FileSystemDataVue ¶
type FileSystemDataVue struct {
FileSystemDataADD []FileSystemData `json:"filesystemdata"`
}
FileSystemDataVue struct
type FileSystemInfo ¶
type FileSystemInfo struct {
MountPoint string `json:"mountpoint"`
ItemID string `json:"itemid"`
ItemName string `json:"itemname"`
ItemKey string `json:"itemkey"`
}
FileSystemInfo data
type GraphByteInfo ¶
type GraphByteInfo struct {
GraphID string `json:"graphid"`
GraphByte []byte `json:"graphbyte"`
Name string `json:"name"`
}
GraphByteInfo struct
type GraphExpQuery ¶
GraphExpQuery struc
type GraphIDList ¶
GraphIDList as
type GraphListQuery ¶
GraphListQuery struct
type GroupHosts ¶
type History ¶
type History struct {
Itemid string `json:"itemid"`
Clock string `json:"clock"`
Value string `json:"value"`
Ns string `json:"ns"`
}
History struct
func GetHistoryByItemID ¶
GetHistoryByItemID by id
func GetHistoryByItemIDNew ¶
GetHistoryByItemIDNew by id
func GetHistoryByItemIDNewP ¶
GetHistoryByItemIDNewP bg
type HistoryList ¶
type HistoryList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []History `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
HistoryList struct
type Host ¶
type Host struct {
HostID string `json:"hostid,omitempty"`
Host string `json:"host,omitempty"`
Available string `json:"available,omitempty"`
Error string `json:"error"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Groups string `json:"groups,omitempty"`
Interfaces string `json:"interfaces,omitempty"`
Template []string `json:"template,omitempty"`
}
Host struct
type HostGet ¶
type HostGet struct {
ID int `json:"id"`
Jsonrpc string `json:"jsonrpc"`
Result []struct {
Available string `json:"available,omitempty"`
Description string `json:"description"`
DisableUntil string `json:"disable_until"`
Error string `json:"error"`
ErrorsFrom string `json:"errors_from"`
Host string `json:"host"`
Hostid string `json:"hostid"`
Maintenances []interface{} `json:"maintenances"`
Name string `json:"name"`
ProxyHostid string `json:"proxy_hostid"`
SnmpAvailable string `json:"snmp_available"`
SnmpDisableUntil string `json:"snmp_disable_until"`
SnmpError string `json:"snmp_error"`
SnmpErrorsFrom string `json:"snmp_errors_from"`
Status string `json:"status"`
} `json:"result"`
}
HostGet struct
type HostGroup ¶
type HostGroup struct {
GroupID string `json:"groupid,omitempty"`
Name string `json:"name"`
Internal InternalType `json:"internal,omitempty"`
}
HostGroup struct
type HostGroupBYGroupID ¶
type HostGroupBYGroupID struct {
GroupID string `json:"groupid,omitempy"`
Name string `json:"name"`
Hosts []GroupHosts `json:"hosts"`
}
HostGroupBYGroupID struct
func GetHostsByGroupID ¶
func GetHostsByGroupID(GroupID string) ([]HostGroupBYGroupID, error)
GetHostsByGroupID func
func GetHostsInfoByGroupID ¶
func GetHostsInfoByGroupID(GroupID string) ([]HostGroupBYGroupID, error)
GetHostsInfoByGroupID func
type HostGroupBYGroupIDList ¶
type HostGroupBYGroupIDList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []HostGroupBYGroupID `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
HostGroupBYGroupIDList struct
type HostGroups ¶
type HostGroups struct {
GroupID string `json:"groupid"`
Name string `json:"name"`
Internal string `json:"internal"`
Flags string `json:"flags"`
Hosts string `json:"hosts"`
}
HostGroups struct
func GetAllHostGroups ¶
func GetAllHostGroups(page, limit, groups string) ([]HostGroups, int64, error)
GetAllHostGroups func
type HostGroupsList ¶
type HostGroupsList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []HostGroups `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
HostGroupsList struct
type HostGroupsPlist ¶
type HostGroupsPlist struct {
GroupID string `json:"groupid,omitempy"`
Name string `json:"name,omitempy"`
Internal string `json:"internal,omitempy"`
Flags string `json:"flags,omitempy"`
Hosts []Host `json:"hosts,omitempy"`
}
HostGroupsPlist list
type HostInterface ¶
type HostInterface struct {
DNS string `json:"dns"`
IP string `json:"ip"`
Main int `json:"main"`
Port string `json:"port"`
Type InterfaceType `json:"type"`
UseIP int `json:"useip"`
}
HostInterface type
type HostList ¶
type HostList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Hosts `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
HostList struct
type HostTree ¶
type HostTree struct {
GroupID string `json:"groupid"`
Name string `json:"name"`
Chrildren []struct {
HostID string `json:"hostid"`
Name string `json:"name"`
} `json:"hosts"`
}
HostTree struct
func GetAllHostGroupsList ¶
GetAllHostGroupsList func
type HostTreeList ¶
type HostTreeList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []HostTree `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
HostTreeList sst
type Hosts ¶
type Hosts struct {
HostID string `json:"hostid,omitempty"`
Host string `json:"host",omitempty`
Available string `json:"available,omitempty"`
Error string `json:"error"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Groups string `json:"groups,omitempty"`
Interfaces string `json:"interfaces,omitempty"`
Template []string `json:"template,omitempty"`
}
Hosts struct
func GetHostsByGroupIDList ¶
GetHostsByGroupIDList func
type HostsData ¶
type HostsData struct {
Hostid string `json:"hostid"`
Host string `json:"host"`
Items []struct {
History string `json:"history"`
Itemid string `json:"itemid"`
Key string `json:"key_"`
Name string `json:"name"`
State string `json:"state"`
Status string `json:"status"`
Trends string `json:"trends"`
} `json:"items"`
ParentTemplates []struct {
Name string `json:"name"`
Templateid string `json:"templateid"`
} `json:"parentTemplates"`
}
HostsData strunct
func GetHostData ¶
GetHostData func 根据hostid获取主机信息和item相关信息并返回
type IndexInfo ¶
type IndexInfo struct {
Hosts int64 `json:"hosts"`
Items int64 `json:"items"`
Triggers int64 `json:"triggers"`
Problems int64 `json:"problems"`
}
TrendRes resp IndexInfo struct
type Insp ¶
type Insp struct {
HostName string `json:"hostname"`
CPULoad float64 `json:"cpuload"`
MemPct float64 `json:"mempct"`
}
Insp a
type Item ¶
type Item struct {
Itemid string `json:"itemid"`
Type string `json:"type,omitempty"`
SnmpCommunity string `json:"snmp_community,omitempty"`
SnmpOid string `json:"snmp_oid,omitempty"`
Hostid string `json:"hostid,omitempty"`
Name string `json:"name,omitempty"`
Key string `json:"key_,omitempty"`
Delay string `json:"delay,omitempty"`
History string `json:"history,omitempty"`
Trends string `json:"trends,omitempty"`
Lastvalue string `json:"lastvalue,omitempty"`
Lastclock string `json:"lastclock,omitempty"`
Prevvalue string `json:"prevvalue,omitempty"`
State string `json:"state,omitempty"`
Status string `json:"status,omitempty"`
ValueType string `json:"value_type,omitempty"`
TrapperHosts string `json:"trapper_hosts,omitempty"`
Units string `json:"units,omitempty"`
Snmpv3Securityname string `json:"snmpv3_securityname,omitempty"`
Snmpv3Securitylevel string `json:"snmpv3_securitylevel,omitempty"`
Snmpv3Authpassphrase string `json:"snmpv3_authpassphrase,omitempty"`
Snmpv3Privpassphrase string `json:"snmpv3_privpassphrase,omitempty"`
Snmpv3Authprotocol string `json:"snmpv3_authprotocol,omitempty"`
Snmpv3Privprotocol string `json:"snmpv3_privprotocol,omitempty"`
Snmpv3Contextname string `json:"snmpv3_contextname,omitempty"`
Error string `json:"error,omitempty"`
Lastlogsize string `json:"lastlogsize,omitempty"`
Logtimefmt string `json:"logtimefmt,omitempty"`
Templateid string `json:"templateid,omitempty"`
Valuemapid string `json:"valuemapid,omitempty"`
Params string `json:"params,omitempty"`
IpmiSensor string `json:"ipmi_sensor,omitempty"`
Authtype string `json:"authtype,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Publickey string `json:"publickey,omitempty"`
Privatekey string `json:"privatekey,omitempty"`
Mtime string `json:"mtime,omitempty"`
Lastns string `json:"lastns,omitempty"`
Flags string `json:"flags,omitempty"`
Interfaceid string `json:"interfaceid,omitempty"`
Port string `json:"port,omitempty"`
Description string `json:"description,omitempty"`
InventoryLink string `json:"inventory_link,omitempty"`
Lifetime string `json:"lifetime,omitempty"`
Evaltype string `json:"evaltype,omitempty"`
JmxEndpoint string `json:"jmx_endpoint,omitempty"`
MasterItemid string `json:"master_itemid,omitempty"`
Timeout string `json:"timeout,omitempty"`
URL string `json:"url,omitempty"`
QueryFields []interface{} `json:"query_fields,omitempty"`
Posts string `json:"posts,omitempty"`
StatusCodes string `json:"status_codes,omitempty"`
FollowRedirects string `json:"follow_redirects,omitempty"`
PostType string `json:"post_type,omitempty"`
HTTPProxy string `json:"http_proxy,omitempty"`
Headers []interface{} `json:"headers,omitempty"`
RetrieveMode string `json:"retrieve_mode,omitempty"`
RequestMethod string `json:"request_method,omitempty"`
OutputFormat string `json:"output_format,omitempty"`
SslCertFile string `json:"ssl_cert_file,omitempty"`
SslKeyFile string `json:"ssl_key_file,omitempty"`
SslKeyPassword string `json:"ssl_key_password,omitempty"`
VerifyPeer string `json:"verify_peer,omitempty"`
VerifyHost string `json:"verify_host,omitempty"`
AllowTraps string `json:"allow_traps,omitempty"`
}
Item struct
func GetAllItemByHostID ¶
GetAllItemByHostID func
func GetItemByKey ¶
GetItemByKey bye key
type ItemList ¶
type ItemList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Item `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
ItemList struct
type Items ¶
type Items struct {
Itemid string `json:"itemid"`
Name string `json:"name"`
Key string `json:"key_"`
}
item get all
type Itm ¶
type Itm struct {
Itemids string `json:"itemids"`
ItemName string `json:"itemname"`
ItemKey string `json:"itemkey"`
Status string `json:"status"`
State string `json:"state"`
}
Itm struct
type LastTriggers ¶
type LastTriggers struct {
Comments string `json:"comments"`
CorrelationMode string `json:"correlation_mode"`
CorrelationTag string `json:"correlation_tag"`
Description string `json:"description"`
Details string `json:"details"`
Error string `json:"error"`
Expression string `json:"expression"`
Flags string `json:"flags"`
Hosts []struct {
Hostid string `json:"hostid"`
Name string `json:"name"`
} `json:"hosts"`
LastEvent struct {
Acknowledged string `json:"acknowledged"`
Clock string `json:"clock"`
Eventid string `json:"eventid"`
Name string `json:"name"`
Ns string `json:"ns"`
Object string `json:"object"`
Objectid string `json:"objectid"`
Severity string `json:"severity"`
Source string `json:"source"`
Value string `json:"value"`
} `json:"lastEvent"`
Lastchange string `json:"lastchange"`
ManualClose string `json:"manual_close"`
Priority string `json:"priority"`
RecoveryExpression string `json:"recovery_expression"`
RecoveryMode string `json:"recovery_mode"`
State string `json:"state"`
Status string `json:"status"`
Templateid string `json:"templateid"`
Triggerid string `json:"triggerid"`
Type string `json:"type"`
URL string `json:"url"`
Value string `json:"value"`
}
LastTriggers struct
type ListAnalysisAlarm ¶
ListAnalysisAlarm qu
type ListExportAlarm ¶
type ListExportAlarm struct {
Begin string `json:"begin"`
End string `json:"end"`
Hosts string `json:"hosts"`
}
ListExportAlarm struct
type ListHosts ¶
type ListHosts []struct {
AutoCompress string `json:"auto_compress"`
Available string `json:"available"`
Description string `json:"description"`
DisableUntil string `json:"disable_until"`
Error string `json:"error"`
ErrorsFrom string `json:"errors_from"`
Flags string `json:"flags"`
Groups []struct {
Flags string `json:"flags"`
Groupid string `json:"groupid"`
Internal string `json:"internal"`
Name string `json:"name"`
} `json:"groups"`
Host string `json:"host"`
Hostid string `json:"hostid"`
Interfaces []struct {
Bulk string `json:"bulk"`
DNS string `json:"dns"`
Hostid string `json:"hostid"`
Interfaceid string `json:"interfaceid"`
IP string `json:"ip"`
Main string `json:"main"`
Port string `json:"port"`
Type string `json:"type"`
Useip string `json:"useip"`
} `json:"interfaces"`
IpmiAuthtype string `json:"ipmi_authtype"`
IpmiAvailable string `json:"ipmi_available"`
IpmiDisableUntil string `json:"ipmi_disable_until"`
IpmiError string `json:"ipmi_error"`
IpmiErrorsFrom string `json:"ipmi_errors_from"`
IpmiPassword string `json:"ipmi_password"`
IpmiPrivilege string `json:"ipmi_privilege"`
IpmiUsername string `json:"ipmi_username"`
JmxAvailable string `json:"jmx_available"`
JmxDisableUntil string `json:"jmx_disable_until"`
JmxError string `json:"jmx_error"`
JmxErrorsFrom string `json:"jmx_errors_from"`
Lastaccess string `json:"lastaccess"`
MaintenanceFrom string `json:"maintenance_from"`
MaintenanceStatus string `json:"maintenance_status"`
MaintenanceType string `json:"maintenance_type"`
Maintenanceid string `json:"maintenanceid"`
Name string `json:"name"`
ParentTemplates []struct {
Name string `json:"name"`
Templateid string `json:"templateid"`
} `json:"parentTemplates"`
ProxyAddress string `json:"proxy_address"`
ProxyHostid string `json:"proxy_hostid"`
SnmpAvailable string `json:"snmp_available"`
SnmpDisableUntil string `json:"snmp_disable_until"`
SnmpError string `json:"snmp_error"`
SnmpErrorsFrom string `json:"snmp_errors_from"`
Status string `json:"status"`
Templateid string `json:"templateid"`
TLSAccept string `json:"tls_accept"`
TLSConnect string `json:"tls_connect"`
TLSIssuer string `json:"tls_issuer"`
TLSPsk string `json:"tls_psk"`
TLSPskIdentity string `json:"tls_psk_identity"`
TLSSubject string `json:"tls_subject"`
}
ListHosts struct
type ListQuery ¶
type ListQuery struct {
HostID string `json:"hostid"`
ItemType string `json:"itemtype"`
Period []string `json:"period"`
}
ListQuery struct
type ListQueryAlarm ¶
ListQueryAlarm query
type ListQueryAll ¶
type ListQueryAll struct {
Host Host `json:"host"`
Item Item `json:"item"`
Period []string `json:"period"`
}
ListQueryAll struct
type ListQueryNew ¶
type ListQueryNew struct {
HostID string `json:"hostid"`
Item Item `json:"item"`
Period []string `json:"period"`
}
ListQueryNew struct
type MailMessage ¶
type MailMessage struct {
ID int `orm:"column(id);auto" json:"id"`
Host string `orm:"column(host);size(255)" json:"host"`
Hgroup string `orm:"column(hgroup);size(255)" json:"hgroup"`
Occurtime time.Time `orm:"column(occurtime);type(datetime)" json:"occurtime"`
Level string `orm:"column(level);size(255)" json:"level"`
Message string `orm:"column(message);size(255)" json:"message"`
Hkey string `orm:"column(hkey);size(255)" json:"hkey"`
Detail string `orm:"column(detail);size(255)" json:"detail"`
Status string `orm:"column(status);size(255)" json:"status"`
EventID string `orm:"column(event_id);size(255)" json:"eventid"`
Mail string `orm:"column(event_id);size(255)" json:"mail"`
}
MailMessage struct
type Manager ¶
type Manager struct {
ID int `orm:"column(id);auto" json:"id"`
Username string `orm:"column(username);size(255)" json:"username"`
Password string `orm:"column(password);size(255)" json:"password"`
Avatar string `orm:"column(avatar);size(255)" json:"avatar"`
Status int64 `orm:"column(status)" json:"status"`
Role string `orm:"column(role);size(255)" json:"role"`
Created time.Time `orm:"column(created);type(datetime)" json:"created"`
}
Manager struct
func GetManagerByID ¶
GetManagerByID retrieves Manager by Id. Returns error if Id doesn't exist
func GetManagerByName ¶
GetManagerByName retrieves User by Username. Returns error if Id doesn't exist
type ManagerInfo ¶
type ManagerInfo struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
ID int `json:"id"`
Username string `json:"username"`
Avatar string `json:"avatar"`
Status int64 `json:"status"`
Role string `json:"role"`
Created time.Time `json:"created"`
} `json:"data"`
}
ManagerInfo struct
type Problems ¶
type Problems struct {
Acknowledged string `json:"acknowledged"`
Clock string `json:"clock"`
Correlationid string `json:"correlationid"`
Eventid string `json:"eventid"`
Name string `json:"name"`
Objectid string `json:"objectid"`
Severity string `json:"severity"`
}
Problems struct
type ProblemsRes ¶
type ProblemsRes struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Problems `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
ProblemsRes rest
type SendALarm ¶
type SendALarm struct {
ID int `orm:"column(id);auto" json:"id"`
Host string `orm:"column(host);size(255)" json:"host"`
Hgroup string `orm:"column(hgroup);size(255)" json:"hgroup"`
Occurtime time.Time `orm:"column(occurtime);type(datetime)" json:"occurtime"`
Level string `orm:"column(level);size(255)" json:"level"`
Message string `orm:"column(message);size(255)" json:"message"`
Hkey string `orm:"column(hkey);size(255)" json:"hkey"`
Detail string `orm:"column(detail);size(255)" json:"detail"`
Status string `orm:"column(status);size(255)" json:"status"`
EventID string `orm:"column(event_id);size(255)" json:"eventid"`
Mail []string `orm:"column(event_id);size(255)" json:"mail"`
Weixin []string `orm:"column(event_id);size(255)" json:"weixin"`
Sms []string `orm:"column(event_id);size(255)" json:"sms"`
}
SendALarm struct
type SmsMessage ¶
type SmsMessage struct {
ID int `orm:"column(id);auto" json:"id"`
Host string `orm:"column(host);size(255)" json:"host"`
Hgroup string `orm:"column(hgroup);size(255)" json:"hgroup"`
Occurtime time.Time `orm:"column(occurtime);type(datetime)" json:"occurtime"`
Level string `orm:"column(level);size(255)" json:"level"`
Message string `orm:"column(message);size(255)" json:"message"`
Hkey string `orm:"column(hkey);size(255)" json:"hkey"`
Detail string `orm:"column(detail);size(255)" json:"detail"`
Status string `orm:"column(status);size(255)" json:"status"`
EventID string `orm:"column(event_id);size(255)" json:"eventid"`
Sms string `orm:"column(event_id);size(255)" json:"sms"`
}
SmsMessage struct
type Template ¶
type Template struct {
Host string `json:"host"`
Templateid string `json:"templateid"`
Name string `json:"name"`
Hosts []struct {
Host string `json:"host"`
Name string `json:"name"`
HostID string `json:"hostid"`
} `json:"hosts"`
Applications string `json:"applications"`
Triggers string `json:"triggers"`
Items string `json:"items"`
Graphs string `json:"graphs"`
Screens string `json:"screens"`
Discoveries string `json:"discoveries"`
}
Template struct a
type TemplateList ¶
type TemplateList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Template `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
TemplateList struct
type Trend ¶
type Trend struct {
Itemid string `json:"itemid"`
Clock string `json:"clock"`
Num string `json:"num"`
ValueMin string `json:"value_min"`
ValueAvg string `json:"value_avg"`
ValueMax string `json:"value_max"`
}
Trend struct
func GetTrendByItemID ¶
GetTrendByItemID by itemid limit
func GetTrendData ¶
GetTrendData by itemid limit
type TrendList ¶
type TrendList struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []Trend `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
TrendList struct
type TriggersRes ¶
type TriggersRes struct {
Code int `json:"code"`
Message string `json:"message"`
Data struct {
Items []EndTrigger `json:"items"`
Total int64 `json:"total"`
} `json:"data"`
}
TriggersRes rest
type WeixinMessage ¶
type WeixinMessage struct {
ID int `orm:"column(id);auto" json:"id"`
Host string `orm:"column(host);size(255)" json:"host"`
Hgroup string `orm:"column(hgroup);size(255)" json:"hgroup"`
Occurtime time.Time `orm:"column(occurtime);type(datetime)" json:"occurtime"`
Level string `orm:"column(level);size(255)" json:"level"`
Message string `orm:"column(message);size(255)" json:"message"`
Hkey string `orm:"column(hkey);size(255)" json:"hkey"`
Detail string `orm:"column(detail);size(255)" json:"detail"`
Status string `orm:"column(status);size(255)" json:"status"`
EventID string `orm:"column(event_id);size(255)" json:"eventid"`
Weixin string `orm:"column(event_id);size(255)" json:"weixin"`
}
WeixinMessage struct
Source Files
¶
- alarm.go
- application.go
- application_mod.go
- base.go
- before.go
- export_table.go
- export_table_mod.go
- graph.go
- graph_mod.go
- history.go
- history_mod.go
- host.go
- host_group.go
- host_group_mod.go
- host_mod.go
- images.go
- index.go
- index_mod.go
- inspect.go
- item.go
- item_mod.go
- manager.go
- problem.go
- session.go
- template.go
- template_mod.go
- trend.go
- trend_mod.go
- trigger.go
- xlsx.go