0

I would to implement a simple functionality on my server:

I would to know when a my process that it is running on the server is active or no. If this process is not running I would to send an e-mail to administrator.

To implement this functionality I'm thinking to a cron-job scheduled on x hours.

How can I implement this cron-job? I used python server-side.

Is this the better solution?

Safari
  • 11,437
  • 24
  • 91
  • 191

1 Answers1

1

I'm assuming that your server is *nix, as you're mentioning cronjobs.

You can find bash scripts doing exactly this functionality, if you google it. Here's a bash script which checks for specific services and sends emails if a service is down:

http://bash.cyberciti.biz/monitoring/simple-process-checker-script/

You just need to tweak the _chklist, _sendemail and _email variables to suit your needs

Filippos Karapetis
  • 4,367
  • 21
  • 39