File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,17 @@ func Collect(ts time.Time, c config.Configuration) error {
69
69
// Get all signalilo services
70
70
icinga := c .GetIcingaClient ()
71
71
hostname := c .GetConfig ().HostName
72
- services , err := icinga .ListServices (fmt .Sprintf ("host=%v" , hostname ))
72
+ services , err := icinga .ListServices (icinga2.QueryFilter {
73
+ Filter : fmt .Sprintf (`match("%v", service.host_name)` , hostname ),
74
+ })
73
75
if err != nil {
74
76
l .Errorf (fmt .Sprintf ("[Collect] Error while listing services: %v" , err ))
75
77
return err
76
78
}
77
79
l .V (2 ).Infof ("[Collect] Found %v services with host = %v" , len (services ), hostname )
78
- downtimes , err := icinga .ListDowntimes (fmt .Sprintf ("host=%v" , hostname ))
80
+ downtimes , err := icinga .ListDowntimes (icinga2.QueryFilter {
81
+ Filter : fmt .Sprintf (`match("%v", downtime.host_name)` , hostname ),
82
+ })
79
83
if err != nil {
80
84
l .Errorf (fmt .Sprintf ("[Collect] Error while listing downtimes: %v" , err ))
81
85
return err
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ require (
8
8
github.com/prometheus/alertmanager v0.21.0
9
9
github.com/sirupsen/logrus v1.8.0
10
10
github.com/stretchr/testify v1.7.0
11
- github.com/vshn/go-icinga2-client v0.0.12
11
+ github.com/vshn/go-icinga2-client v0.0.13
12
12
gopkg.in/alecthomas/kingpin.v2 v2.2.6
13
13
)
Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H
414
414
github.com/stretchr/testify v1.5.1 /go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA =
415
415
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0 =
416
416
github.com/stretchr/testify v1.6.1 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
417
+ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY =
417
418
github.com/stretchr/testify v1.7.0 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
418
419
github.com/tidwall/pretty v1.0.0 /go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk =
419
420
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 /go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U =
@@ -424,6 +425,8 @@ github.com/vshn/go-icinga2-client v0.0.11 h1:R9AhqestE+7ct3xMvbHhup1RLP86X74Qqzh
424
425
github.com/vshn/go-icinga2-client v0.0.11 /go.mod h1:T6r6HQ22NZsSUI/u5ThOlPsQrtbnJIImZTPAvEOSCdI =
425
426
github.com/vshn/go-icinga2-client v0.0.12 h1:HCNgId5XjUeahhe0+K3YMQ6RJi5nrKeR9b9K7l70VVk =
426
427
github.com/vshn/go-icinga2-client v0.0.12 /go.mod h1:T6r6HQ22NZsSUI/u5ThOlPsQrtbnJIImZTPAvEOSCdI =
428
+ github.com/vshn/go-icinga2-client v0.0.13 h1:zX0xceD5zyqOojZpPfNWyiqXnMAjQpc7fgfekR6u2ts =
429
+ github.com/vshn/go-icinga2-client v0.0.13 /go.mod h1:T6r6HQ22NZsSUI/u5ThOlPsQrtbnJIImZTPAvEOSCdI =
427
430
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c /go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I =
428
431
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc /go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y =
429
432
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 /go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU =
You can’t perform that action at this time.
0 commit comments