diff options
author | Eldad Zack <eldad@gentoo.org> | 2004-11-21 11:31:07 +0000 |
---|---|---|
committer | Eldad Zack <eldad@gentoo.org> | 2004-11-21 11:31:07 +0000 |
commit | e30cf07dc62e37851992de7ec6cc8c22eec66407 (patch) | |
tree | 746c8dca5db4deac5e5424997e45dc58ebcfb13e /net-analyzer/nagios-plugins | |
parent | Added to ~amd64, bug #71921 (diff) | |
download | historical-e30cf07dc62e37851992de7ec6cc8c22eec66407.tar.gz historical-e30cf07dc62e37851992de7ec6cc8c22eec66407.tar.bz2 historical-e30cf07dc62e37851992de7ec6cc8c22eec66407.zip |
nagios-plugins-1.3.1-r2.ebuild
Diffstat (limited to 'net-analyzer/nagios-plugins')
-rw-r--r-- | net-analyzer/nagios-plugins/ChangeLog | 7 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins/Manifest | 11 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins/files/check_swap.c.patch | 58 | ||||
-rw-r--r-- | net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild | 5 |
4 files changed, 73 insertions, 8 deletions
diff --git a/net-analyzer/nagios-plugins/ChangeLog b/net-analyzer/nagios-plugins/ChangeLog index d04c5ec6b9ce..3332c74e0834 100644 --- a/net-analyzer/nagios-plugins/ChangeLog +++ b/net-analyzer/nagios-plugins/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-analyzer/nagios-plugins # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/ChangeLog,v 1.27 2004/11/21 11:08:39 eldad Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/ChangeLog,v 1.28 2004/11/21 11:31:07 eldad Exp $ + + 21 Nov 2004; Eldad Zack <eldad@gentoo.org> +files/check_swap.c.patch, + nagios-plugins-1.3.1-r1.ebuild: + check_swap fix for kernel 2.6, thanks to Evgeny Stambulchik + <fnevgeny@weizmann.ac.il> for providing the patch. Closes #61386. 21 Nov 2004; Eldad Zack <eldad@gentoo.org> nagios-plugins-1.3.1-r1.ebuild: contribs nitpicks: chmod all .pl script +x, fixed interpreter, diff --git a/net-analyzer/nagios-plugins/Manifest b/net-analyzer/nagios-plugins/Manifest index ec187f3da3b9..0e56e74852e6 100644 --- a/net-analyzer/nagios-plugins/Manifest +++ b/net-analyzer/nagios-plugins/Manifest @@ -1,18 +1,19 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 c0582d3362a3b47e25f82a08ea553ecf nagios-plugins-1.3.1-r1.ebuild 2826 +MD5 d5404db58e2a9319bb9292d1872b748d nagios-plugins-1.3.1-r1.ebuild 2867 MD5 28e87bdecda2a6c56ad1fc2dc3f339db nagios-plugins-1.3.1.ebuild 1708 -MD5 5d85c52abb9ea4a7af5a38b5952c4d36 ChangeLog 4380 +MD5 f8b7b9707df098af88b0581fc737d2ee ChangeLog 4617 MD5 a3aa02d9b004cdb8629496aa61024fb7 metadata.xml 256 MD5 39af7074b023625d9a75730bd6932437 files/digest-nagios-plugins-1.3.1 72 +MD5 c8c25561d4871462ea03dc0490ced91b files/check_swap.c.patch 2212 MD5 acb0b2b914b27b67b9a33807b1e6838e files/install-opts-fix.diff 3168 MD5 ee71da291efd7427bd9786591a98df34 files/nagios-plugins-noradius.patch 2661 MD5 39af7074b023625d9a75730bd6932437 files/digest-nagios-plugins-1.3.1-r1 72 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) -iD8DBQFBoHX9T+MN7JbqCpMRAoxvAKCIy4yQ8Fh8Quvm7h3kW3vo5RUZ4wCfap0L -mm8JxmnuhDYP8rB0ufehjXc= -=fRSk +iD8DBQFBoHs7T+MN7JbqCpMRAmeNAJ9PCZxLZQ0gTrFMAqSnVjcEf8eUBwCfciTl +CEZI4jeW3NQwlgv0VuDWqII= +=jXgD -----END PGP SIGNATURE----- diff --git a/net-analyzer/nagios-plugins/files/check_swap.c.patch b/net-analyzer/nagios-plugins/files/check_swap.c.patch new file mode 100644 index 000000000000..9daceedac56e --- /dev/null +++ b/net-analyzer/nagios-plugins/files/check_swap.c.patch @@ -0,0 +1,58 @@ +--- plugins/check_swap.c.orig 2003-02-18 05:46:15.000000000 +0200 ++++ plugins/check_swap.c 2004-08-23 17:08:21.328421472 +0300 +@@ -70,30 +70,37 @@ + + #ifdef HAVE_PROC_MEMINFO + fp = fopen (PROC_MEMINFO, "r"); ++ if (!fp) { ++ printf ("Could not open meminfo proc file\n"); ++ return STATE_UNKNOWN; ++ } + asprintf (&status, "%s", "Swap used:"); + while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) { +- if (sscanf (input_buffer, " %s %lu %lu %lu", str, &total, &used, &free) == 4 && +- strstr (str, "Swap")) { +- total_swap += total; +- used_swap += used; ++ if (sscanf (input_buffer, "%s %lu", str, &total) == 2 && ++ strstr (str, "SwapTotal:")) { ++ total *= 1024; ++ total_swap += total; ++ used_swap += total_swap; ++ } else ++ if (sscanf (input_buffer, "%s %lu", str, &free) == 2 && ++ strstr (str, "SwapFree:")) { ++ free *= 1024; + free_swap += free; +- if (allswaps) { +- percent = 100 * (((double) used) / ((double) total)); +- if (percent >= crit_percent || free <= crit_size) +- result = max_state (STATE_CRITICAL, result); +- else if (percent >= warn_percent || free <= warn_size) +- result = max_state (STATE_WARNING, result); +- if (verbose) +- asprintf (&status, "%s [%lu/%lu]", status, used, total); +- } ++ used_swap -= free_swap; + } + } +- percent_used = 100 * (((double) used_swap) / ((double) total_swap)); +- if (percent_used >= crit_percent || free_swap <= crit_size) ++ ++ if (total_swap == 0) { ++ percent_used = 100; + result = max_state (STATE_CRITICAL, result); +- else if (percent_used >= warn_percent || free_swap <= warn_size) +- result = max_state (STATE_WARNING, result); +- asprintf (&status, "%s %2d%% (%lu out of %lu)", status, percent_used, ++ } else { ++ percent_used = 100 * (0.005 + ((double) used_swap) / ((double) total_swap)); ++ if (percent_used >= crit_percent || free_swap <= crit_size) ++ result = max_state (STATE_CRITICAL, result); ++ else if (percent_used >= warn_percent || free_swap <= warn_size) ++ result = max_state (STATE_WARNING, result); ++ } ++ asprintf (&status, "%s %2d%% (%lu out of %lu)", status, percent_used, + used_swap, total_swap); + fclose (fp); + #else diff --git a/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild index f382aa80e148..8e17df388f6e 100644 --- a/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild +++ b/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild,v 1.12 2004/11/21 11:08:39 eldad Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.3.1-r1.ebuild,v 1.13 2004/11/21 11:31:07 eldad Exp $ inherit eutils @@ -9,7 +9,7 @@ HOMEPAGE="http://www.nagios.org/" SRC_URI="mirror://sourceforge/nagiosplug/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" -KEYWORDS="x86 sparc ~ppc ~amd64" +KEYWORDS="~x86 ~sparc ~ppc ~amd64" IUSE="ldap mysql postgres ssl samba snmp nagios-dns nagios-ntp nagios-ping nagios-ssh" DEPEND="ldap? ( >=net-nds/openldap-2.0.25 ) @@ -40,6 +40,7 @@ src_compile() { use ssl && myconf="${myconf} --with-openssl" || myconf="${myconf} --without-openssl" epatch ${FILESDIR}/nagios-plugins-noradius.patch + epatch ${FILESDIR}/check_swap.c.patch ./configure ${myconf} \ --host=${CHOST} \ |