summaryrefslogtreecommitdiffstats
path: root/plugins/check_procs.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_procs.c')
-rw-r--r--plugins/check_procs.c102
1 files changed, 47 insertions, 55 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 31a2bed..2c8c379 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -677,54 +677,47 @@ print_help (void)
677 677
678 print_usage (); 678 print_usage ();
679 679
680 printf(_("\n\ 680 printf ("%s\n", _("Required Arguments:"));
681Required Arguments:\n\ 681 printf (" %s\n", "-w, --warning=RANGE");
682 -w, --warning=RANGE\n\ 682 printf (" %s\n", _("Generate warning state if metric is outside this range"));
683 Generate warning state if metric is outside this range\n\ 683 printf (" %s\n", "-c, --critical=RANGE");
684 -c, --critical=RANGE\n\ 684 printf (" %s\n", _("Generate critical state if metric is outside this range"));
685 Generate critical state if metric is outside this range\n")); 685
686 686 printf ("%s\n", _("Optional Arguments:"));
687 printf(_("\n\ 687 printf (" %s\n", "-m, --metric=TYPE");
688Optional Arguments:\n\ 688 printf (" %s\n", _("Check thresholds against metric. Valid types:"));
689 -m, --metric=TYPE\n\ 689 printf (" %s\n", _("PROCS - number of processes (default)"));
690 Check thresholds against metric. Valid types:\n\ 690 printf (" %s\n", _("VSZ - virtual memory size"));
691 PROCS - number of processes (default)\n\ 691 printf (" %s\n", _("RSS - resident set memory size"));
692 VSZ - virtual memory size\n\ 692 printf (" %s\n", _("CPU - percentage cpu"));
693 RSS - resident set memory size\n\
694 CPU - percentage cpu\n"));
695/* only linux etime is support currently */ 693/* only linux etime is support currently */
696#if defined( __linux__ ) 694#if defined( __linux__ )
697 printf(_("\ 695 printf (" %s\n", _("ELAPSED - time elapsed in seconds"));
698 ELAPSED - time elapsed in seconds\n"));
699#endif /* defined(__linux__) */ 696#endif /* defined(__linux__) */
700 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 697 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
701 698
702 printf(_("\ 699 printf (" %s\n", "-v, --verbose");
703 -v, --verbose\n\ 700 printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));
704 Extra information. Up to 3 verbosity levels\n")); 701
705 702 printf ("%s\n", "Optional Filters:");
706 printf(_("\n\ 703 printf (" %s\n", "-s, --state=STATUSFLAGS");
707Optional Filters:\n\ 704 printf (" %s\n", _("Only scan for processes that have, in the output of `ps`, one or"));
708 -s, --state=STATUSFLAGS\n\ 705 printf (" %s\n", _("more of the status flags you specify (for example R, Z, S, RS,"));
709 Only scan for processes that have, in the output of `ps`, one or\n\ 706 printf (" %s\n", _("RSZDT, plus others based on the output of your 'ps' command)."));
710 more of the status flags you specify (for example R, Z, S, RS,\n\ 707 printf (" %s\n", "-p, --ppid=PPID");
711 RSZDT, plus others based on the output of your 'ps' command).\n\ 708 printf (" %s\n", _("Only scan for children of the parent process ID indicated."));
712 -p, --ppid=PPID\n\ 709 printf (" %s\n", "-z, --vsz=VSZ");
713 Only scan for children of the parent process ID indicated.\n\ 710 printf (" %s\n", _("Only scan for processes with vsz higher than indicated."));
714 -z, --vsz=VSZ\n\ 711 printf (" %s\n", "-r, --rss=RSS");
715 Only scan for processes with vsz higher than indicated.\n\ 712 printf (" %s\n", _("Only scan for processes with rss higher than indicated."));
716 -r, --rss=RSS\n\ 713 printf (" %s\n", "-P, --pcpu=PCPU");
717 Only scan for processes with rss higher than indicated.\n")); 714 printf (" %s\n", _("Only scan for processes with pcpu higher than indicated."));
718 715 printf (" %s\n", "-u, --user=USER");
719 printf(_("\ 716 printf (" %s\n", _("Only scan for processes with user name or ID indicated."));
720 -P, --pcpu=PCPU\n\ 717 printf (" %s\n", "-a, --argument-array=STRING");
721 Only scan for processes with pcpu higher than indicated.\n\ 718 printf (" %s\n", _("Only scan for processes with args that contain STRING."));
722 -u, --user=USER\n\ 719 printf (" %s\n", "-C, --command=COMMAND");
723 Only scan for processes with user name or ID indicated.\n\ 720 printf (" %s\n", _("Only scan for exact matches of COMMAND (without path)."));
724 -a, --argument-array=STRING\n\
725 Only scan for processes with args that contain STRING.\n\
726 -C, --command=COMMAND\n\
727 Only scan for exact matches of COMMAND (without path).\n"));
728 721
729 printf(_("\n\ 722 printf(_("\n\
730RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n\ 723RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n\
@@ -738,18 +731,17 @@ the specified threshold ranges. The process count can be filtered by\n\
738process owner, parent process PID, current state (e.g., 'Z'), or may\n\ 731process owner, parent process PID, current state (e.g., 'Z'), or may\n\
739be the total number of running processes\n\n")); 732be the total number of running processes\n\n"));
740 733
741 printf(_("\ 734 printf ("%s\n", _("Examples:"));
742Examples:\n\ 735 printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
743 check_procs -w 2:2 -c 2:1024 -C portsentry\n\ 736 printf (" %s\n", _("Warning if not two processes with command name portsentry."));
744 Warning if not two processes with command name portsentry. Critical\n\ 737 printf (" %s\n\n", _("Critical if < 2 or > 1024 processes"));
745 if < 2 or > 1024 processes\n\n\ 738 printf (" %s\n", "check_procs -w 10 -a '/usr/local/bin/perl' -u root");
746 check_procs -w 10 -a '/usr/local/bin/perl' -u root\n\ 739 printf (" %s\n", _("Warning alert if > 10 processes with command arguments containing"));
747 Warning alert if > 10 processes with command arguments containing \n\ 740 printf (" %s\n\n", _("'/usr/local/bin/perl' and owned by root"));
748 '/usr/local/bin/perl' and owned by root\n\n\ 741 printf (" %s\n", "check_procs -w 50000 -c 100000 --metric=VSZ");
749 check_procs -w 50000 -c 100000 --metric=VSZ\n\ 742 printf (" %s\n\n", _("Alert if vsz of any processes over 50K or 100K"));
750 Alert if vsz of any processes over 50K or 100K\n\ 743 printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU");
751 check_procs -w 10 -c 20 --metric=CPU\n\ 744 printf (" %s\n\n", _("Alert if cpu of any processes over 10%% or 20%%"));
752 Alert if cpu of any processes over 10%% or 20%%\n\n"));
753 745
754 printf (_(UT_SUPPORT)); 746 printf (_(UT_SUPPORT));
755} 747}