Imported Upstream version 2.0

This commit is contained in:
Jan Wagner 2014-07-11 21:01:00 +02:00
parent c89ccc3c74
commit 0841b5c7c7
165 changed files with 25440 additions and 4442 deletions

View file

@ -1,9 +1,9 @@
/*****************************************************************************
*
* Nagios check_procs plugin
* Monitoring check_procs plugin
*
* License: GPL
* Copyright (c) 2000-2008 Nagios Plugins Development Team
* Copyright (c) 2000-2008 Monitoring Plugins Development Team
*
* Description:
*
@ -34,7 +34,7 @@
const char *progname = "check_procs";
const char *program_name = "check_procs"; /* Required for coreutils libs */
const char *copyright = "2000-2008";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
const char *email = "devel@monitoring-plugins.org";
#include "common.h"
#include "utils.h"
@ -123,6 +123,7 @@ main (int argc, char **argv)
char *procprog;
pid_t mypid = 0;
pid_t myppid = 0;
struct stat statbuf;
dev_t mydev = 0;
ino_t myino = 0;
@ -172,6 +173,7 @@ main (int argc, char **argv)
/* find ourself */
mypid = getpid();
myppid = getppid();
if (usepid || stat_exe(mypid, &statbuf) == -1) {
/* usepid might have been set by -T */
usepid = 1;
@ -241,6 +243,12 @@ main (int argc, char **argv)
printf("not considering - is myself or gone\n");
continue;
}
/* Ignore parent*/
else if (myppid == procpid) {
if (verbose >= 3)
printf("not considering - is parent\n");
continue;
}
/* filter kernel threads (childs of KTHREAD_PARENT)*/
/* TODO adapt for other OSes than GNU/Linux
@ -707,7 +715,7 @@ print_help (void)
#if defined( __linux__ )
printf (" %s\n", _("ELAPSED - time elapsed in seconds"));
#endif /* defined(__linux__) */
printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
printf (" %s\n", "-v, --verbose");
printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));