Patch for vmstat processing for FreeBSD
Hi,
Another patch that I wanted to keep apart from the others I've just posted because it isn't really related.
I seem to have 2 problems when dealing with vmstat output from FreeBSD.
Unknown variable disk_fd0 when updating the rrd.
Insufficient columns of data provided.
I'm not sure if anything cares about data from vmstat or if it's just stamp collecting. The data doesn't have much value. The messages are annoying though.
Anyway, the problem is that the FreeBSD vmstat command has a variable number of disks displayed. In early versions of FreeBSD (5 and earlier) there were a maximum of 3 devices selected and now (6 and later) there is a maximum of 2. The problem occurs when there aren't that many devices attached. The system will pick any junk it can find to make up the numbers (e.g. pass0) but when that fails, it just displays less devices.
On a virtual system you will commonly only have one disk device attached. No CDs. No Floppy disks. If the attached disk doesn't attach through the CAM layer, there won't be a pass0 device created (it's not really a disk anyway). I have a few virtual systems running using a virtual block device (vtbd) as the only device attached. vmstat can't make anything up so only displays one device.
What this means is that there are no guarantees that you will have the same number of devices on a given system from time to time as devices come and go. It also means that apart from the first disk which will be the main system disk, the actual device types may vary from time to time. They are essentially worthless.
On a server with many disks attached, you will only see the first 2 so the data is incomplete.
My approach has been to ignore all but the first disk and discard the rest, whether there be 0, 1 or 2 extras. No good for multi-disk servers, but then it wasn't anyway. I also cleaned up the column ordering stuff for older systems because it was wrong according to old man pages. Nobody will have a FreeBSD 4 or older system to test this on though.
I'd be interested to know if other systems have variable behaviour like this in their vmstat processing that should be addressed. FreeBSD had special treatment in the code dating back to the transition from the maximum of 3 devices to 2.
As I said before, I don't know if anything takes this data seriously. There is mention in the file about LARRD compatibility but that seems to be really ancient compatibility that I couldn't check.
Cheers,
Brian Scott
participants (1)
-
Brian.Scott@bunyatech.com.au