Ad Widget

Collapse

Systemd by Zabbix Agent2 not monitoring all services

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abansal
    Junior Member
    • Feb 2022
    • 3

    #1

    Systemd by Zabbix Agent2 not monitoring all services

    Target system: Ubuntu 18.04
    Zabbix Agent2 version: zabbix-release_5.2-1+ubuntu18.04_all.deb

    I have installed Zabbix Agent2 on my Ubuntu machine 18.04 and enabled systemd monitoring using the Systemd by Zabbix Agent2 template. After executing the discovery rules for the services and sockets I am able to see some services on my server dashboard.
    The issue is that I am not able to monitor all the services that are situated under the /etc directory running on my Ubuntu machine. I can monitor only those services which are under the /lib/systemd/system
    All the services that are under /etc/systemd/system are not being monitored. I am not sure why this is the case. Is it because of the agent version or the Ubuntu version?
    Are there any Userparamaters that can be added to the zabbix_agent2.conf file that directs the zabbix agent to monitor all the services in a user-defined directory?

    Any suggestions?
    Last edited by abansal; 15-06-2022, 12:37.
  • Ostad
    Junior Member
    • Jul 2022
    • 10

    #2
    Hello abansal,

    Systemd by Zabbix agent 2 template only discovers the services that have a STATE=enabled. If you have services on your machine that have STATE=generated, they will not be discovered.
    WHY? Because the Template has a macro {$SYSTEMD.UNITFILESTATE.SERVICE.MATCHES} = enabled

    Solution: just change the macro value from enabled to generated or etc and Execute the discovery rule again.
    Solution2(not recommended): go to Your Host configuration > Discovery rules > Service units discovery > Filters and change the Filter E {#UNIT.UNITFILESTATE} from matches to exists, then Execute the discovery rule.

    To find out which services are enabled or generated, run these commands on your machine.​
    HTML Code:
    systemctl list-unit-files --state=enabled
    HTML Code:
    systemctl list-unit-files --state=generated
    HTML Code:
    systemctl list-unit-files --state=static
    HTML Code:
    systemctl list-unit-files --state=bad
    HTML Code:
    systemctl list-unit-files --state=disabled
    Last edited by Ostad; 21-09-2022, 11:59.

    Comment

    Working...