Index: head/net-mgmt/nagios-plugins/Makefile =================================================================== --- head/net-mgmt/nagios-plugins/Makefile (revision 448906) +++ head/net-mgmt/nagios-plugins/Makefile (revision 448907) @@ -1,172 +1,172 @@ # Created by: Blaz Zupan # $FreeBSD$ PORTNAME= nagios-plugins PORTVERSION= 2.2.1 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= https://www.nagios-plugins.org/download/ \ LOCAL/mat/${PORTNAME} MAINTAINER= mat@FreeBSD.org COMMENT= Plugins for Nagios LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING CONFLICTS_INSTALL= monitoring-plugins-* USES= charsetfix gmake perl5 libtool ssl USE_SUBMAKE= yes OPTIONS_DEFINE= QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 NLS DBI EXTRAOPTS SSH_PORTABLE OPTIONS_SINGLE= DNS OPTIONS_SINGLE_DNS= DNS_BASE DNS_BINDTOOLS DNS_BIND99 DNS_BIND910 DNS_BIND911 OPTIONS_DEFAULT=EXTRAOPTS DNS_BASE OPTIONS_SUB= yes QSTAT_DESC= Game server query support (check_game) FPING_DESC= Support for non-flooding fast ping (check_fping) NETSNMP_DESC= SNMP support (check_snmp) RADIUS_DESC= Radius support (check_radius) MYSQL_DESC= MySQL support (check_mysql) PGSQL_DESC= PostgreSQL support (check_pgsql) LDAP_DESC= OpenLDAP support (check_ldap) DBI_DESC= Check database using DBI EXTRAOPTS_DESC= Parsing of plugins ini config files for extra options SSH_PORTABLE_DESC= Build check_ssh with ports openssh (instead of base) DNS_DESC= Configuration of check_dig and check_dns (see help) DNS_BASE_DESC= >= 10 means drill for check_dig and no check_dns DNS_BINDTOOLS_DESC= Use dig and nslookup from dns/bind-tools DNS_BIND99_DESC= Use dig and nslookup from dns/bind99 DNS_BIND910_DESC= Use dig and nslookup from dns/bind910 DNS_BIND911_DESC= Use dig and nslookup from dns/bind911 EXTRAOPTS_CONFIGURE_ENABLE= extra-opts GNU_CONFIGURE= yes NAGIOSUSER?= nagios NAGIOSGROUP?= nagios NAGIOSDIR?= /var/spool/nagios NAGIOSWWWDIR?= www/nagios NAGIOSHTMURL?= /nagios NAGIOSCGIURL?= ${NAGIOSHTMURL}/cgi-bin CONFIGURE_ARGS+=--with-nagios-user=${NAGIOSUSER} \ --with-nagios-group=${NAGIOSGROUP} \ --with-cgiurl=${NAGIOSCGIURL} \ --sbindir=${PREFIX}/${NAGIOSWWWDIR}/cgi-bin \ --libexecdir=${PREFIX}/libexec/nagios \ --datadir=${PREFIX}/share \ --sysconfdir=${PREFIX}/etc/nagios \ --localstatedir=${NAGIOSDIR} \ --with-perl=${PERL} \ --prefix=${PREFIX} # Also, force some commands with their expected paths so that they don't get # disabled. CONFIGURE_ARGS+=ac_cv_path_PATH_TO_QMAIL_QSTAT=/var/qmail/bin/qmail-qstat \ ac_cv_path_PATH_TO_PING=/sbin/ping \ ac_cv_path_PATH_TO_PING6=/sbin/ping6 \ --with-ping-command="/sbin/ping -n -t %d -c %d %s" \ --with-ping6-command="/sbin/ping6 -n -X %d -c %d %s" \ ac_cv_path_PATH_TO_SUDO=${LOCALBASE}/bin/sudo \ ac_cv_path_PATH_TO_SMBCLIENT=${LOCALBASE}/bin/smbclient CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib QSTAT_BUILD_DEPENDS= qstat:games/qstat QSTAT_RUN_DEPENDS= qstat:games/qstat QSTAT_CONFIGURE_OFF= ac_cv_path_PATH_TO_QUAKESTAT= \ ac_cv_path_PATH_TO_QSTAT= IPV6_CONFIGURE_WITH= ipv6 FPING_BUILD_DEPENDS= fping:net/fping FPING_RUN_DEPENDS= fping:net/fping FPING_CONFIGURE_OFF= ac_cv_path_PATH_TO_FPING= \ ac_cv_path_PATH_TO_FPING6= NETSNMP_BUILD_DEPENDS= snmpcheck:net-mgmt/net-snmp \ p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP NETSNMP_RUN_DEPENDS= snmpcheck:net-mgmt/net-snmp \ p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP NETSNMP_CONFIGURE_OFF= ac_cv_path_PATH_TO_SNMPGET= \ ac_cv_path_PATH_TO_SNMPGETNEXT= RADIUS_LIB_DEPENDS= libradiusclient-ng.so:net/radiusclient RADIUS_CONFIGURE_WITH= radius MYSQL_USE= mysql=yes MYSQL_CONFIGURE_WITH= mysql=${LOCALBASE} PGSQL_USES= pgsql PGSQL_CONFIGURE_WITH= pgsql=${LOCALBASE} LDAP_USE= openldap=yes LDAP_CONFIGURE_WITH= ldap NLS_USES= gettext NLS_CONFIGURE_ENABLE= nls DBI_LIB_DEPENDS= libdbi.so:databases/libdbi DBI_CONFIGURE_WITH= dbi DNS_BINDTOOLS_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind-tools DNS_BINDTOOLS_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \ --with-nslookup-command=${LOCALBASE}/bin/nslookup DNS_BIND99_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind99 DNS_BIND99_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \ --with-nslookup-command=${LOCALBASE}/bin/nslookup DNS_BIND910_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind910 DNS_BIND910_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \ --with-nslookup-command=${LOCALBASE}/bin/nslookup DNS_BIND911_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind911 DNS_BIND911_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \ --with-nslookup-command=${LOCALBASE}/bin/nslookup SSH_PORTABLE_BUILD_DEPENDS= ${LOCALBASE}/bin/ssh:security/openssh-portable SSH_PORTABLE_RUN_DEPENDS:= ${SSH_PORTABLE_BUILD_DEPENDS} SSH_PORTABLE_CONFIGURE_ON= --with-ssh-command=${LOCALBASE}/bin/ssh .include .if ${PORT_OPTIONS:MDNS_BASE} EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff CONFIGURE_ARGS+=--with-dig-command=/usr/bin/drill \ ac_cv_path_PATH_TO_NSLOOKUP= PLIST_SUB+= CHECK_DNS="@comment " .else . if ${PORT_OPTIONS:MDNS_BASE} CONFIGURE_ARGS+= --with-dig-command=/usr/bin/dig \ --with-nslookup-command=/usr/bin/nslookup . endif PLIST_SUB+= CHECK_DNS="" .endif .if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE) PLIST_SUB+= SSH="@comment " .else PLIST_SUB+= SSH="" .endif post-patch: .for file in check_by_ssh.c check_disk.c check_http.c check_mrtgtraf.c \ check_nagios.c check_ntp.c check_ntp_peer.c check_ntp_time.c \ check_pgsql.c check_snmp.c check_ssh.c check_swap.c check_time.c \ check_users.c @${REINPLACE_CMD} -e 's|setlocale (LC_ALL, "");|setlocale (LC_ALL, ""); setlocale(LC_NUMERIC, "C");|g' ${WRKSRC}/plugins/${file} .endfor @${REINPLACE_CMD} -e 's|chown root|${TRUE}|g' ${WRKSRC}/plugins-root/Makefile.in # add a fake PATH so that it gets set to a correct value during build. @${REINPLACE_CMD} -e "s|$$ENV{'PATH'}=''|$$ENV{'PATH'}='foo'|; \ s|/usr/bin/|${LOCALBASE}/bin/|g" \ ${WRKSRC}/plugins-scripts/*.pl .include Index: head/net-mgmt/nagios-plugins/files/patch-configure =================================================================== --- head/net-mgmt/nagios-plugins/files/patch-configure (revision 448906) +++ head/net-mgmt/nagios-plugins/files/patch-configure (revision 448907) @@ -1,20 +1,18 @@ ---- configure.orig 2017-04-19 18:03:27.000000000 +0200 -+++ configure -@@ -22004,7 +22004,7 @@ - $as_echo "$ac_cv_ps_command" >&6; } +--- configure.orig 2017-04-19 16:03:27 UTC ++++ configure +@@ -21973,6 +21973,15 @@ $as_echo "$as_me: error: I don't know ho + fi - elif ps -axwwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \ -- egrep -i "^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND" > /dev/null -+ egrep -i "^ *STAT +COMMAND +VSZ +RSS +USER +UID +PID +PPID +COMMAND" > /dev/null - then - ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos" - ac_cv_ps_command="$PATH_TO_PS -axwwo 'stat uid pid ppid vsz rss pcpu comm args'" -@@ -23798,7 +23798,7 @@ - if $PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null - then -- ac_cv_swap_format="%*s %f %*d %f" -+ ac_cv_swap_format="%*s %lf %*d %lf" - ac_cv_swap_conv=1024 - { $as_echo "$as_me:$LINENO: result: using FreeBSD format swapinfo" >&5 - $as_echo "using FreeBSD format swapinfo" >&6; } ++elif ps -axwo 'stat comm vsz rss user uid pid ppid jid args' 2>/dev/null | \ ++ egrep -i "^ *STAT +COMMAND +VSZ +RSS +USER +UID +PID +PPID +JID +COMMAND" > /dev/null ++then ++ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procjid,&procvsz,&procrss,&procpcpu,procprog,&pos" ++ ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid jid vsz rss pcpu comm args'" ++ ac_cv_ps_format="%s %d %d %d %d %d %d %f %s %n" ++ ac_cv_ps_cols=10 ++ { $as_echo "$as_me:$LINENO: result: $ac_cv_ps_command" >&5 ++ $as_echo "$ac_cv_ps_command" >&6; } + elif ps axwwo 'stat comm vsz rss user uid pid ppid args cgroup:256' 2>/dev/null | \ + egrep -i "^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND +CGROUP" > /dev/null + then Index: head/net-mgmt/nagios-plugins/files/patch-plugins_check__procs.c =================================================================== --- head/net-mgmt/nagios-plugins/files/patch-plugins_check__procs.c (nonexistent) +++ head/net-mgmt/nagios-plugins/files/patch-plugins_check__procs.c (revision 448907) @@ -0,0 +1,107 @@ +--- plugins/check_procs.c.orig 2017-01-16 17:24:03 UTC ++++ plugins/check_procs.c +@@ -71,6 +71,7 @@ int options = 0; /* bitmask of filter cr + #define ELAPSED 512 + #define EREG_ARGS 1024 + #define CGROUP_HIERARCHY 2048 ++#define JID 4096 + + #define KTHREAD_PARENT "kthreadd" /* the parent process of kernel threads: + ppid of procs are compared to pid of this proc*/ +@@ -103,6 +104,7 @@ char *fails; + char tmp[MAX_INPUT_BUFFER]; + int kthread_filter = 0; + int usepid = 0; /* whether to test for pid or /proc/pid/exe */ ++int jid; + + FILE *ps_input = NULL; + +@@ -133,6 +135,7 @@ main (int argc, char **argv) + int procuid = 0; + pid_t procpid = 0; + pid_t procppid = 0; ++ int procjid = 0; + pid_t kthread_ppid = 0; + int procvsz = 0; + int procrss = 0; +@@ -236,9 +239,9 @@ main (int argc, char **argv) + procseconds = convert_to_seconds(procetime); + + if (verbose >= 3) { +- printf ("proc#=%d uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s", +++ printf ("proc#=%d uid=%d vsz=%d rss=%d pid=%d ppid=%d jid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", + procs, procuid, procvsz, procrss, +- procpid, procppid, procpcpu, procstat, ++ procpid, procppid, procjid, procpcpu, procstat, + procetime, procprog, procargs); + if (strstr(PS_COMMAND, "cgroup") != NULL) { + printf(" proc_cgroup_hierarchy=%s\n", proc_cgroup_hierarchy); +@@ -287,6 +290,8 @@ main (int argc, char **argv) + resultsum |= PROG; + if ((options & PPID) && (procppid == ppid)) + resultsum |= PPID; ++ if ((options & JID) && (procjid == jid)) ++ resultsum |= JID; + if ((options & USER) && (procuid == uid)) + resultsum |= USER; + if ((options & VSZ) && (procvsz >= vsz)) +@@ -315,9 +320,9 @@ main (int argc, char **argv) + + procs++; + if (verbose >= 2) { +- printf ("Matched: uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s", +++ printf ("Matched: uid=%d vsz=%d rss=%d pid=%d ppid=%d jid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", + procuid, procvsz, procrss, +- procpid, procppid, procpcpu, procstat, ++ procpid, procppid, procjid, procpcpu, procstat, + procetime, procprog, procargs); + if (strstr(PS_COMMAND, "cgroup") != NULL) { + printf(" cgroup_hierarchy=%s\n", cgroup_hierarchy); +@@ -438,6 +443,7 @@ process_arguments (int argc, char **argv + {"no-kthreads", required_argument, 0, 'k'}, + {"traditional-filter", no_argument, 0, 'T'}, + {"cgroup-hierarchy", required_argument, 0, 'g'}, ++ {"jid", required_argument, 0, 'j'}, + {0, 0, 0, 0} + }; + +@@ -446,7 +452,7 @@ process_arguments (int argc, char **argv + strcpy (argv[c], "-t"); + + while (1) { +- c = getopt_long (argc, argv, "Vvhkt:c:w:p:s:u:C:a:z:r:m:P:Tg:", ++ c = getopt_long (argc, argv, "Vvhkt:c:w:p:s:u:C:a:z:r:m:P:Tg:j:", + longopts, &option); + + if (c == -1 || c == EOF) +@@ -477,6 +483,12 @@ process_arguments (int argc, char **argv + break; + } + usage4 (_("Parent Process ID must be an integer!")); ++ case 'j': /* jail id */ ++ if (sscanf (optarg, "%d%[^0-9]", &jid, tmp) == 1) { ++ asprintf (&fmt, "%s%sJID = %d", (fmt ? fmt : "") , (options ? ", " : ""), jid); ++ options |= JID; ++ break; ++ } + case 's': /* status */ + if (statopts) + break; +@@ -766,6 +778,8 @@ print_help (void) + printf (" %s\n", _("RSZDT, plus others based on the output of your 'ps' command).")); + printf (" %s\n", "-p, --ppid=PPID"); + printf (" %s\n", _("Only scan for children of the parent process ID indicated.")); ++ printf (" %s\n", "-j, --jid=JID"); ++ printf (" %s\n", _("Only scan for process running in jail which ID is JID.")); + printf (" %s\n", "-z, --vsz=VSZ"); + printf (" %s\n", _("Only scan for processes with VSZ higher than indicated.")); + printf (" %s\n", "-r, --rss=RSS"); +@@ -818,7 +832,7 @@ void + print_usage (void) + { + printf ("%s\n", _("Usage:")); +- printf ("%s -w -c [-m metric] [-s state] [-p ppid]\n", progname); ++ printf ("%s -w -c [-m metric] [-s state] [-p ppid] [-j jid]\n", progname); + printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n"); + printf (" [-C command] [-k] [-t timeout] [-v]\n"); + } Property changes on: head/net-mgmt/nagios-plugins/files/patch-plugins_check__procs.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property