From 07f5797b49cc2f6b8b986c778e59bc95b4081782 Mon Sep 17 00:00:00 2001 From: Christoph Wurm Date: Fri, 5 Apr 2019 15:53:07 +0100 Subject: [PATCH] [Auditbeat] Package: Enable suse (#11634) Both openSUSE and SLES use RPM under the hood, so we can use the code we already have for CentOS/Fedora. Depends on https://github.com/elastic/beats/pull/11628. Fixes https://github.com/elastic/beats-tester/issues/115. (cherry picked from commit ebdf66d8ef6299a9c9a7633badd14ed73e87d501) --- CHANGELOG.next.asciidoc | 2 ++ x-pack/auditbeat/module/system/package/package.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 51ebb8463712..9160f4214a48 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -57,6 +57,8 @@ https://github.com/elastic/beats/compare/v7.0.0-rc1...master[Check the HEAD diff *Auditbeat* +- Add support to the system package dataset for the SUSE OS family. {pull}11634[11634] + *Filebeat* *Heartbeat* diff --git a/x-pack/auditbeat/module/system/package/package.go b/x-pack/auditbeat/module/system/package/package.go index 457430100877..5be39d19ceca 100644 --- a/x-pack/auditbeat/module/system/package/package.go +++ b/x-pack/auditbeat/module/system/package/package.go @@ -39,6 +39,7 @@ const ( namespace = "system.audit.package" redhat = "redhat" + suse = "suse" debian = "debian" darwin = "darwin" @@ -207,7 +208,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { } ms.osFamily = osInfo.Family switch osInfo.Family { - case redhat: + case redhat, suse: // ok case debian: if _, err := os.Stat(dpkgStatusFile); err != nil { @@ -471,7 +472,7 @@ func (ms *MetricSet) savePackagesToDisk(packages []*Package) error { func getPackages(osFamily string) (packages []*Package, err error) { switch osFamily { - case redhat: + case redhat, suse: packages, err = listRPMPackages() if err != nil { err = errors.Wrap(err, "error getting RPM packages")