Ad Widget

Collapse

Monitoring remote services (new to zabbix)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lsimpson
    Junior Member
    • Aug 2016
    • 6

    #1

    Monitoring remote services (new to zabbix)

    I have a working installation of Zabbix 3 on Centos 7.2.

    The monitored hosts have all been auto-discovered, and I am getting good graphs of CPU and Memory use.

    I would now like to monitor the state of a service on the remote hosts - sssd - but I am unsure where to start.

    Is this an External Check or do I need to put it into an SSH Check?

    I know how to eyeball the data locally - on any server run
    Code:
    systemctl status sssd
    And I know that I want to run something more like:
    Code:
    `systemctl is-active $SERVICE` != "active"
    on the host in question. But how do I do that (or "what is the best way to do that?").

    I should note - in case this affects the answer - that once monitored, I would also like to add triggers: if it enters the state failed, email me and then attempt to restart it locally.
  • guzzijason
    Senior Member
    • Dec 2015
    • 106

    #2
    You have options. The SSH Check you mention is meant to use the SSH protocol to perform agentless checks of arbitrary items on the target server. That may not necessarily be what you are looking for.

    You can perform a simple check, like so:

    net.tcp.service[ssh]



    Or, you could use an agent check to count the number of sshd processes running on a host:

    proc.num[sshd]



    __Jason

    Comment

    • lsimpson
      Junior Member
      • Aug 2016
      • 6

      #3
      Thanks @guzzijason - I don't think that's quite what I'm after. The service I wanted to monitor, in particular, is sssd (FreeIPA authentication module) not sshd (secure shell).

      While I could poll sssd via tcp, but I'd rather check on the process itself.

      Comment

      • lsimpson
        Junior Member
        • Aug 2016
        • 6

        #4
        In some ways what I'm asking is "how can I monitor all my services on hosts". They all have agents. Can I just watch systemctl for status changes?

        <edit>

        Ok, I've found this post on the zabbix feature requests page. I have created a file on one of my hosts called /etc/zabbix/zabbix_agentd.d/userparameter_sssd.conf

        With the content
        Code:
         # checks to determine if specified unit is active, failed or enabled
         UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet '$1' && echo 1 || echo 0
         UserParameter=systemd.unit.is-failed[*],systemctl is-failed --quiet '$1' && echo 1 || echo 0
         UserParameter=systemd.unit.is-enabled[*],systemctl is-enabled --quiet '$1' && echo 1 || echo 0

        but still don't quite understand what I'm doing - should this file be on the host or on the zabbix server? Also, now that it exists, how do I use it? (I will do more reading.)
        Last edited by lsimpson; 10-08-2016, 09:29. Reason: new information

        Comment

        • guzzijason
          Senior Member
          • Dec 2015
          • 106

          #5
          Sorry I misread 'sssd' as 'sshd'. However, if 'sssd' is the actual process name, this should still give you something: proc.num[sssd]. That will give you the number of sssd processes running on the host.

          If you want to go the userParameter route, you would install the file you mentioned on your target host, make sure your zabbix-agentd.conf is including the files in zabbix_agentd.d directory, and then restart zabbix-agent. Then, in the item configuration for this host (on the server), you would set up a zabbix agent type check for systemd.unit.is-active[sssd] (and/or one of the other keys specified in your custom userparameters.

          Comment

          Working...