Ad Widget

Collapse

Linux service discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kksan
    Junior Member
    • Jul 2018
    • 14

    #1

    Linux service discovery

    Hi all,

    I am facing a necessity with Zabbix.
    I always have monitored Windows services to discover if some services were stopped.
    Today I discovered an important service on a Linux CentOS server that was stopped.
    I am trying to add a discovery for services but I dont know how.
    My windows configuration is:

    Discovery list:
    Name: windows service discovery
    Key service.discovery

    Item prototypes:
    Name: State of service "{#SERVICE.NAME}" ({#SERVICE.DISPLAYNAME})
    key: service.info[{#SERVICE.NAME},state]

    Trigger prototypes:
    Name: Service "{#SERVICE.NAME}" ({#SERVICE.DISPLAYNAME}) is not running (startup type {#SERVICE.STARTUPNAME})
    Expression: {HOST:service.info[{#SERVICE.NAME},state].min(#3)}<>0

    And this works very well.
    How can I do the same thing for Linux CentOS servers?
    Thank you in advance!
    Last edited by kksan; 04-01-2019, 17:25.
  • Vakky
    Junior Member
    • Jan 2019
    • 1

    #2
    I'm also interested in this. I can't seem to find much on it. I see a few scripts but I would like to avoid deploying anything else outside of the agent.

    Comment

    • aigars.kadikis
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2018
      • 208

      #3
      Here is one solution based on systemctl. This is suitable for Zabbix version 4.0:
      Explanation of this technique has been described at Convert text to number with RegEx, Zabbix preprocessing install jq utility to list J...

      You need to install two UserParamater's: one to discover all Linux services; second to query the status of each service.

      Explanation how it works:
      This document represents the following zabbix features/techniques: UserParameter which will discover all services. JSON format containing 2...

      Comment

      Working...