Skip to content

Commit

Permalink
[Auditbeat] Cherry-pick #11634 to 6.7: Package: Enable suse (#11670)
Browse files Browse the repository at this point in the history
Cherry-pick of PR #11634 to 6.7 branch. Original message: 

Both openSUSE and SLES use RPM under the hood, so we can use the code we already have for CentOS/Fedora.

Depends on #11628.

Fixes elastic/beats-tester#115.
  • Loading branch information
Christoph Wurm authored Apr 7, 2019
1 parent 78c68fe commit b483db6
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 @@ -60,6 +60,8 @@ https://github.com/elastic/beats/compare/v6.7.0...6.x[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 b483db6

Please sign in to comment.