WeBWorK Main Forum

monitoring webwork and database

monitoring webwork and database

by Subasa Nguyen -
Number of replies: 2
Hi guys,

Is it possible to monitor the WebWork application and its (ours is external) database, to know when there's problem that requires action?

For example, an email notification when WebWork app loses its connection to the (external) database?

Thank you,

In reply to Subasa Nguyen

Re: monitoring webwork and database

by Danny Glin -
Based on your question I'm assuming that you have shell access to the WeBWorK server, but not to the database server.  

WeBWorK doesn't have a perpetual connection to the database.  Each time it needs to query the database it opens a connection, and then closes it when the query completes.

There are a couple of options for accomplishing what you ask.  One is to modify the WeBWorK code so that when a database connection fails it sends an email notification.  Another choice would be to write a script on your WeBWorK server that periodically tries to connect to the database, and if the connection fails it sends an email.

The former would not trigger an email until something in WeBWorK tried to connect to the database.  The latter would run as often as you ask.  Depending on how often you chose to have it run, it could cause extra strain on your servers.

Of courses there are also more robust solutions involving installing monitoring  software, but you would have to investigate these.