-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent.go
155 lines (137 loc) · 6.36 KB
/
agent.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package nats
import "time"
type Computer struct {
Manufacturer string `json:"manufacturer,omitempty"`
Model string `json:"model,omitempty"`
Serial string `json:"serial,omitempty"`
Processor string `json:"processor,omitempty"`
ProcessorArch string `json:"processor_arch,omitempty"`
ProcessorCores int64 `json:"processor_cores,omitempty"`
Memory uint64 `json:"memory,omitempty"`
}
type Antivirus struct {
Name string `json:"name,omitempty"`
IsActive bool `json:"is_active,omitempty"`
IsUpdated bool `json:"is_updated,omitempty"`
}
type OperatingSystem struct {
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
InstallDate time.Time `json:"install_date,omitempty"`
Edition string `json:"edition,omitempty"`
Arch string `json:"arch,omitempty"`
Username string `json:"username,omitempty"`
LastBootUpTime time.Time `json:"last_bootup_time,omitempty"`
}
type LogicalDisk struct {
Label string `json:"label,omitempty"`
Usage int8 `json:"usage,omitempty"`
Filesystem string `json:"filesystem,omitempty"`
SizeInUnits string `json:"size_in_units,omitempty"`
RemainingSpaceInUnits string `json:"remaining_space_in_units,omitempty"`
VolumeName string `json:"volume_name,omitempty"`
BitLockerStatus string `json:"bitlocker_status,omitempty"`
}
type Monitor struct {
Manufacturer string `json:"manufacturer,omitempty"`
Model string `json:"model,omitempty"`
Serial string `json:"serial,omitempty"`
}
type Printer struct {
Name string `json:"name,omitempty"`
Port string `json:"port,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
IsNetwork bool `json:"is_network,omitempty"`
}
type Share struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Path string `json:"path,omitempty"`
}
type SystemUpdate struct {
Status string `json:"status,omitempty"`
LastInstall time.Time `json:"last_install,omitempty"`
LastSearch time.Time `json:"last_search,omitempty"`
PendingUpdates bool `json:"pending_updates,omitempty"`
}
type NetworkAdapter struct {
Name string `json:"name,omitempty"`
MACAddress string `json:"mac_address,omitempty"`
Addresses string `json:"addresses,omitempty"`
Subnet string `json:"subnet,omitempty"`
DefaultGateway string `json:"default_gateway,omitempty"`
DNSServers string `json:"dns_servers,omitempty"`
DNSDomain string `json:"dns_domain,omitempty"`
DHCPEnabled bool `json:"dhcp_enabled,omitempty"`
DHCPLeaseObtained time.Time `json:"dhcp_lease_obtained,omitempty"`
DHCPLeaseExpired time.Time `json:"dhcp_lease_expired,omitempty"`
Speed string `json:"speed,omitempty"`
}
type Application struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
InstallDate string `json:"install_date,omitempty"`
Publisher string `json:"publisher,omitempty"`
}
type Update struct {
Title string `json:"title,omitempty"`
Date time.Time `json:"date,omitempty"`
SupportURL string `json:"support_url,omitempty"`
}
type LoggedOnUser struct {
Name string `json:"name,omitempty"`
LastLogon time.Time `json:"last_logon,omitempty"`
}
type AgentReport struct {
AgentID string `json:"id,omitempty"`
OS string `json:"os,omitempty"`
Hostname string `json:"hostname,omitempty"`
Release Release `json:"release,omitempty"`
ExecutionTime time.Time `json:"execution_time,omitempty"`
IP string `json:"ip,omitempty"`
MACAddress string `json:"mac,omitempty"`
SFTPPort string `json:"sftp_port,omitempty"`
VNCProxyPort string `json:"vnc_proxy_port,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Computer Computer `json:"computer,omitempty"`
Antivirus Antivirus `json:"antivirus,omitempty"`
OperatingSystem OperatingSystem `json:"operatingsystem,omitempty"`
LogicalDisks []LogicalDisk `json:"logicaldisks,omitempty"`
Monitors []Monitor `json:"monitors,omitempty"`
Printers []Printer `json:"printers,omitempty"`
Shares []Share `json:"shares,omitempty"`
SystemUpdate SystemUpdate `json:"systemupdate,omitempty"`
NetworkAdapters []NetworkAdapter `json:"networkadapters,omitempty"`
Applications []Application `json:"apps,omitempty"`
LoggedOnUsers []LoggedOnUser `json:"loggedonusers,omitempty"`
SupportedVNCServer string `json:"vnc,omitempty"`
Updates []Update `json:"updates,omitempty"`
LastUpdateTaskExecutionTime time.Time `json:"last_update_task_execution_time,omitempty"`
LastUpdateTaskStatus string `json:"last_update_task_status,omitempty"`
LastUpdateTaskResult string `json:"last_update_task_result,omitempty"`
CertificateReady bool `json:"certificate_ready,omitempty"`
RestartRequired bool `json:"restart_required,omitempty"`
}
type Config struct {
Ok bool `json:"ok,omitempty"`
AgentFrequency int `json:"agent_frequency,omitempty"`
}
type Release struct {
Version string `json:"version,omitempty"`
Channel string `json:"channel,omitempty"`
Summary string `json:"summary,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
FileURL string `json:"file_url,omitempty"`
Checksum string `json:"checksum,omitempty"`
IsCritical bool `json:"is_critical,omitempty"`
ReleaseDate time.Time `json:"release_date,omitempty"`
Arch string `json:"arch,omitempty"`
Os string `json:"os,omitempty"`
}
type VNCConnection struct {
PIN string `json:"pin,omitempty"`
NotifyUser bool `json:"notify_user,omitempty"`
}
type RebootOrRestart struct {
Date time.Time `json:"date,omitempty"`
}