]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_vmstat.c
Merge pull request #17 from alonbl/build
[netdata.git] / src / proc_vmstat.c
index 0842ebe0e538311eecf63a888715074218c35fd0..b6c8ce7bed72f5a11df84141f633e9a96246727b 100755 (executable)
@@ -1,4 +1,6 @@
-#include <inttypes.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -6,7 +8,7 @@
 
 #include "common.h"
 #include "log.h"
-#include "config.h"
+#include "appconfig.h"
 #include "procfile.h"
 #include "rrd.h"
 #include "plugin_proc.h"
@@ -24,7 +26,11 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
 
        if(dt) {};
 
-       if(!ff) ff = procfile_open("/proc/vmstat", " \t:", PROCFILE_FLAG_DEFAULT);
+       if(!ff) {
+               char filename[FILENAME_MAX + 1];
+               snprintf(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/vmstat");
+               ff = procfile_open(config_get("plugin:proc:/proc/vmstat", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
+       }
        if(!ff) return 1;
 
        ff = procfile_readall(ff);