Ad Widget

Collapse

Systemd for Zabbix Agent2 does not discover service created by systemd-sysv-generator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • llinty
    Junior Member
    • Jan 2024
    • 14

    #1

    Systemd for Zabbix Agent2 does not discover service created by systemd-sysv-generator

    Hello,

    I'm having some issue with Systemd for Zabbix Agent2. It seems that this template is not able to add service created by systemd-sysv-generator. The service is FlexLM which is an umbrella software used to manage license. Zabbix agent is able to discover the service.

    zabbix_agent2 -t systemd.unit.get["FlexLM.service"] (see flexlm-service.txt file in attachement)

    On Zabbix interface the service is not created as an Item and it cannot be monitored. systemctl status command is working but the output is slightly different from a standard systemctl service. It is probably explaining why Systemd Template is unable to create FlexLM.service item in Zabbix.

    Please advise.



    Attached Files
  • oinfantes
    Junior Member
    • Mar 2024
    • 1

    #2
    Hi llinty,

    This template has filters enabled and by default discovers only ACTIVE services or sockets that are ENABLED as you can see in Template Macros values.

    Your service has unit file GENERATED, so is filtered because {#UNIT.UNITFILESTATE} is not enabled.

    You can check this on your server with this command
    Code:
    systemctl list-unit-files --state=generated
    To make this service discovered by Systemd for Zabbix Agent2 template:

    If you only need to discover this service you can change two macro values in your host configuration
    Code:
    {$SYSTEMD.NAME.SERVICE.MATCHES} FlexLM.service
    {$SYSTEMD.UNITFILESTATE.SERVICE.MATCHES} generated

    But if you want to discover all active services and also generated ones you can change the macro like this (regex expression)
    Code:
    {$SYSTEMD.UNITFILESTATE.SERVICE.MATCHES} ^(enabled|generated)$
    Hope this solve your issue!
    Attached Files

    Comment

    Working...