1 Reply Latest reply on Jun 30, 2015 6:04 PM by chad.every

    Linux monitor services - a SAM componant to respont to the output of a linux command

    robinsons05661

      Does anyone have a SAM component template for monitoring the output a Linux command?

       

      We have two Linux servers we have configured to use SSSD authentication to an AD server with LDAP and Kerberos. For some reason, the SSSD service keeps dying. If I login manually and run the command:

       

      service sssd status

       

      I get the following result:

       

      sssd dead but subsys locked

       

      I would like a Linux script template that will monitor the service using the service x status command, and if the word "dead" is in the response, I want to be paged.

       

      If possible, I'd also like the script to run the start command as well. So, I need a script that:

       

      1) run "service sssd status"

       

      2) And reacts

         a) if finds "running" returns "up"

         b) if finds "stopped" returns "down"

         c) if finds "dead" starts the service and maybe sends an alert email.

       

      Can anyone help? Note, not a perl user, but I'll by a book if necessary.....

       

      Also, if this can be done on the Orion server by using an ssh command and reacting to the result, that is fine too. I can do vbscript better than perl. For example, if there is an orion monitor that runs a ssh command

      ssh root@remoteserver "service sssd status"

      sssd (pid  31198) is running...