FreeBSD Mbufs and clusters

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
geekgod
Posts: 4
Joined: Fri Nov 29, 2002 6:37 pm

FreeBSD Mbufs and clusters

Post by geekgod »

Here's a small script I just hacked out to record the freebsd mbufs and clusters information. Let me know what you think....

The output string format will be:
<currentmbufs> <peakmbufs> <maxmbufs> <currentclusters> <peakclusters> <maxclusters> <allocated> <denied> <delayed> <drain>

Hope this helps someone. I just built this on a stacked graph and it looks sweet!!!

-GG

---------- SCRIPT FOLLOWS ----------

#!/usr/bin/perl

$results = `netstat -m`;

$results =~ m/(.*)\/(.*)\/(.*) mbufs in use/;

$current = $1;
$peak = $2;
$max = $3;

$results =~ m/(.*)\/(.*)\/(.*) mbuf clusters in use/;

$currentclusters = $1;
$peakclusters = $2;
$maxclusters = $3;

$results =~ m/(.*) Kbytes allocated to network/;

$allocated = $1;

$results =~ m/(.*) requests for memory denied/;

$denied = $1;

$results =~ m/(.*) requests for memory delayed/;

$delayed = $1;

$results =~ m/(.*) calls to protocol drain routines/;

$drain = $1;

$results =~ m/s(.*) mbufs allocated to data/;
$allocateddata = $1;

print "$current $peak $max $currentclusters $peakclusters $maxclusters $allocated $denied $delayed $drain $allocateddata";
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest