Here are some scripts that can be used to monitor the secondary cache of ZFS: L2ARC.
L2ARC is usually set up as one or more SSDs.
The script has a quite heavy dependency of ROOT (the data analysis framework, not the privilege level or the plant's organ). The script only works on Linux.
The package contains:
arc-cmd.sh, which is a data logger that writes to /tmp/arcstats.txt.
ArcPlot.py, which displays a live graph of four variables, and saves a PDF file when it exits
You need to install the package root-python, as a dependency
Download the L2ARC monitoring package here.
Keep arc-cmd.sh going all the time, to record data (if /tmp/arcstats.txt gets too big, just delete it). Exit using Ctrl-C.
To open the plots, call
This displays data for the last 2000 seconds. You can give an argument N, like
python ArcPlot.py N
to show data for the last N seconds. If N=0, it displays all data.
None of the menus work (they are added by ROOT). The only way to exit ArcPlot is to press Ctrl-C at the terminal!
l2_hits: number of times data was served from the L2ARC
l2_misses: number of times data was not in the ARC (memory cache) or L2ARC, but had to be read from the main pool instead. Comparing hits and misses can be misleading if the vertical scale is different. Remember to look at the units on the axis before drawing conclusions.
l2_write_bytes: Number of bytes written to the cache device. Note: the vertical axis will have “x 106 “ or “x 109 “ next to it, which means that you should multiply the number with a million and a billion, respectively. It's not exactly the same as MB and GB, it's the kind of GB that hard drive manufacturers use.
l2_size: Size in bytes of the cached data (not sure about the exact definition)
size: Size of the ARC. This is not directly related to the L2ARC, but it's included because it's useful.
Note: This script is very primitive and I wanted to make it better, but then I wouldn't have time to finish it.
Contact: Marius Bjornstad <email@example.com>
Also see http://zfsonlinux.org