I have set up a monitoring system called Nagios. I would like to see if a service/daemon is running on a linux server. since my linux servers is not always the same (Some use systemctl, some use init.d), i need an universal way of doing this. Like for processes I would use "ps aux | grep SomeProcess"
How do i best do this, in one single command that gives an exit code depending on the result?
[link][23 comments]