s c h e m a t i c s : c o o k b o o k

/ Cookbook.HandinServerMonitor

This Web


WebHome 
WebChanges 
TOC (with recipes)
NewRecipe 
WebTopicList 
WebStatistics 

Other Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
Sourceforge Page
SchemeWiki.org
Original Cookbook
RSS

Scheme Links


Schemers.org
Scheme FAQ
R5RS
SRFIs
Scheme Cross Reference
PLT Scheme SISC
Scheme48 SCM
MIT Scheme scsh
JScheme Kawa
Chicken Guile
Bigloo Tiny
Gambit LispMe
GaucheChez

Lambda the Ultimate
TWiki.org

Monitoring the Handin Server

Problem

You use the PLT handin server to accept submissions. You want a cron job to run periodically to make sure the server is still running.

Solution

Evaluating this module tells you whether MY handin-server is still running:

(module check-handin-server mzscheme
  (require (lib "client.ss" "cp-csc43002061")
           (lib "monitor-emailer.ss" "web-server")
           (lib "monitor-poke-web-server.ss" "web-server"))
  
  (define server "jblomconts.dyndns.org")
  (define port 7981)
  (define pem-path (build-path (collection-path "cp-csc43002061") "server-cert.pem"))
  
  (with-handlers ([exn:fail? (lambda (exn) (send-email-alert  "clorents@csc.calpoly.edu" server port (exn-message exn)))])
    (handin-disconnect (handin-connect server port pem-path)))
  )

You'll need to customize it to refer to your installation of the handin-client, your server-certificate, your server, your port, and your e-mail. Ha!

Note: you could do lots better than this by actually handing something in; this script just makes the connection and then breaks it.

I have the following line in my crontab:

57 * * * * /Applications/PLT\ Scheme\ v301/bin/mzscheme -Tmv /Users/clements/bin/check-handin-server.ss

Discussion


Comments about this recipe

Contributors

-- JohnClements - 16 May 2006

CookbookForm
TopicType: Recipe
ParentTopic: WebRecipes
TopicOrder: 999

 
 
Copyright © 2004 by the contributing authors. All material on the Schematics Cookbook web site is the property of the contributing authors.
The copyright for certain compilations of material taken from this website is held by the SchematicsEditorsGroup - see ContributorAgreement & LGPL.
Other than such compilations, this material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest