gonextcloud/monitoring.go

73 lines
2.6 KiB
Go

package gonextcloud
// System contains the operating system statistics
type System struct {
Version string `json:"version"`
Theme string `json:"theme"`
EnableAvatars string `json:"enable_avatars"`
EnablePreviews string `json:"enable_previews"`
MemcacheLocal string `json:"memcache.local"`
MemcacheDistributed string `json:"memcache.distributed"`
FilelockingEnabled string `json:"filelocking.enabled"`
MemcacheLocking string `json:"memcache.locking"`
Debug string `json:"debug"`
Freespace int64 `json:"freespace"`
Cpuload []float32 `json:"cpuload"`
MemTotal int `json:"mem_total"`
MemFree int `json:"mem_free"`
SwapTotal int `json:"swap_total"`
SwapFree int `json:"swap_free"`
}
// Monitoring contains the nextcloud monitoring statistics
type Monitoring struct {
// Nextcloud Statistics
Nextcloud struct {
System System `json:"system"`
Storage Storage `json:"storage"`
Shares struct {
NumShares int `json:"num_shares"`
NumSharesUser int `json:"num_shares_user"`
NumSharesGroups int `json:"num_shares_groups"`
NumSharesLink int `json:"num_shares_link"`
NumSharesLinkNoPassword int `json:"num_shares_link_no_password"`
NumFedSharesSent int `json:"num_fed_shares_sent"`
NumFedSharesReceived int `json:"num_fed_shares_received"`
} `json:"shares"`
} `json:"nextcloud"`
// Server statistics
Server struct {
Webserver string `json:"webserver"`
Php struct {
Version string `json:"version"`
MemoryLimit int `json:"memory_limit"`
MaxExecutionTime int `json:"max_execution_time"`
UploadMaxFilesize int `json:"upload_max_filesize"`
} `json:"php"`
Database struct {
Type string `json:"type"`
Version string `json:"version"`
Size int `json:"size"`
} `json:"database"`
} `json:"server"`
// Active users statistics
ActiveUsers ActiveUsers `json:"activeUsers"`
}
// ActiveUsers contains the active users statistics
type ActiveUsers struct {
Last5Minutes int `json:"last5minutes"`
Last1Hour int `json:"last1hour"`
Last24Hours int `json:"last24hours"`
}
// Storage contains the storage statistics
type Storage struct {
NumUsers int `json:"num_users"`
NumFiles int `json:"num_files"`
NumStorages int `json:"num_storages"`
NumStoragesLocal int `json:"num_storages_local"`
NumStoragesHome int `json:"num_storages_home"`
NumStoragesOther int `json:"num_storages_other"`
}