- Cacti 0.8 Beginner's Guide
- Thomas Urban
- 369字
- 2021-04-09 21:42:10
- The graph is still missing the Legend, so click on the Add link of the Graph Template Items again.
- Select Comment as the Graph Item Type.
- Enter Running Processes into the Text Format field.
- Click on the Create button.
- Let's add some more statistical information to your Legend. Click on the Add link.
- Select Legend as the Graph Item Type.
- Click on the Create button.
You have added a comment describing the statistical information relating to the graph. The Legend command adds three GPRINT
statements to the graph. The first GPRINT
statement prints the last polled value, the second statement prints the average value of the displayed graph and the last one prints the maximum value polled.
You can now assign this graph template to a device. After you have added the graph template to a device, you need to wait for three polls to pass. The first poll actually creates the necessary RRD file. The other two polls are needed for the RRDtool as it will start graphing values only when it has at least two data values within the RRD file. Once that time has passed, go to Graph Management within the Management section and look for the graph there:

Tip
Turn on graph debugging mode
After turning on the graph debugging option, the graph management page will display the rrdtool
graph command used to create the graph. Any errors, such as a missing RRD file, will be displayed here. This debugging information is useful for troubleshooting the graph generation.
Let's look at the rrdtool
graph
command which Cacti uses to create the preceding graph.
/usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title='Localhost - Running Processes' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label='processes' --slope-mode --font TITLE:12: --font AXIS:8: --font LEGEND:10: --font UNIT:8: DEF:a="/var/www/html/cacti-0.8.7g/rra/localhost_runprocesses_11.rrd":runProcesses:AVERAGE CDEF:cdefc=a,45,50,LIMIT CDEF:cdefd=a,0,44,LIMIT HRULE:50#C0C0C0FF:"Threshold ( 50 )\n" AREA:a#FF0000FF:"Over Threshold" AREA:cdefc#F5F800FF:"Near Threshold" AREA:cdefd#7EE600FF:"Under Threshold\n" COMMENT:"Running Processes" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
Doesn't this one look familiar? It's roughly the same command which you hopefully came up with in the "Have a go hero" challenge in Chapter 2. Here you can see the tight integration of the rrdtool
with the Cacti web interface.
- Moodle 2.0 E/Learning Course Development
- 數碼攝影后期零基礎入門教程
- IBM Lotus Notes 8.5 User Guide: LITE
- 工業產品設計(Inventor 2010)
- 中文版CorelDRAW X6基礎培訓教程(第2版)
- 邊做邊學:Photoshop CS6數碼藝術照片后期處理教程
- WCF Multi/tier Services Development with LINQ
- IBM Lotus Notes and Domino 8.5.1
- 中文版CINEMA 4D R20 實用教程
- 24小時學會Word-Excel-PowerPoint 2010三合一
- Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook
- 邊做邊學:CorelDRAW X6圖形設計案例教程(第2版)(微課版)
- Configuring IPCop Firewalls: Closing Borders with Open Source
- Mobile Web Development
- Photoshop新媒體美工設計(視頻指導版)