Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Nodeusageinstall

Nodeusageinstall

Installing Node Availably and Usage Graphs

Installing Node Availably and Usage Graphs

Emulab has a new feature which can create nice plots of available nodes over time periods. To get an idea of what they look like see the plots for Utah's Emulab at http://www.emulab.net/node_usage/.

However this feature is not installed by default as it requires some manual steps to set up.

To enable it first add the line

NODE_USAGE_SUPPORT=1

to your defs file. Then reconfigure and install the Emulab source. This will install the scripts in /use/testbed/libexec/node_usage (assuming the testbed is installed in /usr/tested) but you need to create a config file before they can run.

Creating the Config File

To create the config file customize node_usage.conf.sample for your site and copy it to /usr/testbed/etc/node_usage.conf. The file is perl code, so be careful.

You first need to decide when to start plotting and set the START option appropriately. The graphs use the data form the node_history table. So a good starting part would be to set it to the first value in the table which you can get using:

select min(stamp) from node_history;

This value will be refined latter.

The node_usage scripts require a separate database from the main testbed database to store working data. This database is stored in the NODE_USAGE_DB option. The default value of node_usage should work in most cases. This database will be created automatically if it doesn't already exist.

Next you need to decide what you want to plot. For Utah's Emulab we chose to plot the "useful" PCs (pc600 pc850 pc2000 pc3000s) and the pc3000s which are the newest PCs. The to_plot variable need to be set to what every you decide. Follow the format specified in the sample file.

Finally you can add some optional text to the plot pages. For now you can just leave them as empty string.

Running the scripts for the first time

After you have installed the config file and created the database you are ready to run the script for the first time. To do this cd to /usr/testbed/libexec/node_usage and run

./refresh

The first time you run this script it will take up to an hour or so to run, so be patent. Subsequently runs will only take a few minutes.

If everything goes well you should be able to go to

http://www.YOURSITE/node_usage

And see the graphs. The very first part of the graphs will be invalid due to the nature of how data is gathered. To fix this you need to chose a better start date using the get-start-date script. To run the script use something like:

./get-start-date pc3000 160 pc850 128

The script will then find the first start date where there is valid data for 160 pc3000's and 128 pc850's. For your site you should customize this list with the PCs you want to plot and the number of PCs that where installed in your testbed around the time of the start date. Use this value for the START option in the config file. Then rerun the scripts using refresh and have another look at the plots.

Finishing Up

When you are happy with the graphs install the following crontab entry to regenerate the graphs nightly:

  30    5       *       *       *       root    /usr/testbed/libexec/node_usage/refresh