Skip to content

Instantly share code, notes, and snippets.

@xriu
Last active May 29, 2016 19:34
Show Gist options
  • Save xriu/33322f5b88f9ca2d6602078ed7251636 to your computer and use it in GitHub Desktop.
Save xriu/33322f5b88f9ca2d6602078ed7251636 to your computer and use it in GitHub Desktop.
monit_struct.go
package monit
type Monit struct {
Monit struct {
Platform struct {
CPU string `json:"cpu"`
Machine string `json:"machine"`
Memory string `json:"memory"`
Name string `json:"name"`
Release string `json:"release"`
Swap string `json:"swap"`
Version string `json:"version"`
} `json:"platform"`
Server struct {
Controlfile string `json:"controlfile"`
Credentials struct {
Password string `json:"password"`
Username string `json:"username"`
} `json:"credentials"`
Httpd struct {
Address string `json:"address"`
Port string `json:"port"`
Ssl string `json:"ssl"`
} `json:"httpd"`
ID string `json:"id"`
Incarnation string `json:"incarnation"`
Localhostname string `json:"localhostname"`
Poll string `json:"poll"`
Startdelay string `json:"startdelay"`
Uptime string `json:"uptime"`
Version string `json:"version"`
} `json:"server"`
Service []struct {
Type string `json:"-type"`
Children string `json:"children,omitempty"`
CollectedSec string `json:"collected_sec"`
CollectedUsec string `json:"collected_usec"`
CPU struct {
Percent string `json:"percent"`
Percenttotal string `json:"percenttotal"`
} `json:"cpu,omitempty"`
Euid string `json:"euid,omitempty"`
Gid string `json:"gid,omitempty"`
Memory struct {
Kilobyte string `json:"kilobyte"`
Kilobytetotal string `json:"kilobytetotal"`
Percent string `json:"percent"`
Percenttotal string `json:"percenttotal"`
} `json:"memory,omitempty"`
Monitor string `json:"monitor"`
Monitormode string `json:"monitormode"`
Name string `json:"name"`
Pendingaction string `json:"pendingaction"`
Pid string `json:"pid,omitempty"`
Port struct {
Hostname string `json:"hostname"`
Portnumber string `json:"portnumber"`
Protocol string `json:"protocol"`
Request string `json:"request"`
Responsetime string `json:"responsetime"`
Type string `json:"type"`
} `json:"port,omitempty"`
Ppid string `json:"ppid,omitempty"`
Status string `json:"status"`
StatusHint string `json:"status_hint"`
Threads string `json:"threads,omitempty"`
UID string `json:"uid,omitempty"`
Uptime string `json:"uptime,omitempty"`
Every struct {
Counter string `json:"counter"`
Number string `json:"number"`
Type string `json:"type"`
} `json:"every,omitempty"`
Program struct {
Output string `json:"output"`
Started string `json:"started"`
Status string `json:"status"`
} `json:"program,omitempty"`
Mode string `json:"mode,omitempty"`
Size string `json:"size,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Link struct {
Download struct {
Bytes struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"bytes"`
Errors struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"errors"`
Packets struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"packets"`
} `json:"download"`
Duplex string `json:"duplex"`
Speed string `json:"speed"`
State string `json:"state"`
Upload struct {
Bytes struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"bytes"`
Errors struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"errors"`
Packets struct {
Now string `json:"now"`
Total string `json:"total"`
} `json:"packets"`
} `json:"upload"`
} `json:"link,omitempty"`
System struct {
CPU struct {
System string `json:"system"`
User string `json:"user"`
Wait string `json:"wait"`
} `json:"cpu"`
Load struct {
Avg01 string `json:"avg01"`
Avg05 string `json:"avg05"`
Avg15 string `json:"avg15"`
} `json:"load"`
Memory struct {
Kilobyte string `json:"kilobyte"`
Percent string `json:"percent"`
} `json:"memory"`
Swap struct {
Kilobyte string `json:"kilobyte"`
Percent string `json:"percent"`
} `json:"swap"`
} `json:"system,omitempty"`
Block struct {
Percent string `json:"percent"`
Total string `json:"total"`
Usage string `json:"usage"`
} `json:"block,omitempty"`
Flags string `json:"flags,omitempty"`
Inode struct {
Percent string `json:"percent"`
Total string `json:"total"`
Usage string `json:"usage"`
} `json:"inode,omitempty"`
} `json:"service"`
} `json:"monit"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment