Skip to content

Commit f7c87d8

Browse files
thokra-navsechmann
andcommitted
Add external device id to DeviceEvent
Co-authored-by: Vegar Sechmann Molvig <[email protected]>
1 parent 8125cd1 commit f7c87d8

4 files changed

+35
-14
lines changed

pkg/kolide/check.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package kolide
22

33
import (
4+
"fmt"
45
"strings"
56
"time"
67

@@ -121,10 +122,11 @@ func (device *Device) Health() (pb.Health, string) {
121122
func (device *Device) Event() *pb.DeviceEvent {
122123
health, msg := device.Health()
123124
return &pb.DeviceEvent{
124-
Timestamp: timestamppb.Now(),
125-
Serial: device.Serial,
126-
Platform: device.Platform,
127-
State: health,
128-
Message: msg,
125+
Timestamp: timestamppb.Now(),
126+
Serial: device.Serial,
127+
Platform: device.Platform,
128+
State: health,
129+
Message: msg,
130+
ExternalID: fmt.Sprint(device.Id),
129131
}
130132
}

pkg/pb/kolide-event-handler.pb.go

+17-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/kolide-event-handler.proto

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ message DeviceEvent {
2828
string platform = 3;
2929
Health state = 4;
3030
string message = 5;
31-
}
31+
string externalID = 6;
32+
}

pkg/pb/kolide-event-handler_grpc.pb.go

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)