viernes, 12 de marzo de 2010

ZFS file access monitor dtrace script

I have created this small DTrace script to monitor the file access on a ZFS file system (it does not work on other File Systems). It uses one single argument, the file you are going to monitor. It will print the DATE access, the process using the file, the operation over the file (Read/Write/Delete), the USER, and the PID.

It will work everytime some process do something over the monitored file. It monitors writes, reads and the delete of the file. It will even work if the file is accessed through a soft link.

I created this script because one of our customers detected a rare behaviour over the /var/adm/messages file and they wanted to monitor this file access somehow.

More info at:
http://blogs.corenetworks.es/2010/03/zfs-file-access-monitor-dtrace-script/