Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make df_inode plugin more robust.

Some file systems do not have inodes, which make "df" report a "-"
instead of a number. If the used and available inode field is not
numeric, it does not make sense to try to calculate a percentage.

If that happens, we skip calculating inodes for this filesystem.
  • Loading branch information...
commit ec3cbe473089d3b8c3c2fd005d67a9467aa29f3b 1 parent dd2854e
@ssm ssm authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  plugins/node.d.linux/df_inode.in
View
2  plugins/node.d.linux/df_inode.in
@@ -150,6 +150,8 @@ while (<DF>) {
next if skip($name, $mountpt);
+ next unless ($used =~ '^\d+' && $avail =~ '^\d+');
+
# Calculate percentage used
my $ps = 0;
$ps = ($used / ($used+$avail)) * 100 if $used;
Please sign in to comment.
Something went wrong with that request. Please try again.