xref: /openbmc/ipmitool/contrib/README (revision c18ec02f)
1
2Graphs for ipmitool
3-------------------
4
5This is a set of shell-scripts to quickly create a webpage with pretty graphs!
6
7Prerequisites are a webserver with cgi-bin support and RRDtool, a data
8collection and graphing utility you can get here:
9
10http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
11
12
13First, decide on a directory where to store the RRDtool database files and make
14sure it exists. The user that will run the cronjob to collect updates must have
15write permissions in this dir.
16
17Next, you'll need to edit some variables at the top of each script.
18
19Common to all scripts:
20
21hostname	Override this if you are collecting data from a remote host,
22		or if the $HOSTNAME variable is incorrect.
23
24ipmi_cmd	Command line used to call ipmitool. Default is to collect
25		data from the local server using OpenIPMI.
26
27		If you want to collect data from a remote host, add the
28		-I lan, -H, -U and -P options as necessary.
29
30		BIG NOTE! I do not recommend using remote data collection since
31		you'll have to store the password in the script. If you do,
32		make sure unauthorized people can't read or execute the scripts
33		or they'll be able to wreak havoc on your server.
34
35rrd_dir		Enter the dir where to store the RRDtool database here.
36
37
38Now you can get the data collection going. Run create_rrds.sh to create the
39RDDtool database, you'll find one .rrd file per sensor in the designated dir.
40Add a line to your crontab that executes collect_data.sh every 5 minutes.
41
42Something like this:
43*/5 * * * * /usr/local/bin/collect_data.sh
44
45If you are a Solaris user you'll have to write the more verbose:
460,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/collect_data.sh
47
48
49Finally it's time to create the webpage, begin with editing some more variables
50in the create_webpage.sh and/or create_webpage_compact.sh scripts:
51
52rrdcgi		Full path to the rrdcgi executable.
53
54img_dir		Directory to store the graph images. This path must be within
55		the document root and writable by the web server user.
56
57		Example: /usr/local/apache2/htdocs/images/graphs
58
59web_dir		Relative path of the URL where the images will show up
60		on the web server.
61
62		Example: With the img_dir path above the corresponding web_dir
63		would be /images/graphs
64
65graph_width	Size of the graph area in pixels (excluding title, legends etc.)
66graph_height
67
68graph_daily	Decide which of daily, weekly and monthly graphs you want
69graph_weekly	included on the page.
70graph_monthly
71
72
73Finally run the create webpage script and store the output as a cgi-script and
74don't forget to make it executable.
75
76Example:
77
78create_webpage.sh > /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
79chmod 755 /usr/local/apache2/cgi-bin/my_ipmi_graphs.cgi
80
81Now you can surf to http://my.server.com/cgi-bin/my_ipmi_graphs.cgi and enjoy!
82
83
84The difference between create_webpage.sh and create_webpage_compact.sh is that
85the first script displays sensor thresholds in the graphs. The second script
86collects all sensors that measure the same unit into the same graph thus
87producing a lot fewer graphs.
88
89Note, RRDtool sometimes scales the graphs such that the sensor thresholds
90fall outside the visible area.
91
92
93Happy graphing!
94
95
96