LinHES Forums
http://forum.linhes.org/

rrd_MythFS.pl and df Line Wrapping?
http://forum.linhes.org/viewtopic.php?f=6&t=20131
Page 1 of 1

Author:  opel70 [ Wed Jul 08, 2009 1:45 pm ]
Post subject:  rrd_MythFS.pl and df Line Wrapping?

Hello,

I just put together a new NAS box and have updated my rrd scripts to pull info from it. However, the rrd_MythFS.pl isn't returning anything because the mount point is too long. The output of df is:
Code:
Filesystem            Size  Used Avail Use% Mounted on
freenas:/mnt/data/myth/tv3
                      1.8T  284G  1.4T  18% /myth/tv3

So, with my limited scripting knowledge, how can I fix this? I figure I either need to make df not line wrap, or modify the rrd script to check both lines. Neither of which I know how to do.

Any ideas?

Author:  tjc [ Wed Jul 08, 2009 9:29 pm ]
Post subject: 

You might try the -P option to see if that stays on one line.

Author:  opel70 [ Thu Jul 09, 2009 7:36 pm ]
Post subject: 

Again, thanks. That solved the issue perfectly. I modified my rrd_MythFS.pl to add in the "P" option and it is now collecting data.

I'll get this Linux-thing figured out eventually.

Author:  tjc [ Thu Jul 09, 2009 7:47 pm ]
Post subject: 

For future reference I just did "man df" and looked for options that produced different output formats.

Also, if you have a minute, please go file a flyspray ticket suggesting adding this fix to the script.

Thanks!

Author:  opel70 [ Thu Jul 09, 2009 8:50 pm ]
Post subject: 

It never even crossed my mind to try to change the output of "df". I just went straight to thinking you would need to change the parsing. Need to remember to try and look at things differently when stuck.

Anyway, Flyspray ticket added: http://linhes.org/flyspray/index.php?do ... ask_id=431

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/