#include "common.h"
#include "plugin.h"
+#include "utils_complain.h"
+
#if HAVE_MACH_MACH_TYPES_H
# include <mach/mach_types.h>
#endif
/* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */
#elif KERNEL_LINUX
+ static c_complain_t acpi_dir_complaint = C_COMPLAIN_INIT_STATIC;
+
FILE *fh;
char buffer[1024];
char filename[256];
battery_submit ("0", "voltage", voltage);
}
- walk_directory (battery_acpi_dir, battery_read_acpi,
- /* user_data = */ NULL);
+ if (0 == access (battery_acpi_dir, R_OK))
+ walk_directory (battery_acpi_dir, battery_read_acpi,
+ /* user_data = */ NULL);
+ else
+ {
+ char errbuf[1024];
+ c_complain_once (LOG_WARNING, &acpi_dir_complaint,
+ "battery plugin: Failed to access `%s': %s",
+ battery_acpi_dir,
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ }
#endif /* KERNEL_LINUX */
/**
* collectd - src/cpu.c
* Copyright (C) 2005-2009 Florian octo Forster
- * Copyright (C) 2009 Simon Kuhnle
+ * Copyright (C) 2008 Oleg King
+ * Copyright (C) 2009 Simon Kuhnle
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* Authors:
* Florian octo Forster <octo at verplant.org>
+ * Oleg King <king2 at kaluga.ru>
* Simon Kuhnle <simon at blarzwurst.de>
**/
/**
* collectd - src/interface.c
- * Copyright (C) 2005-2007 Florian octo Forster
+ * Copyright (C) 2005-2008 Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/**
* collectd - src/memory.c
- * Copyright (C) 2005-2007 Florian octo Forster
+ * Copyright (C) 2005-2008 Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/**
* collectd - src/ping.c
- * Copyright (C) 2005,2006 Florian octo Forster
+ * Copyright (C) 2005-2007 Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
pse.num_proc = 1;
pse.num_lwp = procs[i].ki_numthreads;
+ pse.vmem_size = procs[i].ki_size;
pse.vmem_rss = procs[i].ki_rssize * getpagesize();
+ pse.stack_size = procs[i].ki_ssize * getpagesize();
pse.vmem_minflt = 0;
pse.vmem_minflt_counter = procs[i].ki_rusage.ru_minflt;
pse.vmem_majflt = 0;