Keep Server Alive with Cron Job

Despite my best efforts, the server still dies sometimes and I am in a random place trying to ssh into the server to restart it on my cell phone after customers start calling.... I tried using google to track down a script that would do the following

Every 5 min execute:

sudo /etc/init.d/WowzaMediaServer status

Then it would grep for "started" and if it isn't found would execute:

sudo /etc/init.d/WowzaMediaServer start

I am not sure how to setup the script + it is going to ask for a password to use the sudo command.

Anybody able to give me a hand? Seems like a nice script that many people should have on hand anyway.

I would love to find more about how to identify the reason for the crashing but it doesn't happen more than every few weeks and no error is generated so not sure what to do other than try to restart it till I get it on another server.

Usually I run the command with the sudo command llike:

sudo /etc/init.d/WowzaMediaServer start

I get prompted for a password, anyway of having the password bypassed or entered with the script?

Zip up conf, logs and bin and send to
support@wowza.com with a reference to this thread. Are you running Wowza as a system service or are you starting it using ./startup.sh? If ./startup.sh that could explain why it is stopping. The Quick Start guide describes how to start as system service.