Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We do not have any sort of proper server monitoring solution in place (a situation I'd like to rectify this summer), but I've got one service in particular that I'd like to monitor. [Our current monitoring system, waiting for clients to call in with a problem, works well for widely-used systems, but this does not affect as many people, as, say, DHCP.]

I'm running All The Right Type 3 Server on (sigh) an OS X 10.3 (Panther) box [because it doesn't start itself automatically on something newer and our software procurement person really doesn't want to get updated software.] The client software is working fine the student's machines, under OS X 10.5 (Leopard).

Now then, I occassionally get a call that this server is down [and the machine itself is still up!], and I'd really prefer to know before someone has to pick up the phone. The process appears to be called "atrtserv.osx". While it does use the network, I would be surprized if the documentation for it spoke of how to send a message to see if the service is up, so something gross-grained, like check every five minutes that the process exists.

Is there a simple way to monitor one service, esp. on the Mac?

share|improve this question
up vote 1 down vote accepted

I don't guarantee that this code works right (most especially the line that starts with "RUNNING=", but substitute some test of your own that can return a string if it's running and no string when it isn't.


while true ; do 
RUNNING=`ps aux | grep atrtserv | grep -v grep`
if [ -n "$RUNNING" ] ; then
    echo "atrtserv.osx is broken" | mail -s "atrtserv down"
    sleep 300
    sleep 300

Edit Use the pgrep above instead of my hack

share|improve this answer
I haven't tried it yet, but this sure looks like the right answer. pgrep is not built-in on the Mac. – Clinton Blackmore Jun 2 '09 at 21:37

Well, the real simple way probably looks like:

pgrep atrtserv.osx >/dev/null || (
    date |
    mail -s 'atrtserv.osx down on'

in a cron job running at the interval of your choice.

share|improve this answer

You could write a small script that runs ps, and have cron run it every 5 mins.

mail will then mail you if it finds something wrong.

Total implementation time would be able 15 minutes I think.

share|improve this answer

Try monit from darwinports.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.