Skip to content

Commit

Permalink
Release 2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Feb 5, 2024
2 parents 1b65090 + 729e568 commit 8461698
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 445 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
name: Run tests

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20.11'
go-version: '1.20.13'

- name: Ensure linux agent compiles
run: |
Expand Down
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (a *Agent) ForceKillMesh() {
}

for _, pid := range pids {
a.Logger.Debugln("Killing mesh process with pid %d", pid)
a.Logger.Debugln("Killing mesh process with pid:", pid)
if err := KillProc(int32(pid)); err != nil {
a.Logger.Debugln(err)
}
Expand Down
27 changes: 26 additions & 1 deletion agent/agent_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,12 @@ func (a *Agent) GetWMIInfo() map[string]interface{} {

// disks
block, err := ghw.Block(ghw.WithDisableWarnings())
ignore := []string{"ram", "loop"}
if err != nil {
a.Logger.Errorln("ghw.Block()", err)
} else {
for _, disk := range block.Disks {
if disk.IsRemovable || strings.Contains(disk.Name, "ram") {
if disk.IsRemovable || contains(disk.Name, ignore) {
continue
}
ret := fmt.Sprintf("%s %s %s %s %s %s", disk.Vendor, disk.Model, disk.StorageController, disk.DriveType, disk.Name, ByteCountSI(disk.SizeBytes))
Expand Down Expand Up @@ -472,6 +473,30 @@ func (a *Agent) GetWMIInfo() map[string]interface{} {
}
}

switch runtime.GOOS {
case "linux":
baseboard, err := ghw.Baseboard()
if err != nil {
a.Logger.Debugln("ghw.Baseboard()", err)
wmiInfo["serialnumber"] = "n/a"
} else {
wmiInfo["serialnumber"] = baseboard.SerialNumber
}
case "darwin":
opts := a.NewCMDOpts()
serialCmd := `ioreg -l | grep IOPlatformSerialNumber | grep -o '"IOPlatformSerialNumber" = "[^"]*"' | awk -F'"' '{print $4}'`
opts.Command = serialCmd
out := a.CmdV2(opts)
if out.Status.Error != nil {
a.Logger.Debugln("ioreg get serial number: ", out.Status.Error.Error())
wmiInfo["serialnumber"] = "n/a"
} else {
wmiInfo["serialnumber"] = removeNewlines(out.Stdout)
}
default:
wmiInfo["serialnumber"] = "n/a"
}

if len(cpus) == 0 {
wmiInfo["cpus"] = []string{makeModel}
}
Expand Down
13 changes: 13 additions & 0 deletions agent/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,19 @@ func removeWinNewLines(s string) string {
return strings.ReplaceAll(s, "\r\n", "\n")
}

func removeNewlines(s string) string {
return strings.ReplaceAll(s, "\n", "")
}

func contains(s string, substrs []string) bool {
for _, substr := range substrs {
if strings.Contains(s, substr) {
return true
}
}
return false
}

func stringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {
Expand Down
2 changes: 1 addition & 1 deletion build/rmm.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<assemblyIdentity
type="win32"
name="TacticalRMM"
version="2.6.1.0"
version="2.6.2.0"
processorArchitecture="*"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
Expand Down
2 changes: 1 addition & 1 deletion build/setup.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Tactical RMM Agent"
#define MyAppVersion "2.6.1"
#define MyAppVersion "2.6.2"
#define MyAppPublisher "AmidaWare Inc"
#define MyAppURL "https://github.com/amidaware"
#define MyAppExeName "tacticalrmm.exe"
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ go 1.20

require (
github.com/StackExchange/wmi v1.2.1
github.com/elastic/go-sysinfo v1.11.1
github.com/elastic/go-sysinfo v1.11.2
github.com/go-ole/go-ole v1.3.0
github.com/go-ping/ping v1.1.0
github.com/go-resty/resty/v2 v2.10.0
github.com/go-resty/resty/v2 v2.11.0
github.com/gonutz/w32/v2 v2.11.1
github.com/iamacarpet/go-win64api v0.0.0-20230324134531-ef6dbdd6db97
github.com/nats-io/nats.go v1.31.0
github.com/nats-io/nats.go v1.32.0
github.com/rickb777/date v1.19.1
github.com/shirou/gopsutil/v3 v3.23.10
github.com/shirou/gopsutil/v3 v3.23.12
github.com/sirupsen/logrus v1.9.3
github.com/ugorji/go/codec v1.2.11
github.com/ugorji/go/codec v1.2.12
github.com/wh1te909/go-win64api v0.0.0-20230802051600-21b24f62e846
github.com/wh1te909/trmm-shared v0.0.0-20220227075846-f9f757361139
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.16.0
)

require (
Expand All @@ -30,16 +30,16 @@ require (
github.com/fourcorelabs/wintoken v1.0.0
github.com/jaypipes/ghw v0.12.0
github.com/kardianos/service v1.2.2
github.com/spf13/viper v1.17.0
github.com/spf13/viper v1.18.2
)

require (
github.com/elastic/go-windows v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/google/cabbie v1.0.3 // indirect
github.com/google/glazier v0.0.0-20220520121753-83447cca4ea7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
Expand All @@ -48,31 +48,31 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nats-io/nkeys v0.4.6 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rickb777/plural v1.4.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/scjalliance/comshim v0.0.0-20190308082608-cf06d2532c4e // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading

0 comments on commit 8461698

Please sign in to comment.