Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-6249

Zabbix-Agent2 sytemd discovery please provide UnitFileState for proper filtering

    XMLWordPrintable

Details

    • Change Request
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.0.4
    • None
    • Agent2 plugin (N)
    • None
    • RHEL7/8 CENTOS7/8

    Description

      Systemd autodiscovery is great but there are a whole bunch of services that are not handled well. Mostly those services have an "indirect" or "static" UnitFileState. Those should be filtered out automatically from the service autodiscovery. The problem is that UnitFileState is currently not provided by the zabbix-agent2 go plugin.

      Dbus returns the following:

      readonly s UnitFileState = 'indirect';

      or respectively

      readonly s UnitFileState = 'static';

       

      Another interesting aspect of UnitFileState is that you can filter out to monitor only those services that are explicitely "enabled" to start automatically. 

      e.g. you could filter out services in the autodiscovery that are not enabled to start automatically after reboot:

      readonly s UnitFileState = 'disabled';

      UnitFileState can have the following values:

       

      UnitFileState encodes the install state of the unit file of FragmentPath. It currently knows the following states: enabledenabled-runtimelinkedlinked-runtimemaskedmasked-runtimestaticdisabledinvalidenabled indicates that a unit file is permanently enabled. enable-runtime indicates the unit file is only temporarily enabled, and will no longer be enabled after a reboot (that means, it is enabled via /run symlinks, rather than /etc). linked indicates that a unit is linked into /etc permanently, linked indicates that a unit is linked into /run temporarily (until the next reboot). masked indicates that the unit file is masked permanently, masked-runtime indicates that it is only temporarily masked in /run, until the next reboot. static indicates that the unit is statically enabled, i.e. always enabled and doesn't need to be enabled explicitly. invalid indicates that it could not be determined whether the unit file is enabled.

       

      Reference: https://www.freedesktop.org/wiki/Software/systemd/dbus/

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            che666 Rudolf Kastl
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: