From: Florian Forster Date: Sat, 17 Jun 2006 18:33:18 +0000 (+0200) Subject: processes plugin: Added some more error- and debug-messages. X-Git-Tag: collectd-3.10.0~20^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f37b1324a7b40274fe4f333952177059b7025fc2;p=collectd.git processes plugin: Added some more error- and debug-messages. Mostly to play with the merging of git, though ;) --- diff --git a/src/processes.c b/src/processes.c index fae1c2d0..dba29eff 100644 --- a/src/processes.c +++ b/src/processes.c @@ -161,6 +161,9 @@ static void ps_submit (int running, blocked) >= BUFSIZE) return; + DBG ("running = %i; sleeping = %i; zombies = %i; stopped = %i; paging = %i; blocked = %i;", + running, sleeping, zombies, stopped, paging, blocked); + plugin_submit (MODULE_NAME, "-", buf); } @@ -369,12 +372,15 @@ static void ps_read (void) if ((fh = fopen (filename, "r")) == NULL) { - syslog (LOG_ERR, "Cannot open `%s': %s", filename, strerror (errno)); + syslog (LOG_NOTICE, "Cannot open `%s': %s", filename, + strerror (errno)); continue; } if (fgets (buf, BUFSIZE, fh) == NULL) { + syslog (LOG_NOTICE, "Unable to read from `%s': %s", + filename, strerror (errno)); fclose (fh); continue; } @@ -382,7 +388,10 @@ static void ps_read (void) fclose (fh); if (strsplit (buf, fields, BUFSIZE) < 3) + { + DBG ("Line has less than three fields."); continue; + } switch (fields[2][0]) { @@ -395,7 +404,7 @@ static void ps_read (void) } } - closedir(proc); + closedir (proc); ps_submit (running, sleeping, zombies, stopped, paging, blocked); #endif /* KERNEL_LINUX */