Skip to content

Commit

Permalink
[Auditbeat] Package: Enable suse (elastic#11634)
Browse files Browse the repository at this point in the history
Both openSUSE and SLES use RPM under the hood, so we can use the code we already have for CentOS/Fedora.

Depends on elastic#11628.

Fixes elastic/beats-tester#115.

(cherry picked from commit ebdf66d)
  • Loading branch information
Christoph Wurm committed Apr 5, 2019
1 parent 3b177b6 commit 07f5797
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
5 changes: 3 additions & 2 deletions x-pack/auditbeat/module/system/package/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
namespace = "system.audit.package"

redhat = "redhat"
suse = "suse"
debian = "debian"
darwin = "darwin"

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 07f5797

Please sign in to comment.