blob: ea3d21d37945bedce7f6ee262b24a75e76ac091f (
plain)
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
|
// SPDX-License-Identifier: GPL-3.0-or-later
//go:build linux
// +build linux
package systemdunits
import (
"errors"
"strings"
"github.com/netdata/netdata/go/go.d.plugin/pkg/matcher"
)
func (s *SystemdUnits) validateConfig() error {
if len(s.Include) == 0 {
return errors.New("'include' option not set")
}
return nil
}
func (s *SystemdUnits) initUnitSelector() (matcher.Matcher, error) {
if len(s.Include) == 0 {
return matcher.TRUE(), nil
}
expr := strings.Join(s.Include, " ")
return matcher.NewSimplePatternsMatcher(expr)
}
|