X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=46ba6652953726ce0b7d90aecea2345f681ec64b;hb=e7a75874a24c1bf19931d5b4b423a0daa7f9be6b;hp=68a5b71c84cfbbfee5e7a746115417c6ffc44a0e;hpb=96c474f576c721c6d993025b99c55de375552259;p=collectd.git diff --git a/src/swap.c b/src/swap.c index 68a5b71c..46ba6652 100644 --- a/src/swap.c +++ b/src/swap.c @@ -259,7 +259,7 @@ static int swap_read (void) if (numfields != 2) continue; - if (strcasecmp ("pswpin", fields[0]) != 0) + if (strcasecmp ("pswpin", fields[0]) == 0) strtoderive (fields[1], &swap_in); else if (strcasecmp ("pswpout", fields[0]) == 0) strtoderive (fields[1], &swap_out); @@ -284,10 +284,10 @@ static int swap_read (void) sstrerror (errno, errbuf, sizeof (errbuf))); } - swap_submit ("used", swap_used, DS_TYPE_GAUGE); - swap_submit ("free", swap_free, DS_TYPE_GAUGE); - swap_submit ("cached", swap_cached, DS_TYPE_GAUGE); - swap_submit ("in", swap_in, DS_TYPE_DERIVE); + swap_submit ("used", 1024 * swap_used, DS_TYPE_GAUGE); + swap_submit ("free", 1024 * swap_free, DS_TYPE_GAUGE); + swap_submit ("cached", 1024 * swap_cached, DS_TYPE_GAUGE); + swap_submit ("in", swap_in, DS_TYPE_DERIVE); swap_submit ("out", swap_out, DS_TYPE_DERIVE); /* #endif KERNEL_LINUX */