I'm looking to add a LVM volume to a Logwatch report for a Xen dom0. Currently this LVM volume doesn't show in the report as it is not mounted on the machine but is a physical drive. Any ideas on how to accomplish that?
I have no other reason for this drive to be mounted (it is used for domU's). Open to suggestions!
To report FS usage, logwatch invokes
df
which only queries mounted filesystems. You'll need to change this logic. I suggest mounting-invoking-unmounting since there's no universal way to query an unmounted filesystem (moreover, it may be in use by something like fsck/mkfs/dd and/or unformatted so the info obtained could be garbage).The script for you to edit is
/usr/share/logwatch/scripts/services/zz-disk-space
(and probably its configuration file,/usr/share/logwatch/default.conf/services/zz-disk-space.conf
). Both are written in Perl.Thanks for the suggestions. I figured out a solution that I was looking for, which was pretty simple in the end. Nothing fancy to see here but, this is what I added to zz-disk_space.conf:
Or, if you would prefer a less verbose output, I found the -s to be more concise.
The echo is there to add a line break between the outputs so they are visually separated and more consistent with the rest of the Logwatch report.