From d87c23ee03c166a6eaa34148196ea973ce3c4869 Mon Sep 17 00:00:00 2001 From: Tobias Bauriedel Date: Tue, 10 Jan 2023 12:01:15 +0100 Subject: [PATCH] keepalived: add extended information --- modules/keepalived/collector.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/keepalived/collector.go b/modules/keepalived/collector.go index 1a28e88..89df76b 100644 --- a/modules/keepalived/collector.go +++ b/modules/keepalived/collector.go @@ -12,6 +12,14 @@ var relevantPaths = []string{ "/etc/keepalived", } +var possibleDaemons = []string{ + "/usr/lib/systemd/system/keepalived.service", +} + +var services = []string{ + "keepalived", +} + var files = []string{ "/etc/keepalived/keepalived.conf", } @@ -50,6 +58,14 @@ func Collect(c *collection.Collection) { c.AddFiles(ModuleName, file) } + for _, file := range possibleDaemons { + c.AddFilesIfFound(ModuleName, file) + } + + for _, service := range services { + c.AddServiceStatusRaw(ModuleName+"service-"+service+".txt", service) + } + for name, cmd := range commands { c.AddCommandOutput(ModuleName+"/"+name, cmd[0], cmd[1:]...) }