Hello Monks
I am writing a custom, extensible framework for system monitoring (I am not going to compete with Nagios or Foglight anyway :-).
There are two NFS filesystems that are mounted on a server and I would like to check if the available space falls under a certain amount. Since I would like to do it in the most general way, so that I can reuse my work on other OSs as well, I was looking for a portable way to do it.
I started with Filesystem::Df which seemed the most portable between all solutions I could find with a CPAN search, and it seemed to work fine, until I discovered that it returned no information on the mounted device. This means that if I do $df = df('/mydir') the module handles no mean to check if /mydir was correctly mounted to, say, 10.10.10.10:/export/mydir or not...
I took a look at Filesys::DiskFree, but it uses the approach I don't like: it is an interface to various OSs' df commands.
One solution could be to compare $root = df('/') with $mydir = df('/mydir') and to return a warning if they contain all the same values, but I don't like the approach myself.
Dose someone have any cleaner solution?
Ciao!
--bronto
PS: It seems that df output is the argument of the day today :-)
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz
In reply to Portably get disk free information by bronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |