Above command is to run the satus everyday at midnight, depending on how frequent the service goes down you can schedule it to run , like each hour or each 30minutes etc. Add the script to crontab by crontab -e Here OpenOffice service port number is taken as 8100