summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfa5989)
raw | patch | inline | side by side (parent: dfa5989)
author | Paul Sadauskas <psadauskas@gmail.com> | |
Thu, 30 Jul 2009 06:31:58 +0000 (08:31 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 30 Jul 2009 06:33:57 +0000 (08:33 +0200) |
src/collectd.conf.pod | patch | blob | history | |
src/df.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 8a5f6fdecd86a5fe638639ea8e4d82628f72ca65..64837553412a27b6fa74dbcea70da27711aae7e0 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
partitions are collected if a selection is made. If no selection is configured
at all, B<all> partitions are selected.
+=item B<ReportByDevice> I<true>|I<false>
+
+Report using the device name rather than the mountpoint. i.e. with this I<false>,
+(the default), it will report a disk as "root", but with it I<true>, it will be
+"sda1" (or whichever).
+
=back
=head2 Plugin C<disk>
diff --git a/src/df.c b/src/df.c
index dedf1bf59bb8ee096bc2310358191f53b229218f..a9c1bdb7b815cc7322290939534a1f0a6a13e091 100644 (file)
--- a/src/df.c
+++ b/src/df.c
|| (strcasecmp (value, "Yes") == 0)
|| (strcasecmp (value, "On") == 0))
{
- by_device = false;
+ by_device = true;
}
return (0);
}
if (by_device)
{
// eg, /dev/hda1 -- strip off the "/dev/"
- strncpy (disk_name, mnt_ptr->device + 5, sizeof (disk_name));
+ strncpy (disk_name, mnt_ptr->spec_device + 5, sizeof (disk_name));
+ if (strlen(disk_name) < 1)
+ {
+ DEBUG("df: no device name name for mountpoint %s, skipping", mnt_ptr->dir);
+ continue;
+ }
}
else
{