Re: [PATCH] disk_space: exclude devtmpfs from output

Jan Synacek <[email protected]> Fri, 29 Apr 2016 08:30:36 +0200
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <CAPsXM8WnLFZ-KvcDu+NefipjZnk7=O+wvt46vYUn2Egfym3wLg@mail.gmail.com>
On Thu, Apr 28, 2016 at 8:55 PM, Orion Poplawski <[email protected]>
wrote:

> On 04/27/2016 12:48 AM, Jan Synacek wrote:
> > ---
> >  scripts/services/zz-disk_space | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/services/zz-disk_space
> b/scripts/services/zz-disk_space
> > index 13abf3e..7b9df9c 100755
> > --- a/scripts/services/zz-disk_space
> > +++ b/scripts/services/zz-disk_space
> > @@ -147,7 +147,7 @@ sub DiskFull {
> >  #Main
> >
> >  if ($OSname eq "Linux") {
> > -     $df_options = "-h -x tmpfs -x udf -x iso9660";
> > +     $df_options = "-h -x tmpfs -x devtmpfs -x udf -x iso9660";
> >       if ($local_disks_only) { $df_options .= " -l"; }
> >  } elsif ($OSname eq "Darwin") {
> >       $df_options = "-h";
> > @@ -164,7 +164,7 @@ if ($OSname eq "Linux") {
> >       $df_options = "";
> >       if ($local_disks_only) { $df_options .= " -P"; }
> >  } elsif ($OSname eq "GNU/kFreeBSD") {
> > -     $df_options = "-h -x tmpfs -x udf -x iso9660 -x devfs -x linprocfs
> -x sysfs -x fdescfs";
> > +     $df_options = "-h -x tmpfs -x devtmpfs -x udf -x iso9660 -x devfs
> -x linprocfs -x sysfs -x fdescfs";
> >       if ($local_disks_only) { $df_options .= " -l"; }
> >  } else {
> >       $df_options = "";
> >
>
> This is interesting - while I support adding -x devtmpfs, I wonder if we
> shouldn't remove -x tmpfs as it is often used for /tmp and /run and it is
> useful to know if those are full.  However it is also used for /dev/shm,
> /sys/fs/cgroup, etc. that are uninteresting.
>
> Perhaps we need different options for the DiskSpace() and DiskFull() runs?
>

​What about running df again and concatenating the result (without the
header line)? Something like:

df -lh /tmp /run | tail -n -2

-- 
Jan Synacek
Software Engineer, Red Hat

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

_______________________________________________
Logwatch-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/logwatch-devel