0

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!

user98651
  • 95
  • 1
  • 2
  • 11

2 Answers2

1

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.

ivan_pozdeev
  • 352
  • 4
  • 13
0

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:

$disk_cmd = "{ df $df_options ; echo ; } & vgdisplay"

Or, if you would prefer a less verbose output, I found the -s to be more concise.

$disk_cmd = "{ df $df_options ; echo ; } & vgdisplay -s "

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.

user98651
  • 95
  • 1
  • 2
  • 11