mirror of https://github.com/wh1te909/rmmagent.git
add graphics info
This commit is contained in:
parent
aa44cb2dc8
commit
1b0faff813
|
@ -476,6 +476,34 @@ func GetWin32_BaseBoard() ([]interface{}, error) {
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetWin32_VideoController() ([]interface{}, error) {
|
||||||
|
var dst []rmm.Win32_VideoController
|
||||||
|
ret := make([]interface{}, 0)
|
||||||
|
|
||||||
|
q := wmi.CreateQuery(&dst, "")
|
||||||
|
err := wmi.Query(q, &dst)
|
||||||
|
if err != nil {
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, val := range dst {
|
||||||
|
b, err := json.Marshal(val)
|
||||||
|
if err != nil {
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
// this creates an extra unneeded array but keeping for now
|
||||||
|
// for backwards compatibility with the python agent
|
||||||
|
tmp := make([]interface{}, 0)
|
||||||
|
var un map[string]interface{}
|
||||||
|
if err := json.Unmarshal(b, &un); err != nil {
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
tmp = append(tmp, un)
|
||||||
|
ret = append(ret, tmp)
|
||||||
|
}
|
||||||
|
return ret, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (a *WindowsAgent) GetWMI() {
|
func (a *WindowsAgent) GetWMI() {
|
||||||
wmiInfo := make(map[string]interface{})
|
wmiInfo := make(map[string]interface{})
|
||||||
|
|
||||||
|
@ -539,6 +567,11 @@ func (a *WindowsAgent) GetWMI() {
|
||||||
a.Logger.Debugln(err)
|
a.Logger.Debugln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
graphics, err := GetWin32_VideoController()
|
||||||
|
if err != nil {
|
||||||
|
a.Logger.Debugln(err)
|
||||||
|
}
|
||||||
|
|
||||||
wmiInfo["comp_sys_prod"] = compSysProd
|
wmiInfo["comp_sys_prod"] = compSysProd
|
||||||
wmiInfo["comp_sys"] = compSys
|
wmiInfo["comp_sys"] = compSys
|
||||||
wmiInfo["network_config"] = netAdaptConfig
|
wmiInfo["network_config"] = netAdaptConfig
|
||||||
|
@ -551,6 +584,7 @@ func (a *WindowsAgent) GetWMI() {
|
||||||
wmiInfo["desktop_monitor"] = desktopMon
|
wmiInfo["desktop_monitor"] = desktopMon
|
||||||
wmiInfo["cpu"] = cpu
|
wmiInfo["cpu"] = cpu
|
||||||
wmiInfo["usb"] = usb
|
wmiInfo["usb"] = usb
|
||||||
|
wmiInfo["graphics"] = graphics
|
||||||
|
|
||||||
payload := map[string]interface{}{"agent_id": a.AgentID, "sysinfo": wmiInfo}
|
payload := map[string]interface{}{"agent_id": a.AgentID, "sysinfo": wmiInfo}
|
||||||
|
|
||||||
|
|
|
@ -854,3 +854,31 @@ type Win32_USBController struct {
|
||||||
SystemName string
|
SystemName string
|
||||||
TimeOfLastReset time.Time
|
TimeOfLastReset time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Win32_VideoController struct {
|
||||||
|
AcceleratorCapabilities []string
|
||||||
|
AdapterCompatibility string
|
||||||
|
AdapterDACType string
|
||||||
|
AdapterRAM uint32
|
||||||
|
Availability uint16
|
||||||
|
CapabilityDescriptions []string
|
||||||
|
Caption string
|
||||||
|
CurrentRefreshRate uint32
|
||||||
|
CurrentVerticalResolution uint32
|
||||||
|
Description string
|
||||||
|
DeviceID string
|
||||||
|
DriverDate time.Time
|
||||||
|
DriverVersion string
|
||||||
|
InstallDate time.Time
|
||||||
|
InstalledDisplayDrivers string
|
||||||
|
MaxMemorySupported uint32
|
||||||
|
MaxRefreshRate uint32
|
||||||
|
MinRefreshRate uint32
|
||||||
|
Name string
|
||||||
|
Status string
|
||||||
|
SystemCreationClassName string
|
||||||
|
SystemName string
|
||||||
|
TimeOfLastReset time.Time
|
||||||
|
VideoModeDescription string
|
||||||
|
VideoProcessor string
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue