Blame contrib/README

Packit d14fb6
Packit d14fb6
Graphs for ipmitool
Packit d14fb6
-------------------
Packit d14fb6
Packit d14fb6
This is a set of shell-scripts to quickly create a webpage with pretty graphs!
Packit d14fb6
Packit d14fb6
Prerequisites are a webserver with cgi-bin support and RRDtool, a data
Packit d14fb6
collection and graphing utility you can get here:
Packit d14fb6
Packit d14fb6
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
Packit d14fb6
Packit d14fb6
Packit d14fb6
First, decide on a directory where to store the RRDtool database files and make
Packit d14fb6
sure it exists. The user that will run the cronjob to collect updates must have
Packit d14fb6
write permissions in this dir.
Packit d14fb6
Packit d14fb6
Next, you'll need to edit some variables at the top of each script.
Packit d14fb6
Packit d14fb6
Common to all scripts:
Packit d14fb6
Packit d14fb6
hostname	Override this if you are collecting data from a remote host,
Packit d14fb6
		or if the $HOSTNAME variable is incorrect. 
Packit d14fb6
Packit d14fb6
ipmi_cmd	Command line used to call ipmitool. Default is to collect
Packit d14fb6
		data from the local server using OpenIPMI.
Packit d14fb6
Packit d14fb6
		If you want to collect data from a remote host, add the
Packit d14fb6
		-I lan, -H, -U and -P options as necessary.
Packit d14fb6
Packit d14fb6
		BIG NOTE! I do not recommend using remote data collection since
Packit d14fb6
		you'll have to store the password in the script. If you do,
Packit d14fb6
		make sure unauthorized people can't read or execute the scripts
Packit d14fb6
		or they'll be able to wreak havoc on your server.
Packit d14fb6
Packit d14fb6
rrd_dir		Enter the dir where to store the RRDtool database here.
Packit d14fb6
Packit d14fb6
Packit d14fb6
Now you can get the data collection going. Run create_rrds.sh to create the
Packit d14fb6
RDDtool database, you'll find one .rrd file per sensor in the designated dir.
Packit d14fb6
Add a line to your crontab that executes collect_data.sh every 5 minutes.
Packit d14fb6
Packit d14fb6
Something like this:
Packit d14fb6
*/5 * * * * /usr/local/bin/collect_data.sh
Packit d14fb6
Packit d14fb6
If you are a Solaris user you'll have to write the more verbose:
Packit d14fb6
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/collect_data.sh
Packit d14fb6
Packit d14fb6
Packit d14fb6
Finally it's time to create the webpage, begin with editing some more variables
Packit d14fb6
in the create_webpage.sh and/or create_webpage_compact.sh scripts:
Packit d14fb6
Packit d14fb6
rrdcgi		Full path to the rrdcgi executable.
Packit d14fb6
Packit d14fb6
img_dir		Directory to store the graph images. This path must be within
Packit d14fb6
		the document root and writable by the web server user.
Packit d14fb6
Packit d14fb6
		Example: /usr/local/apache2/htdocs/images/graphs
Packit d14fb6
Packit d14fb6
web_dir		Relative path of the URL where the images will show up
Packit d14fb6
		on the web server.
Packit d14fb6
Packit d14fb6
		Example: With the img_dir path above the corresponding web_dir
Packit d14fb6
		would be /images/graphs
Packit d14fb6
Packit d14fb6
graph_width	Size of the graph area in pixels (excluding title, legends etc.)
Packit d14fb6
graph_height
Packit d14fb6
Packit d14fb6
graph_daily	Decide which of daily, weekly and monthly graphs you want
Packit d14fb6
graph_weekly	included on the page.
Packit d14fb6
graph_monthly
Packit d14fb6
Packit d14fb6
Packit d14fb6
Finally run the create webpage script and store the output as a cgi-script and
Packit d14fb6
don't forget to make it executable.
Packit d14fb6
Packit d14fb6
Example:
Packit d14fb6
Packit d14fb6
create_webpage.sh > /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
Packit d14fb6
chmod 755 /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
Packit d14fb6
Packit d14fb6
Now you can surf to http://my.server.com/cgi-bin/my_ipmi_graphs.cgi and enjoy!
Packit d14fb6
Packit d14fb6
Packit d14fb6
The difference between create_webpage.sh and create_webpage_compact.sh is that
Packit d14fb6
the first script displays sensor thresholds in the graphs. The second script
Packit d14fb6
collects all sensors that measure the same unit into the same graph thus
Packit d14fb6
producing a lot fewer graphs.
Packit d14fb6
Packit d14fb6
Note, RRDtool sometimes scales the graphs such that the sensor thresholds
Packit d14fb6
fall outside the visible area.
Packit d14fb6
Packit d14fb6
Packit d14fb6
Happy graphing!
Packit d14fb6
Packit d14fb6