Personal tools
You are here: Home Monitoring Possible Actions
Document Actions

Possible Actions

by admin last modified 2006-05-24 05:01

This page lists all the possible actions one might use with the MonaLisa alerts system

  • Email

    One of the more common ways to use alerts is to have them send you an email when things go wrong.  Here's an outline of an email action:
          <email server='thpc-1'>
            <to> some-email-list@unl.edu </to>
            <from> alerts@thpc-1.unl.edu </from>
            <subject> Load on $NODE of farm $FARM above 10.0 </subject>
            <text>
    This is an automated MonaLisa alert.  To filter it out, simply filter any messages containing "FILTER_MONALISA".

    The load on the farm $FARM's node, $NODE, is now above 10.0.  Please check it out to see what is wrong.
    Current load is $PARAM.
            </text>
          </email>
    There are a couple of things to note.  First of all, in order to send the email, the daemon needs a sendmail server to connect to.  By default, localhost is tried; here, the server is specifically set to "thpc-1".  The to, from, subject, and text fields should be self-explanatory.  If $PARAMNAME, $PARAM, $FARM, $CLUSTER, or $NODE is encountered, they will be substituted with the appropriate values.  Personally, I add the same bit of header text to all alerts messages so people on mailing lists can filter them out easily if appropriate.  This will automatically be added (but can be optionally removed) in future versions.
  • Web alerts

    At UNL, we include all of our alert information on our webpages, as you can see from the footer.  This is done through a simple XML-RPC mechanism for now.  The format of a webalert looks like this:
    <webalert server='http://server-url' name='function_name'>Message to function</webalert>
    The alerts interface will then try to connect to the URL set in the server parameter, and send an XML-RPC message to "function_name".  The parameters passed are:
    function_name( farm, cluster, node, param_name, param, message)
    If no message is given, then different parameters are given:
    function_name( farm, cluster, node, param_name, param )

  • Shell

    A simple shell command can be executed; for more complex shell actions, we suggest using "script" instead:
    <shell> shell command </shell>
    The command executed is then:
    /bin/sh -c "shell command"
    Notice the quoting - it can easily trip up sh.  Adjust your commands accordingly or use a script.
  • Script

    For more complex shell actions - or actions which require the use of double quotes - you can invoke a separate script file like this:
    <script user="some_user"> command </script>
    Given the above action, the following is executed:
    sudo some_user command
    If no user is specified, just the command is executed.
  • ApMon message

    The alerts system can actually feed information back into MonaLisa system through the ApMon protocol.  The format of this action is:
    <apmon>
      <cluster> My Cluster </cluster>
      <node> My Node </node>
      <param> Some parameter </param>
      <value> $PARAM </value>
    </apmon>
    As usual, any variables are expanded.
  • Print to log

    If you are still debugging your setup, it is often handy to just print messages to the logfile.  This action is perhaps the easiest:
    <print>The load on the node $NODE of $FARM is at $PARAM </print>
    Again, as usual, variables are expanded.

Powered by Plone, the Open Source Content Management System