From f37b1324a7b40274fe4f333952177059b7025fc2 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 17 Jun 2006 20:33:18 +0200 Subject: [PATCH] processes plugin: Added some more error- and debug-messages. Mostly to play with the merging of git, though ;) --- src/processes.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 */ -- 2.30.2