I have a service, sssd, that keeps dying on two Linux servers. While I am waiting to resolve that, I would like to be able to monitor the output of the command:
service sssd status
With the following actions
1) if the word "running" is in the result, set condition up
2) if the word "down" is in the result, set condition down
3) if the word "dead" is in the result, run the command "service sssd restart"
When the service dies, if I login and run the above command, I get the result:
[root@dwdataaccm1 ~]# service sssd status
sssd dead but subsys locked
[root@dwdataaccm1 ~]# service sssd restart
Stopping sssd: cat: /var/run/sssd.pid: No such file or directory
[FAILED]
Starting sssd: [ OK ]
[root@dwdataaccm1 ~]#
I would like to use Orion to manage this while we try to find the root cause. Can anyone help? I have searched already and find lots of posts, but none that seem to use the service command, and I don't know perl well enough to modify the existing samples.
Thanks.