[ZBXNEXT-7425] Please add systemd.unit.info["{#UNIT.NAME}",Type,Service] information to the systemd.unit.get["{#UNIT.NAME}"] query. Created: 2022 Jan 14  Updated: 2025 Apr 17

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent2 plugin (G)
Affects Version/s: 5.4.9
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Rudolf Kastl Assignee: Zabbix Integration Team
Resolution: Unresolved Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File systemd by zabbix agent2 active.yaml     File template_app_systemd_active.yaml     File zabbix-6.2-systemd.yml     File zbx_export_templates.yaml    

 Description   

In my environment i am checking for systemd.unit.info"{#UNIT.NAME}",Type,Service to get the service type. Additionally i have set a trigger condition that for example services with type "oneshot" will not fire the trigger.

With the latest provided systemd template all data is gathered in one go by: systemd.unit.get"{#UNIT.NAME}"

Unfortunately to get the service type i have to run another query separately for each service: systemd.unit.info"{#UNIT.NAME}",Type,Service 

In the ideal world the initial systemd.unit.get"{#UNIT.NAME}" would also include the data of systemd.unit.info"{#UNIT.NAME}",Type,Service to have a single query get the service type information.

If you need  additional information please let me know.

 

 

 



 Comments   
Comment by Rudolf Kastl [ 2022 Jan 18 ]

Added the enhanced active systemd check that i am using currently.

Comment by Orion Poplawski [ 2022 Aug 24 ]

The exclusion of oneshot services from the server trigger is really needed - otherwise you get a lot of spurious alerts.  This still seems to be an issue with 6.0/6.2

Comment by Orion Poplawski [ 2022 Aug 24 ]

Rudolf - do you by any chance have an updated template from 6.0?  Thanks.

Comment by Rudolf Kastl [ 2022 Aug 24 ]

I do use 6.2.1 now. Will update tomorrow with a fresh export.

Comment by Rudolf Kastl [ 2022 Aug 29 ]

zbx_export_templates.yaml<- 6.2 version (active monitoring)

Comment by Orion Poplawski [ 2022 Aug 30 ]

After looking at the zabbix systemd go plugin code a bit, I think the main limitation is the various systemd DBus interfaces.  zabbix is getting all of the "Unit" information in the discovery - but the "Service Type" is part of the Service API.  I'm not sure it's worth hacking in an additional call to get the service type in the discovery phase - the additional condition in the trigger may be appropriate.  I still want to track when oneshot services run, so I don't want them fully excluded from the service monitoring.

I've attached my version of the active agent template.

Comment by Rudolf Kastl [ 2022 Sep 29 ]

Thanks. Another question is really the dbus activated services.  One of the popular ones is timedatex e.g. but there are others.

 

 

Comment by Rudolf Kastl [ 2022 Dec 01 ]

This is my latest active agent2 systemd template: zabbix-6.2-systemd.yml

 

It provides:

  • getting of service api information that is relevant for monitoring (such as service type)
  • exclusion of "dbus" and "oneshot" servicetypes from the service trigger (dbus activated services are not always continously running)
  • an info trigger for services that are running but not enabled

 

Comment by Peter Kessen [ 2025 Apr 17 ]

Hello, i have the same issue that i get much of wrong problems reported cause their service type is a oneshot. Unfortunatelly i was not able to update the template to my Zabbix 7.2 installation. Is there any work in progress here?

Generated at Mon May 19 07:01:42 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.