Error getting list of running units

Hi, I just installed metricbeat-oss-7.6.2-x86_64.rpm. I configured system.yml but when I run it as service I get errors in logs:

2020-05-20T14:52:44.744+0200 INFO module/wrapper.go:252 Error fetching data for metricset system.service: error getting list of running units: Unknown method 'ListUnitsByPatterns' or interface 'org.freedesktop.systemd1.Manager'.

I guess It has something to do with rights and service metricset, /etc/metricbeat is owned by root. I also tried to run metricbeat with --strict.perms=false by defining in metricbeat.service:

ExecStart=/usr/share/metricbeat/bin/metricbeat --strict.perms=false $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS

But still getting same error, can anybody help?

System.yml

- module: system
  period: 5s
  metricsets:
    - cpu
    - load
    - memory
    - network
    - process
    - process_summary
    - service
    #- core
    - diskio
    #- socket
  processes: ['nginx','java','httpd']
  process.include_top_n:
    by_cpu: 5      # include top 5 processes by CPU
    by_memory: 5   # include top 5 processes by memory

- module: system
  period: 1m
  metricsets:
    - filesystem
    - fsstat
  processors:
  - drop_event.when.regexp:
      system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

- module: system
  period: 15m
  metricsets:
    - uptime

#- module: system
#  period: 5m
#  metricsets:
#    - raid
#  raid.mount_point: '/'

@Deny7 Can you give us more details on the operating system you're running this on? Metricbeat appears to be a native systemd service running as root, correct?

Can you send the output of the following:
gdbus introspect --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 | grep ListUnits (this may require you to install an extra package)

systemctl --version

Facing the same issue on CentOS, running metric beat system module,
Version of systemd is :

systemd 219
 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN


Can we enable some setting or other workaround to solve this, other then upgradation of systemd?

Kindly help!

Tested with latest metricbeat 7.7, events are not generating for service metric set, also no clear error reported

Command output:
    [root@lux-00-00-02 metricbeat]# gdbus introspect --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 | grep ListUnits
          ListUnits(out a(ssssssouso) arg_0);
          ListUnitsFiltered(in  as arg_0,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.