|
|
| Author |
Message |
Chappy
Joined: 22 Aug 2008 Posts: 3
|
Posted: Wed Sep 10, 2008 1:48 pm Post subject: Template Architecture/Design Review |
|
|
After much trial and error I just built my first graph template. It works great, but the process flow is not as refined as I like - or think it should be.
I'm graphing the output from the iostat command using a perl script. The iostat perl script lives on each client. I have a data input method that calls that script via ssh (using shared-key authentication). So this script, and cacti's pub key has to live on each server I wish to graph. This is where I believe there is a better way. I've tried using an snmp extend to map the output of the cacti-iostat.pl script to an OID, and didn't have much luck. It's very possible I screwed up the configuration for grabbing that OID.
I was hoping to have some Cacti gurus take a look and weigh in with thoughts for improvement.
The process flow is:
- Data Input Method Script/Command: ssh root@<hostname> '/usr/local/sbin/cacti-iostat.pl <dev>'
- Data Template
- Graph Template
Script (borrowed from http://www.dreness.com/blog/archives/33):
| Code: | #!/usr/bin/perl -w
# get iostat output
chomp ($iostats = `iostat -x -d -k 1 5 | tail -n 2 | grep $ARGV[0] | awk '{print \$1 " " \$2 " " \$3 " " \$4 " " \$5 " " \$6 " " \$7 " " \$8 " " \$9 " " \$10 " " \$11 " " \$12}'`);
@iostats = split(/\s/, $iostats);
$Device = $iostats[0];
$rrqm = $iostats[1];
$wrqm = $iostats[2];
$reads = $iostats[3];
$writes = $iostats[4];
$rsec = $iostats[5];
$wsec = $iostats[6];
$avgrqsz = $iostats[7];
$avgqusz = $iostats[8];
$await = $iostats[9];
$svctm = $iostats[10];
$util = $iostats[11];
print "device\:$Device rrqm\:$rrqm wrqm\:$wrqm reads\:$reads writes\:$writes rkb\:$rsec wkb\:$wsec avgrqsz\:$avgrqsz avgqusz\:$avgqusz await\:$await svctm\:$svctm util\:$util"; |
Output:
| Code: | # perl cacti-iostat.pl sda
device:sda rrqm:0.00 wrqm:22.77 reads:0.00 writes:1.98 rkb:0.00 wkb:99.01 avgrqsz:100.00 avgqusz:0.01 await:3.00 svctm:3.00 util:0.59 |
As you can see from the image attachments, the Data Input Method is parsing the cacti-iostat.pl output and storing that in an RRD file. The Graph Template is Data Source as it's Item Inputs.
Anyone have any thoughts for improvement?
| Description: |
|
| Filesize: |
103.98 KB |
| Viewed: |
1090 Time(s) |

|
| Description: |
|
| Filesize: |
129.98 KB |
| Viewed: |
1090 Time(s) |

|
| Description: |
|
| Filesize: |
36.99 KB |
| Viewed: |
1090 Time(s) |

|
| Description: |
|
| Filesize: |
19.68 KB |
| Viewed: |
1090 Time(s) |

|
| Description: |
| iostat Average Request Size |
|
| Filesize: |
24.82 KB |
| Viewed: |
1090 Time(s) |

|
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Thu Sep 11, 2008 12:12 pm Post subject: |
|
|
Please find help and a similar step-by-step procedure at the first link of my sig. It still seems to not be that popular as I though it should
Reinhard
|
|
| Back to top |
|
 |
Chappy
Joined: 22 Aug 2008 Posts: 3
|
Posted: Thu Sep 11, 2008 2:30 pm Post subject: |
|
|
Edit:
Hmm, now I see your signature. Never mind then, I'll take a look!
--
Hi Reinhard,
I'm not seeing your sig and I can not find anything relevant in your profile either.
Are you referring to the Cacti Manual (http://docs.cacti.net/?q=node/438)?
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Fri Sep 12, 2008 2:13 pm Post subject: |
|
|
Not to the manual, but the HowTo. You will see my sig when logging into the forum
Reinhard
|
|
| Back to top |
|
 |
|