]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_vmstat.c
build: migrate to autotools
[netdata.git] / src / proc_vmstat.c
index 61c04387ca42ee631f408f02dcde79c283cbeeaa..b6c8ce7bed72f5a11df84141f633e9a96246727b 100755 (executable)
@@ -1,11 +1,14 @@
-#include <inttypes.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
+#include "common.h"
 #include "log.h"
-#include "config.h"
+#include "appconfig.h"
 #include "procfile.h"
 #include "rrd.h"
 #include "plugin_proc.h"
@@ -23,7 +26,11 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
 
        if(dt) {};
 
-       if(!ff) ff = procfile_open("/proc/vmstat", " \t:");
+       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);