2

I have a live site, but would like to run a periodic task that would periodically check if various pages and email sending work.

e.g. register page, forgot password page, etc...


I'm having quite a problem figuring out how to do this...

Any ideas? :)

RadiantHex
  • 24,907
  • 47
  • 148
  • 244

1 Answers1

3

At my workplace we use nagios to monitor, among many things, that the smtp service and web apps are running as it should. For crucial pages, we use the check_http nagios plugin to ensure that the pages are accessible and contain specific keywords.

You can set each check to run as frequently as you like, and have nagios send you an email if anything goes amiss.

As for checking whether email sending from django is working, that's a little tricky. None of my sites are mission critical, so I'm happy to assume that if my code base doesn't change and if the web apps and SMTP servers are working, then emails from django should be ok.

If it is critical that you check that django can send emails, you could have a view (restricted by source IP and perhaps a password in POST/GET) that triggers an outgoing email. You can then write your own plugin to access said view and check that the email is sent.

Here's a nice write-up on how to check your email service using nagios: http://www.linuxjournal.com/content/monitoring-email-nagios

Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
  • damn that Nagios site is down :( – RadiantHex Jan 14 '11 at 16:09
  • You're very welcome. If the site is down, you could start with http://www.nagiosbook.org/. The text may be a little dated and some things would have changed since it was written, but it should be good enough to give you an idea of what nagios does and how it may fir into your environment. – Shawn Chin Jan 14 '11 at 16:16