Using mlmetric.py
mlmetric.py is a simple script that sends information to MonaLisa. Using it is easy, as one only needs to learn a few command line flags.
You can download the mlmetric.py script here.
Once the script has been downloaded, copy it to any computer with Python installed (all Linux and Macs come with Python preinstalled). Then, simply execute it on the command line using the following flags.
mlmetric flags:
-dest host:port host:port to send ApMon info to
-cluster <name> Name of the cluster to use
-node <name> Name of node
-param <name> Name of parameter
-value <val> Value of parameter. Can be string or numeric
As mlmetric is fairly new, some of these will be subject to change. Make sure that ApMon is enabled on the host you are sending information to; this page describes the process.
Once the script has been downloaded, copy it to any computer with Python installed (all Linux and Macs come with Python preinstalled). Then, simply execute it on the command line using the following flags.
mlmetric flags:
-dest host:port host:port to send ApMon info to-cluster <name> Name of the cluster to use
-node <name> Name of node
-param <name> Name of parameter
-value <val> Value of parameter. Can be string or numeric
As mlmetric is fairly new, some of these will be subject to change. Make sure that ApMon is enabled on the host you are sending information to; this page describes the process.
Example:
The following example will send a value of 8 to parameter "test" on "TestCluster", "TestNode". Because the destination is set to red.unl.edu, the information will show up on red.unl.edu's farm:./mlmetric -dest red.unl.edu:58884 -cluster TestCluster -node TestNode -param test -value 8
Better Example:
Here's a more interesting example. Every 10 minutes, I want to test and make sure that the homepage of this website is working. So, on one of my servers, I have the following entry in my crontab:10,20,30,40,50,0 * * * * /home/brian/mlmetric.py --dest red.unl.edu:58884 \Every 10 minutes, mlmetric will be run, and the value sent to MonaLisa will be the return value of wget; if the web server doesn't respond, the value will be nonzero. Later on, we will discuss how to create a trigger which will monitor this. After all, you don't want to have to check MonaLisa 24/7 to monitor a lousy web server!
-cluster "Auxiliary Services" -node t2.unl.edu \
-param "Apache web server" -value \
`wget http://localhost/cms -O /dev/null &> /dev/null; echo $?`