Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have been using monit/mmonit to monitor my system. One if its features is the check program syntax, which runs a program and validates its return value:

# Asserts that there are more than 40 users in the DEV DB.

check program more_than_40_users_in_dev_db 
    with path /home/ubuntu/servers-scripts/monitoring/more_than_40_users_in_dev_db.py
    with timeout 5 seconds
    every 2 cycles
    if status != 0 then alert

The problem is that the script should run as the user ubuntu, but monit runs it as root. I have tried the as uid ubuntu and gid ubuntu syntax, but it does not seem to work for the check program directive.

Is there a way to run this script as a specific user?

share|improve this question
Heh, I wanna know what's in: /home/ubuntu/servers-scripts/monitoring/more_than_40_users_in_dev_db.py :) –  ewwhite Sep 22 '14 at 12:37
One of the most mundane scripts ever written by a human being. –  Adam Matan Sep 22 '14 at 13:28

Your Answer


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

Browse other questions tagged or ask your own question.