From noreply at sourceforge.net Sat Dec 1 02:44:09 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Fri, 30 Nov 2007 17:44:09 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1348746 ] check_disk reports incorrect disk free with neg space on BSD Message-ID: Bugs item #1348746, was opened at 2005-11-04 19:59 Message generated for change (Comment added) made by dermoth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parsing problem Group: Release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ted Cabeen (secabeen) Assigned to: Nobody/Anonymous (nobody) Summary: check_disk reports incorrect disk free with neg space on BSD Initial Comment: With check_disk running on FreeBSD 5-STABLE, when a disk has negative free space remaining, the amount of free space goes hugely positive: DISK CRITICAL - free space: /usr 36028797018963968 MB (1191472380510208%): Here's a df from the time: /dev/ad4s1g 3096462 2989082 -140336 105% /usr ---------------------------------------------------------------------- >Comment By: Thomas Guyot (dermoth) Date: 2007-11-30 20:44 Message: Logged In: YES user_id=375623 Originator: NO Sorry about that. A few of us looked into it a while back and couldn't find the issue. I can take a second look, but it would help if you first patch check_disk with the attached check_disk.extra-debug.patch and send me the full output after running the plugin with -vvv (Please limit it to one path if possible). Since I don't have a BSD system to test with the attached patch will give me what I need to simulate your system and hopefully reproduce the bug. File Added: check_disk.extra-debug.patch ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 16:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 16:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-21 04:35 Message: Logged In: YES user_id=145970 Originator: NO Hmmm, just detected one more problem with check_disk processing on FreeBSD: root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union /var DISK WARNING - free space: /var 498 MB (5% inode=97%);| /var=9419MB;8924;9420;97;9916 root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union -vvv DISK OK - free space: / 264 MB (53% inode=92%); /tmp 177 MB (36% inode=90%); /usr 6458 MB (65% inode=83%); /var 496 MB (5% inode=97%); /var/spool 31789 MB (69% inode=95%); /var/spool/mail 72962 MB (54% inode=87%); 264 of 496 MB (53% inode=92%) free on /dev/amrd0s1a (type ufs mounted on /) warn:0 crit:0 warn%:10% crit%:5% 177 of 496 MB (36% inode=90%) free on /dev/amrd0s1d (type ufs mounted on /tmp) warn:0 crit:0 warn%:0% crit%:0% 6458 of 9916 MB (65% inode=83%) free on /dev/amrd0s1f (type ufs mounted on /usr) warn:0 crit:0 warn%:0% crit%:0% 496 of 9916 MB (5% inode=97%) free on /dev/amrd0s1e (type ufs mounted on /var) warn:0 crit:0 warn%:0% crit%:0% 31789 of 46096 MB (69% inode=95%) free on /dev/amrd0s1g (type ufs mounted on /var/spool) warn:0 crit:0 warn%:0% crit%:0% 72962 of 135854 MB (54% inode=87%) free on /dev/amrd1s1d (type ufs mounted on /var/spool/mail) warn:0 crit:0 warn%:0% crit%:0%| /=231MB;445;470;92;495 /tmp=318MB;495;495;90;495 /usr=3459MB;9916;9916;83;9916 /var=9420MB;9916;9916;97;9916 /var/spool=14307MB;46096;46096;94;46096 /var/spool/mail=62891MB;135853;135853;87;135853 e.g. when checking a mount point directly, the insufficient space gives a warning, but when checked as a summary, the state is OK because it looks like that the warning and critical criteria are only used for the first found mount point ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 17:42 Message: Logged In: YES user_id=145970 Originator: NO A little more input, because just hinted from #nagios: # df -h /tmp Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # check_disk -vvv /tmp | head -1 For /tmp, used_pct=101 free_pct=-1 used_units=460 free_units=1.75922e+13 total_units=495 used_inodes_pct=1 free_inodes_pct=99 fsp.fsu_blocksize=2048 mult=1048576 ---------------------------------------------------------------------- Comment By: Holger Weiss (hweiss) Date: 2007-11-20 17:22 Message: Logged In: YES user_id=759506 Originator: NO Thanks, we'll have to look into it. ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 17:14 Message: Logged In: YES user_id=145970 Originator: NO I would like this bug to have reopened. It still exists in nagios-plugins version 1.4.10 at least at FreeBSD 6.2-RELEASE-p5, as the following test shows: Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # /usr/local/libexec/nagios/check_disk /tmp DISK OK - free space: /tmp 17592186044411 MB (-1% inode=99%);| /tmp=460MB;;;0;495 Would be great to have a fix soon - this is quite bad since i cannot trust check_disk anymore with that... ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2006-11-02 22:20 Message: Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-10-19 15:49 Message: Logged In: YES user_id=664364 Doesn't look like any updates since I last requested in July. Marking call into pending. Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-07-19 19:18 Message: Logged In: YES user_id=664364 Ted, Can you try the latest snapshot at http://nagiosplug.sf.net/snapshot. There have been major changes to check_disk to sync it with coreutils' df so there shouldn't be sign problems. If you still have problems, can you tell me what version of df are you using? Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2005-11-08 07:05 Message: Logged In: YES user_id=664364 >From 1.4 onwards, we use the GNU coreutils library to get df data. I don't know if FreeBSD use their own routines or not, but GNU coreutils should support it. Yes, I guess signed integers should fix. Was an assumption on our part that values would be always positive. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-08 06:28 Message: Logged In: YES user_id=226838 hi, well chalk this up to my having been away from traditional unix/bsd implementations. afaict in linux such reserved space is still taken into calculation of total available space (ie, you could get ENOSPC before the disk reached 0%). but anyway, i think the fix is still obvious, that we should do all scans and assignments as signed integers instead of unsigned. if i don't hear any complaints from anyone else on the plugins team, i'll probably do this at some point (and hope that it doesn't break something else) also, having taken a look at the check_disk code, i can't seem to find any references to the df program... so i guess if you're using 1.4.2 or later that it's purely within the internal disk space routines. ---------------------------------------------------------------------- Comment By: Ted Cabeen (secabeen) Date: 2005-11-07 16:25 Message: Logged In: YES user_id=40466 All modern unix file-systems reserve a portion (5-10%) of the disk space for use by root only and to speed disk accesses. If the root user exceeds the normal disk space and uses some of the reserve space, the system will represent the amount of free space as negative. I don't know how check_disk is checking the disk space (df or internal routines). Is there an easy way to check? check_disk (nagios-plugins 1.4.2) 1.57 is the version I'm running. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-07 07:56 Message: Logged In: YES user_id=226838 hi, um, i just have to ask. how do you have negative free space? some other information that would be helpful: - is check_disk using the df command or internal disk space routines? - if df, what df command syntax is check_disk using? - what version of the plugins are you using? i believe that the plugin is making an assumption that the amount of disk space available is unsigned, because, er... well i'd never heard of negative disk space, anyway :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 From noreply at sourceforge.net Mon Dec 3 10:41:37 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 03 Dec 2007 01:41:37 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1348746 ] check_disk reports incorrect disk free with neg space on BSD Message-ID: Bugs item #1348746, was opened at 2005-11-05 01:59 Message generated for change (Comment added) made by psychotrahe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parsing problem Group: Release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ted Cabeen (secabeen) Assigned to: Nobody/Anonymous (nobody) Summary: check_disk reports incorrect disk free with neg space on BSD Initial Comment: With check_disk running on FreeBSD 5-STABLE, when a disk has negative free space remaining, the amount of free space goes hugely positive: DISK CRITICAL - free space: /usr 36028797018963968 MB (1191472380510208%): Here's a df from the time: /dev/ad4s1g 3096462 2989082 -140336 105% /usr ---------------------------------------------------------------------- >Comment By: Matthias Eble (psychotrahe) Date: 2007-12-03 10:41 Message: Logged In: YES user_id=1694341 Originator: NO Hello Altpeter, I'm pretty sure, the threshold/argument problem doesn't exist in the latest versions including 1.4.10. The debug output of your command line is commented out in the current code. negative freespace: I currently can't imagine where the negative values come from but IMO they shouldn't be there. However, I'll try to find some time to test. Matthias ---------------------------------------------------------------------- Comment By: Thomas Guyot (dermoth) Date: 2007-12-01 02:44 Message: Logged In: YES user_id=375623 Originator: NO Sorry about that. A few of us looked into it a while back and couldn't find the issue. I can take a second look, but it would help if you first patch check_disk with the attached check_disk.extra-debug.patch and send me the full output after running the plugin with -vvv (Please limit it to one path if possible). Since I don't have a BSD system to test with the attached patch will give me what I need to simulate your system and hopefully reproduce the bug. File Added: check_disk.extra-debug.patch ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 22:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 22:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-21 10:35 Message: Logged In: YES user_id=145970 Originator: NO Hmmm, just detected one more problem with check_disk processing on FreeBSD: root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union /var DISK WARNING - free space: /var 498 MB (5% inode=97%);| /var=9419MB;8924;9420;97;9916 root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union -vvv DISK OK - free space: / 264 MB (53% inode=92%); /tmp 177 MB (36% inode=90%); /usr 6458 MB (65% inode=83%); /var 496 MB (5% inode=97%); /var/spool 31789 MB (69% inode=95%); /var/spool/mail 72962 MB (54% inode=87%); 264 of 496 MB (53% inode=92%) free on /dev/amrd0s1a (type ufs mounted on /) warn:0 crit:0 warn%:10% crit%:5% 177 of 496 MB (36% inode=90%) free on /dev/amrd0s1d (type ufs mounted on /tmp) warn:0 crit:0 warn%:0% crit%:0% 6458 of 9916 MB (65% inode=83%) free on /dev/amrd0s1f (type ufs mounted on /usr) warn:0 crit:0 warn%:0% crit%:0% 496 of 9916 MB (5% inode=97%) free on /dev/amrd0s1e (type ufs mounted on /var) warn:0 crit:0 warn%:0% crit%:0% 31789 of 46096 MB (69% inode=95%) free on /dev/amrd0s1g (type ufs mounted on /var/spool) warn:0 crit:0 warn%:0% crit%:0% 72962 of 135854 MB (54% inode=87%) free on /dev/amrd1s1d (type ufs mounted on /var/spool/mail) warn:0 crit:0 warn%:0% crit%:0%| /=231MB;445;470;92;495 /tmp=318MB;495;495;90;495 /usr=3459MB;9916;9916;83;9916 /var=9420MB;9916;9916;97;9916 /var/spool=14307MB;46096;46096;94;46096 /var/spool/mail=62891MB;135853;135853;87;135853 e.g. when checking a mount point directly, the insufficient space gives a warning, but when checked as a summary, the state is OK because it looks like that the warning and critical criteria are only used for the first found mount point ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 23:42 Message: Logged In: YES user_id=145970 Originator: NO A little more input, because just hinted from #nagios: # df -h /tmp Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # check_disk -vvv /tmp | head -1 For /tmp, used_pct=101 free_pct=-1 used_units=460 free_units=1.75922e+13 total_units=495 used_inodes_pct=1 free_inodes_pct=99 fsp.fsu_blocksize=2048 mult=1048576 ---------------------------------------------------------------------- Comment By: Holger Weiss (hweiss) Date: 2007-11-20 23:22 Message: Logged In: YES user_id=759506 Originator: NO Thanks, we'll have to look into it. ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 23:14 Message: Logged In: YES user_id=145970 Originator: NO I would like this bug to have reopened. It still exists in nagios-plugins version 1.4.10 at least at FreeBSD 6.2-RELEASE-p5, as the following test shows: Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # /usr/local/libexec/nagios/check_disk /tmp DISK OK - free space: /tmp 17592186044411 MB (-1% inode=99%);| /tmp=460MB;;;0;495 Would be great to have a fix soon - this is quite bad since i cannot trust check_disk anymore with that... ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2006-11-03 04:20 Message: Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-10-19 21:49 Message: Logged In: YES user_id=664364 Doesn't look like any updates since I last requested in July. Marking call into pending. Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-07-20 01:18 Message: Logged In: YES user_id=664364 Ted, Can you try the latest snapshot at http://nagiosplug.sf.net/snapshot. There have been major changes to check_disk to sync it with coreutils' df so there shouldn't be sign problems. If you still have problems, can you tell me what version of df are you using? Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2005-11-08 13:05 Message: Logged In: YES user_id=664364 >From 1.4 onwards, we use the GNU coreutils library to get df data. I don't know if FreeBSD use their own routines or not, but GNU coreutils should support it. Yes, I guess signed integers should fix. Was an assumption on our part that values would be always positive. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-08 12:28 Message: Logged In: YES user_id=226838 hi, well chalk this up to my having been away from traditional unix/bsd implementations. afaict in linux such reserved space is still taken into calculation of total available space (ie, you could get ENOSPC before the disk reached 0%). but anyway, i think the fix is still obvious, that we should do all scans and assignments as signed integers instead of unsigned. if i don't hear any complaints from anyone else on the plugins team, i'll probably do this at some point (and hope that it doesn't break something else) also, having taken a look at the check_disk code, i can't seem to find any references to the df program... so i guess if you're using 1.4.2 or later that it's purely within the internal disk space routines. ---------------------------------------------------------------------- Comment By: Ted Cabeen (secabeen) Date: 2005-11-07 22:25 Message: Logged In: YES user_id=40466 All modern unix file-systems reserve a portion (5-10%) of the disk space for use by root only and to speed disk accesses. If the root user exceeds the normal disk space and uses some of the reserve space, the system will represent the amount of free space as negative. I don't know how check_disk is checking the disk space (df or internal routines). Is there an easy way to check? check_disk (nagios-plugins 1.4.2) 1.57 is the version I'm running. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-07 13:56 Message: Logged In: YES user_id=226838 hi, um, i just have to ask. how do you have negative free space? some other information that would be helpful: - is check_disk using the df command or internal disk space routines? - if df, what df command syntax is check_disk using? - what version of the plugins are you using? i believe that the plugin is making an assumption that the amount of disk space available is unsigned, because, er... well i'd never heard of negative disk space, anyway :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 From dermoth at aei.ca Tue Dec 4 13:55:06 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Tue, 04 Dec 2007 07:55:06 -0500 Subject: [Nagiosplug-devel] Merging back ntp_rework branch Message-ID: <47554E2A.3010900@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I just merged the ntp_rework branch back into the branch (checks, test, makefiles and NEWS) (btw since I'm not much used to branching and merging I just committed it as one huge patch - most of the changes are on the two new files anyways). check_ntp.c now needs a comment in the header and --help about its deprecated status (I can do it today...) and apart from that we should be good. Any thoughts about check_disk? it would be nice to have that fixed as well in the next release... Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVU4q6dZ+Kt5BchYRApMlAJ9ZeKdBtGQVOlOvdJ6zEYgWSVXstgCglaLH uBcByNxx22wxRW1TdzYDjx4= =LFcX -----END PGP SIGNATURE----- From holger at CIS.FU-Berlin.DE Tue Dec 4 14:03:50 2007 From: holger at CIS.FU-Berlin.DE (Holger Weiss) Date: Tue, 4 Dec 2007 14:03:50 +0100 Subject: [Nagiosplug-devel] Merging back ntp_rework branch In-Reply-To: <47554E2A.3010900@aei.ca> References: <47554E2A.3010900@aei.ca> Message-ID: <20071204130350.GQ22076656@CIS.FU-Berlin.DE> * Thomas Guyot-Sionnest [2007-12-04 07:55]: > Any thoughts about check_disk? it would be nice to have that fixed as > well in the next release... It's assuming a positive value of free space (at least by using unsigned integer types) while the free space can get negative on (at least) BSD systems[*]. Probably easy to fix, but I have no time at all, sorry :-/ Holger [*] See: http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/book.html#DISK-MORE-THAN-FULL From matthias.eble at mailing.kaufland-informationssysteme.com Tue Dec 4 14:13:26 2007 From: matthias.eble at mailing.kaufland-informationssysteme.com (Matthias Eble) Date: Tue, 04 Dec 2007 14:13:26 +0100 Subject: [Nagiosplug-devel] Next release was: Merging back ntp_rework branch In-Reply-To: <47554E2A.3010900@aei.ca> References: <47554E2A.3010900@aei.ca> Message-ID: <47555276.1020307@mailing.kaufland-informationssysteme.com> > Any thoughts about check_disk? it would be nice to have that fixed as > well in the next release... I suppose you mean the bugtracker item with negative values. There are two different problems. The threshold problem looks like an outdated version of check_disk. Have there been any plans when the new release will be there? With negative values: Nice link, Holger. Thanks. I could imagine trying to fix this, depending on the schedule though. I think I set up a bsd box somewhere sometime... Matthias From ton.voon at altinity.com Tue Dec 4 15:20:27 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 4 Dec 2007 14:20:27 +0000 Subject: [Nagiosplug-devel] Next release was: Merging back ntp_rework branch In-Reply-To: <47555276.1020307@mailing.kaufland-informationssysteme.com> References: <47554E2A.3010900@aei.ca> <47555276.1020307@mailing.kaufland-informationssysteme.com> Message-ID: <6E3ECFA9-A373-4C0C-957E-183695E84436@altinity.com> On 4 Dec 2007, at 13:13, Matthias Eble wrote: >> Any thoughts about check_disk? it would be nice to have that fixed as >> well in the next release... > > I suppose you mean the bugtracker item with negative values. > There are two different problems. The threshold problem looks like an > outdated version of check_disk. > > Have there been any plans when the new release will be there? I was thinking that we have a release soon, since there were some security fixes last month. check_ntp was the last thing, until this check_disk problem was raised. > With negative values: > Nice link, Holger. Thanks. > I could imagine trying to fix this, depending on the schedule though. > I think I set up a bsd box somewhere sometime... It sounds like this could take some time to work out, so I'd propose we make a new release first. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From matthias.eble at mailing.kaufland-informationssysteme.com Tue Dec 4 15:31:30 2007 From: matthias.eble at mailing.kaufland-informationssysteme.com (Matthias Eble) Date: Tue, 04 Dec 2007 15:31:30 +0100 Subject: [Nagiosplug-devel] Next release In-Reply-To: <6E3ECFA9-A373-4C0C-957E-183695E84436@altinity.com> References: <47554E2A.3010900@aei.ca> <47555276.1020307@mailing.kaufland-informationssysteme.com> <6E3ECFA9-A373-4C0C-957E-183695E84436@altinity.com> Message-ID: <475564C2.1000506@mailing.kaufland-informationssysteme.com> >> With negative values: >> Nice link, Holger. Thanks. >> I could imagine trying to fix this, depending on the schedule though. >> I think I set up a bsd box somewhere sometime... > > It sounds like this could take some time to work out, so I'd propose > we make a new release first. I eventually found the freebsd box and filled /usr. I can reproduce the problem with it. So would you be fine with releasing in the early next week? I'll try to do some work at the weekend and review the tracker then. Matthias From ton.voon at altinity.com Tue Dec 4 16:42:58 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 4 Dec 2007 15:42:58 +0000 Subject: [Nagiosplug-devel] Next release In-Reply-To: <475564C2.1000506@mailing.kaufland-informationssysteme.com> References: <47554E2A.3010900@aei.ca> <47555276.1020307@mailing.kaufland-informationssysteme.com> <6E3ECFA9-A373-4C0C-957E-183695E84436@altinity.com> <475564C2.1000506@mailing.kaufland-informationssysteme.com> Message-ID: <17F91C5E-14A0-44BA-846C-A3AA1D501BEB@altinity.com> On 4 Dec 2007, at 14:31, Matthias Eble wrote: > So would you be fine with releasing in the early next week? > I'll try to do some work at the weekend and review the tracker then. OK. Ton From slawomir.ragan at googlemail.com Thu Dec 6 18:42:10 2007 From: slawomir.ragan at googlemail.com (Slawomir Ragan) Date: Thu, 6 Dec 2007 18:42:10 +0100 Subject: [Nagiosplug-devel] check_disk failure in nagios-plugins Message-ID: <26675bf60712060942n5353411ay99fd1c6dc6c515c1@mail.gmail.com> Hi, my colleague asked me to have a look in the source code becuse he got failure with check_disk. I think it is more efficient to ask you :) Environment: z/Linux under z/Series SLES9 servers with the newest SUSE Linux patches nagios-plugins-1.3.1-270.13 If he try the check_disk command now (after the update) he will get the failure: /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% Disk "/dev/dasda1" not mounted or nonexistant. Before the update it was working fine: /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% Disk "/dev/dasda1" not mounted or nonexistant. Any Idea? Thank you in advance. Slawomir Ragan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ae at op5.se Thu Dec 6 23:17:23 2007 From: ae at op5.se (Andreas Ericsson) Date: Thu, 06 Dec 2007 23:17:23 +0100 Subject: [Nagiosplug-devel] check_disk failure in nagios-plugins In-Reply-To: <26675bf60712060942n5353411ay99fd1c6dc6c515c1@mail.gmail.com> References: <26675bf60712060942n5353411ay99fd1c6dc6c515c1@mail.gmail.com> Message-ID: <475874F3.7070706@op5.se> Slawomir Ragan wrote: > Hi, > > my colleague asked me to have a look in the source code becuse he got > failure with check_disk. > I think it is more efficient to ask you :) > That depends. Reporting possible bugs correctly certainly speeds things up, something which you unfortunately failed to do. > Environment: > z/Linux under z/Series > SLES9 servers with the newest SUSE Linux patches > nagios-plugins-1.3.1-270.13 > > If he try the check_disk command now (after the update) he will get the > failure: > /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% > Disk "/dev/dasda1" not mounted or nonexistant. > > Before the update it was working fine: > /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% > Disk "/dev/dasda1" not mounted or nonexistant. > You're aware of the fact that these two runs depic the exact same output, right? -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 From rouilj at cs.umb.edu Fri Dec 7 00:27:02 2007 From: rouilj at cs.umb.edu (John P. Rouillard) Date: Thu, 06 Dec 2007 18:27:02 -0500 Subject: [Nagiosplug-devel] Does Nagios::Plugin really need other modules? Message-ID: <200712062327.lB6NR2vk023685@mx1.cs.umb.edu> Hi Folks: I thought I would go and try out the new Nagios::Plugins library for some new perl plugins. However trying to build the RPM resulted in: > cpan2rpm Nagios::Plugin -- module: Nagios::Plugin -- Using cached URL: http://search.cpan.org//CPAN/authors/id/T/TO/TONVOON/Nagios-Plugin-0.21.tar.gz Tarball found - not fetching Metadata retrieval Tarball extraction: [/home/rouilj/rpm/SOURCES/Nagios-Plugin-0.21.tar.gz] Unable to build module, the following dependencies have failed: Class::Accessor >= 0 Test::More >= 0.62 Params::Validate >= 0 Math::Calc::Units >= 0 none of these dependencies are listed on the cpan manual page for Nagios::Plugins. I truly don't see how we can distribute a copy of Nagios::Plugin with the plugins and expect it to work with all these dependencies. Also cpan2rpm of Test::More resulted in: -- module: Test::More -- Module not found on CPAN web site! at /usr/bin/cpan2rpm line 1201. So please tell me something is wrong with cpan2rpm and that all of these are optional dependencies and that basic functionality is available without them. -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions. From ton.voon at altinity.com Fri Dec 7 01:14:49 2007 From: ton.voon at altinity.com (Ton Voon) Date: Fri, 7 Dec 2007 00:14:49 +0000 Subject: [Nagiosplug-devel] Does Nagios::Plugin really need other modules? In-Reply-To: <200712062327.lB6NR2vk023685@mx1.cs.umb.edu> References: <200712062327.lB6NR2vk023685@mx1.cs.umb.edu> Message-ID: <5BB0BE0B-C0A0-4FD6-BC3B-2F15309C570A@altinity.com> Hi John, On 6 Dec 2007, at 23:27, John P. Rouillard wrote: > I thought I would go and try out the new Nagios::Plugins library for > some new perl plugins. However trying to build the RPM resulted in: > >> cpan2rpm Nagios::Plugin > -- module: Nagios::Plugin -- > Using cached URL: http://search.cpan.org//CPAN/authors/id/T/TO/TONVOON/Nagios-Plugin-0.21.tar.gz > Tarball found - not fetching > Metadata retrieval > Tarball extraction: [/home/rouilj/rpm/SOURCES/Nagios- > Plugin-0.21.tar.gz] > Unable to build module, the following dependencies have failed: > Class::Accessor >= 0 > Test::More >= 0.62 > Params::Validate >= 0 > Math::Calc::Units >= 0 > > none of these dependencies are listed on the cpan manual page for > Nagios::Plugins. I truly don't see how we can distribute a copy of > Nagios::Plugin with the plugins and expect it to work with all these > dependencies. It was my call to use dependent CPAN modules, rather than trying to re- write everything, and, so far, I stick by that decision. If we tried to create a getopt routine with the sophistication of Params::Validate, well, we'd end up with Params::Validate. So we should use it instead of trying to reinvent very good wheels. This moves it from being a programmer problem to an implementation problem. I'm happy to spend some time on the implementation side to get that smoother. > Also cpan2rpm of Test::More resulted in: > > -- module: Test::More -- > Module not found on CPAN web site! at /usr/bin/cpan2rpm line 1201. > > So please tell me something is wrong with cpan2rpm and that all of > these are optional dependencies and that basic functionality is > available without them. Test::More is not actually a package on CPAN. Test::More belongs to the Test::Simple package (http://search.cpan.org/~mschwern/Test-Simple-0.74/ ). Try running a cpan2rpm for Test::Simple. In perl's dependency speak, you specify the module, not the package. If the above works, maybe an enhancement to cpan2rpm to allow specification of a module to then lookup the package would be useful. Also, if the above works, then you could amend the Nagios::Plugin tarball to specify Test::Simple as the dependency instead and see whether this causes it to build all the dependencies correctly. If so, then I definitely think a patch to cpan2rpm is in order. Unfortunately, building from CPAN is still not quite as smooth as it could be but I think it is worthwhile trying to fix this in the general case. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From dermoth at aei.ca Fri Dec 7 07:05:30 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Fri, 07 Dec 2007 01:05:30 -0500 Subject: [Nagiosplug-devel] check_disk failure in nagios-plugins In-Reply-To: <26675bf60712060942n5353411ay99fd1c6dc6c515c1@mail.gmail.com> References: <26675bf60712060942n5353411ay99fd1c6dc6c515c1@mail.gmail.com> Message-ID: <4758E2AA.7080201@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/12/07 12:42 PM, Slawomir Ragan wrote: > Hi, > > my colleague asked me to have a look in the source code becuse he got > failure with check_disk. > I think it is more efficient to ask you :) > > Environment: > z/Linux under z/Series > SLES9 servers with the newest SUSE Linux patches > nagios-plugins-1.3.1-270.13 That release is +4 years old. You should be very careful about changes in plugins behavior. Reading --help of the plugins should help too... > If he try the check_disk command now (after the update) he will get the > failure: > /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% > Disk "/dev/dasda1" not mounted or nonexistant. > > Before the update it was working fine: > /usr/lib/nagios/plugins/check_disk -p /dev/dasda1 -w 20% -c 10% > Disk "/dev/dasda1" not mounted or nonexistant. As Andreas pointed out you probably didn't pasted the output correctly... > Any Idea? Thank you in advance. Slawomir Ragan AFAIK a device used to work in a very distant past, but as --help says - -p wants a path or partition to determine the device. On my system trying /dev/something works but returns the device usage for /dev! If it still doesn't work with the mount point you want to check, please port the full output of check_disk with "-vvv" added. If you can get the output before and after the upgrade that would be nice too. Thanks, Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHWOKq6dZ+Kt5BchYRAolCAKCq2nPFN1LFpWtquoRvtXshv9U6nQCfRTsD KyuHUVU7FW/cEYGqcx1Ez20= =54H/ -----END PGP SIGNATURE----- From cmr at financial.com Fri Dec 7 08:19:24 2007 From: cmr at financial.com (Christoph Maser) Date: Fri, 7 Dec 2007 08:19:24 +0100 Subject: [Nagiosplug-devel] Does Nagios::Plugin really need other modules? In-Reply-To: <200712062327.lB6NR2vk023685@mx1.cs.umb.edu> References: <200712062327.lB6NR2vk023685@mx1.cs.umb.edu> Message-ID: <1197011964.3579.12.camel@czc7445qqj> Hi John I don't see what is wrong in depending on other Modules. Especially if you use packages and package tools dependencies should be handled automatically. For source distribution all dependencys will be inside nagios-plugin release bundle, if i got that correct. And yes cpan2rpm is not the most perfect tool in the world. Chris Am Freitag, den 07.12.2007, 00:27 +0100 schrieb John P. Rouillard: > Hi Folks: > > I thought I would go and try out the new Nagios::Plugins library for > some new perl plugins. However trying to build the RPM resulted in: > > > cpan2rpm Nagios::Plugin > -- module: Nagios::Plugin -- > Using cached URL: http://search.cpan.org//CPAN/authors/id/T/TO/TONVOON/Nagios-Plugin-0.21.tar.gz > Tarball found - not fetching > Metadata retrieval > Tarball extraction: [/home/rouilj/rpm/SOURCES/Nagios-Plugin-0.21.tar.gz] > Unable to build module, the following dependencies have failed: > Class::Accessor >= 0 > Test::More >= 0.62 > Params::Validate >= 0 > Math::Calc::Units >= 0 > > none of these dependencies are listed on the cpan manual page for > Nagios::Plugins. I truly don't see how we can distribute a copy of > Nagios::Plugin with the plugins and expect it to work with all these > dependencies. > > Also cpan2rpm of Test::More resulted in: > > -- module: Test::More -- > Module not found on CPAN web site! at /usr/bin/cpan2rpm line 1201. > > So please tell me something is wrong with cpan2rpm and that all of > these are optional dependencies and that basic functionality is > available without them. > > -- rouilj > John Rouillard > =========================================================================== > My employers don't acknowledge my existence much less my opinions. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________________ > Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net > Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > ::: Please include plugins version (-v) and OS when reporting any issue. > ::: Messages without supporting info will risk being sent to /dev/null financial.com AG Munich head office/Hauptsitz M?nchen: Maria-Probst-Str. 19 | 80939 M?nchen | Germany Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany Management board/Vorstand: Dr. Steffen Boehnert (CEO/Vorsitzender) | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender) Register court/Handelsregister: Munich ? HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553 From noreply at sourceforge.net Sat Dec 8 17:53:16 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sat, 08 Dec 2007 08:53:16 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1348746 ] check_disk reports incorrect disk free with neg space on BSD Message-ID: Bugs item #1348746, was opened at 2005-11-04 19:59 Message generated for change (Comment added) made by dermoth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parsing problem Group: Release (specify) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Ted Cabeen (secabeen) Assigned to: Nobody/Anonymous (nobody) Summary: check_disk reports incorrect disk free with neg space on BSD Initial Comment: With check_disk running on FreeBSD 5-STABLE, when a disk has negative free space remaining, the amount of free space goes hugely positive: DISK CRITICAL - free space: /usr 36028797018963968 MB (1191472380510208%): Here's a df from the time: /dev/ad4s1g 3096462 2989082 -140336 105% /usr ---------------------------------------------------------------------- >Comment By: Thomas Guyot (dermoth) Date: 2007-12-08 11:53 Message: Logged In: YES user_id=375623 Originator: NO This is fixed in SVN. The root cause of the problem is in Gnulib which is why it was so hard to track this problem; I implemented a simple workaround in check_disk. The credits should go to Matthias as he was kind enough to upload me a FreeBSD VM to test on. You can try on the latest SVN HEAD (which will likely be released next week) or use the next daily snapshot. To get the HEAD: $ svn co http://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk/ nagiosplug Snapshots are there (Make sure it's at least Dec. 9 2007): http://nagiosplug.sourceforge.net/snapshot/ ---------------------------------------------------------------------- Comment By: Matthias Eble (psychotrahe) Date: 2007-12-03 04:41 Message: Logged In: YES user_id=1694341 Originator: NO Hello Altpeter, I'm pretty sure, the threshold/argument problem doesn't exist in the latest versions including 1.4.10. The debug output of your command line is commented out in the current code. negative freespace: I currently can't imagine where the negative values come from but IMO they shouldn't be there. However, I'll try to find some time to test. Matthias ---------------------------------------------------------------------- Comment By: Thomas Guyot (dermoth) Date: 2007-11-30 20:44 Message: Logged In: YES user_id=375623 Originator: NO Sorry about that. A few of us looked into it a while back and couldn't find the issue. I can take a second look, but it would help if you first patch check_disk with the attached check_disk.extra-debug.patch and send me the full output after running the plugin with -vvv (Please limit it to one path if possible). Since I don't have a BSD system to test with the attached patch will give me what I need to simulate your system and hopefully reproduce the bug. File Added: check_disk.extra-debug.patch ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 16:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 16:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-21 04:35 Message: Logged In: YES user_id=145970 Originator: NO Hmmm, just detected one more problem with check_disk processing on FreeBSD: root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union /var DISK WARNING - free space: /var 498 MB (5% inode=97%);| /var=9419MB;8924;9420;97;9916 root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union -vvv DISK OK - free space: / 264 MB (53% inode=92%); /tmp 177 MB (36% inode=90%); /usr 6458 MB (65% inode=83%); /var 496 MB (5% inode=97%); /var/spool 31789 MB (69% inode=95%); /var/spool/mail 72962 MB (54% inode=87%); 264 of 496 MB (53% inode=92%) free on /dev/amrd0s1a (type ufs mounted on /) warn:0 crit:0 warn%:10% crit%:5% 177 of 496 MB (36% inode=90%) free on /dev/amrd0s1d (type ufs mounted on /tmp) warn:0 crit:0 warn%:0% crit%:0% 6458 of 9916 MB (65% inode=83%) free on /dev/amrd0s1f (type ufs mounted on /usr) warn:0 crit:0 warn%:0% crit%:0% 496 of 9916 MB (5% inode=97%) free on /dev/amrd0s1e (type ufs mounted on /var) warn:0 crit:0 warn%:0% crit%:0% 31789 of 46096 MB (69% inode=95%) free on /dev/amrd0s1g (type ufs mounted on /var/spool) warn:0 crit:0 warn%:0% crit%:0% 72962 of 135854 MB (54% inode=87%) free on /dev/amrd1s1d (type ufs mounted on /var/spool/mail) warn:0 crit:0 warn%:0% crit%:0%| /=231MB;445;470;92;495 /tmp=318MB;495;495;90;495 /usr=3459MB;9916;9916;83;9916 /var=9420MB;9916;9916;97;9916 /var/spool=14307MB;46096;46096;94;46096 /var/spool/mail=62891MB;135853;135853;87;135853 e.g. when checking a mount point directly, the insufficient space gives a warning, but when checked as a summary, the state is OK because it looks like that the warning and critical criteria are only used for the first found mount point ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 17:42 Message: Logged In: YES user_id=145970 Originator: NO A little more input, because just hinted from #nagios: # df -h /tmp Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # check_disk -vvv /tmp | head -1 For /tmp, used_pct=101 free_pct=-1 used_units=460 free_units=1.75922e+13 total_units=495 used_inodes_pct=1 free_inodes_pct=99 fsp.fsu_blocksize=2048 mult=1048576 ---------------------------------------------------------------------- Comment By: Holger Weiss (hweiss) Date: 2007-11-20 17:22 Message: Logged In: YES user_id=759506 Originator: NO Thanks, we'll have to look into it. ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 17:14 Message: Logged In: YES user_id=145970 Originator: NO I would like this bug to have reopened. It still exists in nagios-plugins version 1.4.10 at least at FreeBSD 6.2-RELEASE-p5, as the following test shows: Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # /usr/local/libexec/nagios/check_disk /tmp DISK OK - free space: /tmp 17592186044411 MB (-1% inode=99%);| /tmp=460MB;;;0;495 Would be great to have a fix soon - this is quite bad since i cannot trust check_disk anymore with that... ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2006-11-02 22:20 Message: Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-10-19 15:49 Message: Logged In: YES user_id=664364 Doesn't look like any updates since I last requested in July. Marking call into pending. Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-07-19 19:18 Message: Logged In: YES user_id=664364 Ted, Can you try the latest snapshot at http://nagiosplug.sf.net/snapshot. There have been major changes to check_disk to sync it with coreutils' df so there shouldn't be sign problems. If you still have problems, can you tell me what version of df are you using? Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2005-11-08 07:05 Message: Logged In: YES user_id=664364 >From 1.4 onwards, we use the GNU coreutils library to get df data. I don't know if FreeBSD use their own routines or not, but GNU coreutils should support it. Yes, I guess signed integers should fix. Was an assumption on our part that values would be always positive. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-08 06:28 Message: Logged In: YES user_id=226838 hi, well chalk this up to my having been away from traditional unix/bsd implementations. afaict in linux such reserved space is still taken into calculation of total available space (ie, you could get ENOSPC before the disk reached 0%). but anyway, i think the fix is still obvious, that we should do all scans and assignments as signed integers instead of unsigned. if i don't hear any complaints from anyone else on the plugins team, i'll probably do this at some point (and hope that it doesn't break something else) also, having taken a look at the check_disk code, i can't seem to find any references to the df program... so i guess if you're using 1.4.2 or later that it's purely within the internal disk space routines. ---------------------------------------------------------------------- Comment By: Ted Cabeen (secabeen) Date: 2005-11-07 16:25 Message: Logged In: YES user_id=40466 All modern unix file-systems reserve a portion (5-10%) of the disk space for use by root only and to speed disk accesses. If the root user exceeds the normal disk space and uses some of the reserve space, the system will represent the amount of free space as negative. I don't know how check_disk is checking the disk space (df or internal routines). Is there an easy way to check? check_disk (nagios-plugins 1.4.2) 1.57 is the version I'm running. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-07 07:56 Message: Logged In: YES user_id=226838 hi, um, i just have to ask. how do you have negative free space? some other information that would be helpful: - is check_disk using the df command or internal disk space routines? - if df, what df command syntax is check_disk using? - what version of the plugins are you using? i believe that the plugin is making an assumption that the amount of disk space available is unsigned, because, er... well i'd never heard of negative disk space, anyway :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 From dermoth at aei.ca Sat Dec 8 18:57:01 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Sat, 08 Dec 2007 12:57:01 -0500 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1348746 ] check_disk reports incorrect disk free with neg space on BSD In-Reply-To: References: Message-ID: <475ADAED.708@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 08/12/07 11:53 AM, SourceForge.net wrote: > Bugs item #1348746, was opened at 2005-11-04 19:59 > Message generated for change (Comment added) made by dermoth > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 > > >> Comment By: Thomas Guyot (dermoth) > Date: 2007-12-08 11:53 > > Message: > Logged In: YES > user_id=375623 > Originator: NO > > This is fixed in SVN. The root cause of the problem is in Gnulib which is > why it was so hard to track this problem; I implemented a simple workaround > in check_disk. The credits should go to Matthias as he was kind enough to > upload me a FreeBSD VM to test on. > > You can try on the latest SVN HEAD (which will likely be released next > week) or use the next daily snapshot. > > To get the HEAD: > > $ svn co > http://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk/ > nagiosplug > > Snapshots are there (Make sure it's at least Dec. 9 2007): > http://nagiosplug.sourceforge.net/snapshot/ With that commit we're good to release Nagios-plugins :) Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHWtrt6dZ+Kt5BchYRAnQaAJ0QULXWfCh5xnQE9DHGp8b/6nR2hACeJmhd SvStX8KxTXMO4ukswarUryc= =xUFD -----END PGP SIGNATURE----- From dermoth at aei.ca Sun Dec 9 18:19:17 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Sun, 09 Dec 2007 12:19:17 -0500 Subject: [Nagiosplug-devel] Translations - how to add plugins Message-ID: <475C2395.9000506@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I wanted to add french translations for check_ntp_time and check_ntp_peer and I can't find how to add the translation files. I also noticed check_cluster isn't there either. Is there a howto around? Thanks, Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXCOV6dZ+Kt5BchYRAor+AKC0SgU/MqTNuMGkIhrb3Vn7MtSxFgCfT+Tf qQ4JEF07oNFif9bxKtp5WNM= =MdAw -----END PGP SIGNATURE----- From dermoth at aei.ca Mon Dec 10 00:44:46 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Sun, 09 Dec 2007 18:44:46 -0500 Subject: [Nagiosplug-devel] Translations - how to add plugins In-Reply-To: <475C2395.9000506@aei.ca> References: <475C2395.9000506@aei.ca> Message-ID: <475C7DEE.4050003@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/12/07 12:19 PM, Thomas Guyot-Sionnest wrote: > I wanted to add french translations for check_ntp_time and > check_ntp_peer and I can't find how to add the translation files. I also > noticed check_cluster isn't there either. > > Is there a howto around? I finally figured out: po/POTFILES.in. It would be nice to have some documentation in the developer guidelines about that... Since I barely manage to translate things there's little chance I write it though. Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXH3u6dZ+Kt5BchYRAmsFAJwKCcQxBTZg7vG1TZQM19OhtAs5pwCfYr5e 6Jcgm9/Okcv4sLVBal49V0M= =8bib -----END PGP SIGNATURE----- From noreply at sourceforge.net Mon Dec 10 01:20:58 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sun, 09 Dec 2007 16:20:58 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1831890 ] check_load takes only triplets now Message-ID: Bugs item #1831890, was opened at 2007-11-14 17:43 Message generated for change (Comment added) made by psychotrahe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1831890&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Argument proccessing Group: Release (specify) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Jonathan Kamens (jikamens) >Assigned to: Matthias Eble (psychotrahe) Summary: check_load takes only triplets now Initial Comment: "/usr/lib/nagios/plugins/check_load -w 5 -c 10" in nagios-plugins 1.4.9 fails with "Warning threshold must be float or float triplet!" Last time I checked :-), "5" and "10" were both valid floats. If I replace them with "5,5,5" and "10,10,10", it works. This problem appears to have been introduced some time between 1.4.1 and 1.4.9. check_load (nagios-plugins 1.4) 1.27 Linux, CentOS 5, 32-bit, nagios-plugins RHEL5 RPM from DAG repository. ---------------------------------------------------------------------- >Comment By: Matthias Eble (psychotrahe) Date: 2007-12-10 01:20 Message: Logged In: YES user_id=1694341 Originator: NO Hello Jonathan, yes, that's a bug. It's fixed in svn and will be part of the next release. Thanks for your support. Matthias ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1831890&group_id=29880 From noreply at sourceforge.net Mon Dec 10 01:32:26 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sun, 09 Dec 2007 16:32:26 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1764502 ] Add support for directories to check_file_age Message-ID: Patches item #1764502, was opened at 2007-07-31 15:23 Message generated for change (Comment added) made by psychotrahe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1764502&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Chris Wilson (gcc) Assigned to: Nobody/Anonymous (nobody) Summary: Add support for directories to check_file_age Initial Comment: I added to the check_file_age plugin the ability to check directories (with the -d option) as well as files. I also made some cosmetic improvements to reduce the scope of variables to prevent accidental use in future. I hope that these are useful and will be included in the plugin in future. Patch attached against check_file_age (nagios-plugins 1.4.2) $Id: check_file_age.pl,v 1.2 2003/10/21 15:56:35 tonvoon Exp ---------------------------------------------------------------------- >Comment By: Matthias Eble (psychotrahe) Date: 2007-12-10 01:32 Message: Logged In: YES user_id=1694341 Originator: NO Hi Chris, it looks like this was already added in 1.4.3. But thanks anyway. Matthias ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1764502&group_id=29880 From noreply at sourceforge.net Mon Dec 10 02:15:44 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sun, 09 Dec 2007 17:15:44 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1817228 ] check_http: Displays WARNING on critical response time Message-ID: Patches item #1817228, was opened at 2007-10-21 07:39 Message generated for change (Comment added) made by psychotrahe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1817228&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Bugfix Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Nobuhiro Ban (ban_nobuhiro) >Assigned to: Matthias Eble (psychotrahe) Summary: check_http: Displays WARNING on critical response time Initial Comment: Problems: 1. check_http returns 2 (STATE_CRITICAL) if the reaponse time is longer than critical check time threshold (argument -c), but shows ``WARNING''. % check_http -w 0.1 -c 0.2 -H sourceforge.net HTTP WARNING: HTTP/1.0 200 OK - 0.654 second response time |time=0.654401s;0.100000;0.200000;0.000000 size=25176B;;;0 % echo $? 2 2. Error messages for time threshold options (-c and -w) are wrong. These options accept float number. How to fix: 1. Apply the attached patch. 2. And fix the gettext .po files. (Sorry, no patch is ready) ---------------------------------------------------------------------- >Comment By: Matthias Eble (psychotrahe) Date: 2007-12-10 02:15 Message: Logged In: YES user_id=1694341 Originator: NO Hi, I've just committed a fix for this problem to svn. Thanks for your report Matthias ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1817228&group_id=29880 From noreply at sourceforge.net Mon Dec 10 02:38:41 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sun, 09 Dec 2007 17:38:41 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Feature Requests-881670 ] Wildcarding option in use of '-x' switch Message-ID: Feature Requests item #881670, was opened at 2004-01-21 21:21 Message generated for change (Comment added) made by psychotrahe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881670&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Martin Gignac (lmcgign) Assigned to: Nobody/Anonymous (nobody) Summary: Wildcarding option in use of '-x' switch Initial Comment: I was wondering if there any plans to include the possibility of wildcarding filesystems with '*' for example when using the '-x' switch. For example, when mounting a Solaris install CD on a Solaris box, the Solaris CD automounter creates six distinct "mount points" automatically. These mount points are dynamic and contain (among other things) the name of the CD. For example: /cdrom/solaris_8_hw1001_sparc/s0 /cdrom/solaris_8_hw1001_sparc/s1 /cdrom/solaris_8_hw1001_sparc/s2 /cdrom/solaris_8_hw1001_sparc/s3 /cdrom/solaris_8_hw1001_sparc/s4 and /cdrom/solaris_8_hw1001_sparc/s5 are all new mount points created when CD X is entered. If another CD is entered, then the mount point name after the '/cdrom/' will change, making it hard to exclude these "moving target" filesystems. And since a CD-ROM file system always shows up as 0% free, a CRITICAL event is generated by the plugin as soon as a CD is inserted in the SUN box. Excluding a filesystem type will not work either as 's0' shows up as 'hsfs' and the rest all show up as 'ufs' Excludng 'ufs' would pretty much eliminate checks on all Solaris partitions while eliminating 'hsfs' still leaves the other s1-s5 partitions (some of which are at 98% full) and that still generates an alarm. If wildcarding could be done with the '-p' switch, such as: check_disk -w 20% -c 20% -x "/cdrom/*" this would prevent any CD from being checked. Regards, -Martin ---------------------------------------------------------------------- >Comment By: Matthias Eble (psychotrahe) Date: 2007-12-10 02:38 Message: Logged In: YES user_id=1694341 Originator: NO Hi Martin, even if you haven't expected an answer to this post any more.. some versions ago, check_disk -i was introduced to ignore paths matching regexes. Matthias ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881670&group_id=29880 From noreply at sourceforge.net Mon Dec 10 14:59:26 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 10 Dec 2007 05:59:26 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap) Message-ID: Patches item #1847879, was opened at 2007-12-10 14:59 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1847879&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christian Heim (g_phreak) Assigned to: Nobody/Anonymous (nobody) Summary: check_ram plugin (based on check_swap) Initial Comment: Find attached a C-based version of the check_ram plugin. The code is based upon the check_swap plugin minus the BSD/AIX (and others) code. Most credit probably goes to Karl DeBisschop (who initially wrote check_swap). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1847879&group_id=29880 From ae at op5.se Mon Dec 10 15:35:47 2007 From: ae at op5.se (Andreas Ericsson) Date: Mon, 10 Dec 2007 15:35:47 +0100 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap) In-Reply-To: References: Message-ID: <475D4EC3.1020008@op5.se> SourceForge.net wrote: > Patches item #1847879, was opened at 2007-12-10 14:59 Message > generated for change (Tracker Item Submitted) made by Item Submitter > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1847879&group_id=29880 > > > Please note that this message will contain a full copy of the comment > thread, including the initial issue submission, for this request, not > just the latest update. Category: Enhancement Group: None Status: > Open Resolution: None Priority: 5 Private: No Submitted By: Christian > Heim (g_phreak) Assigned to: Nobody/Anonymous (nobody) Summary: > check_ram plugin (based on check_swap) > > Initial Comment: Find attached a C-based version of the check_ram > plugin. The code is based upon the check_swap plugin minus the > BSD/AIX (and others) code. > Why not just use sysconf(_SC_PHYS_PAGES) - sysconf(_SC_AV_PHYS_PAGES) ? Fiddling with /proc/meminfo isn't very portable. -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 From ton.voon at altinity.com Mon Dec 10 16:04:59 2007 From: ton.voon at altinity.com (Ton Voon) Date: Mon, 10 Dec 2007 15:04:59 +0000 Subject: [Nagiosplug-devel] Fwd: Coreutils bug? (was: [Nagiosplug-checkins] SF.net SVN: nagiosplug: [1848] nagiosplug/trunk) References: Message-ID: Thomas, Saw this commit. I find it hard to believe that gnulib is wrong. Is this how df.c works in coreutils? Maybe I missed something when I was duplicating the df code. Alternatively, maybe we should do a sync with gnulib? Any volunteers? I'm happy to go through it with someone and we can put an entry in nagiosplugins.org while we do it. Ton Begin forwarded message: > From: dermoth at users.sourceforge.net > Date: 8 December 2007 16:34:20 GMT > To: nagiosplug-checkins at lists.sourceforge.net > Subject: [Nagiosplug-checkins] SF.net SVN: nagiosplug: [1848] > nagiosplug/trunk > Reply-To: nagiosplug-devel at lists.sourceforge.net > > Revision: 1848 > http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1848&view=rev > Author: dermoth > Date: 2007-12-08 08:34:05 -0800 (Sat, 08 Dec 2007) > > Log Message: > ----------- > Fix check_disk reporting OK if disk usage grows over 100% (bug > #1348746). > > Modified Paths: > -------------- > nagiosplug/trunk/NEWS > nagiosplug/trunk/plugins/check_disk.c > > Modified: nagiosplug/trunk/NEWS > =================================================================== > --- nagiosplug/trunk/NEWS 2007-12-04 12:57:35 UTC (rev 1847) > +++ nagiosplug/trunk/NEWS 2007-12-08 16:34:05 UTC (rev 1848) > @@ -13,6 +13,8 @@ > Merge two new checks that deprecates check_ntp: check_ntp_peer and > check_ntp_time. > You should read the --help output so see which one is suitable > for you. check_ntp_peer > implement stratum thresholds support (feature request #1703823). > + Fix check_disk reporting OK if disk usage grows over 100% (bug > #1348746). > + The problem happens to be in Gnulib but a workaround have been > implemented in check_disk.c > > 1.4.10 28th September 2007 > Fix check_http buffer overflow vulnerability when following HTTP > redirects > > Modified: nagiosplug/trunk/plugins/check_disk.c > =================================================================== > --- nagiosplug/trunk/plugins/check_disk.c 2007-12-04 12:57:35 UTC > (rev 1847) > +++ nagiosplug/trunk/plugins/check_disk.c 2007-12-08 16:34:05 UTC > (rev 1848) > @@ -307,10 +307,17 @@ > > if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) { > total = fsp.fsu_blocks; > - available = fsp.fsu_bavail; > + /* 2007-12-08 - Workaround for Gnulib reporting insanely high > available > + * space on BSD (the actual value should be negative but > fsp.fsu_bavail > + * is unsigned) */ > + available = fsp.fsu_bavail > fsp.fsu_bfree ? 0 : > fsp.fsu_bavail; > available_to_root = fsp.fsu_bfree; > used = total - available_to_root; > > + if (verbose >= 3) > + printf ("For %s, total=%llu, available=%llu, > available_to_root=%llu, used=%llu, fsp.fsu_files=%llu, fsp.fsu_ffree= > %llu\n", > + me->me_mountdir, total, available, available_to_root, used, > fsp.fsu_files, fsp.fsu_ffree); > + > dused_pct = calculate_percent( used, used + available ); /* > used + available can never be > uintmax */ > > dfree_pct = 100 - dused_pct; > > > This was sent by the SourceForge.net collaborative development > platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Nagiosplug-checkins mailing list > Nagiosplug-checkins at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-checkins http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From dermoth at aei.ca Mon Dec 10 20:22:25 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Mon, 10 Dec 2007 14:22:25 -0500 Subject: [Nagiosplug-devel] Fwd: Coreutils bug? In-Reply-To: References: Message-ID: <475D91F1.1090804@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/12/07 10:04 AM, Ton Voon wrote: > Thomas, > > Saw this commit. I find it hard to believe that gnulib is wrong. Is > this how df.c works in coreutils? Maybe I missed something when I was > duplicating the df code. When gnulib's variable is signed and available free space returns an insanely high number, I call it a bug (it should return a negative number which is impossible due to the unsigned nature of the variable). I tried assigning it to a signed int of the same size and it didn't change, so looks like the wraparound happens on the signed portion of the integer! I haven't looked at coreutils and *BSD use their own BSD-licensed df. I think considering our limited development time there's more productive things to do for now :) > Alternatively, maybe we should do a sync with gnulib? Any volunteers? > I'm happy to go through it with someone and we can put an entry in > nagiosplugins.org while we do it. If there are clear and simple path to it I could give it a shot after next release... Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXZHw6dZ+Kt5BchYRAiCrAJ4nsiY2AnJTt2b0ifPqx01WfjgQXgCgpCkn 7fUOw4t0T/HjHotb0wka3o0= =BglM -----END PGP SIGNATURE----- From dermoth at aei.ca Mon Dec 10 20:25:17 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Mon, 10 Dec 2007 14:25:17 -0500 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap) In-Reply-To: <475D4EC3.1020008@op5.se> References: <475D4EC3.1020008@op5.se> Message-ID: <475D929D.8040603@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/12/07 09:35 AM, Andreas Ericsson wrote: > SourceForge.net wrote: >> Patches item #1847879, was opened at 2007-12-10 14:59 Message >> generated for change (Tracker Item Submitted) made by Item Submitter >> You can respond by visiting: >> https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1847879&group_id=29880 >> >> >> Please note that this message will contain a full copy of the comment >> thread, including the initial issue submission, for this request, not >> just the latest update. Category: Enhancement Group: None Status: >> Open Resolution: None Priority: 5 Private: No Submitted By: Christian >> Heim (g_phreak) Assigned to: Nobody/Anonymous (nobody) Summary: >> check_ram plugin (based on check_swap) >> >> Initial Comment: Find attached a C-based version of the check_ram >> plugin. The code is based upon the check_swap plugin minus the >> BSD/AIX (and others) code. >> > > Why not just use sysconf(_SC_PHYS_PAGES) - sysconf(_SC_AV_PHYS_PAGES) ? > > Fiddling with /proc/meminfo isn't very portable. Lol. I didn't read the plug-in yet but I would have assumed from start that it was portable. I'm sure we want a memory check plugin, so I'll rework it it there's a way to make it portable. This won't be for the upcoming release though... Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXZKd6dZ+Kt5BchYRAvjpAKCq3DKgK3VPpzTqA9AiKu1JaKbuIwCgymim aAcj2sSy3Vt/qqHAC5HItE0= =T8oD -----END PGP SIGNATURE----- From ae at op5.se Tue Dec 11 09:13:44 2007 From: ae at op5.se (Andreas Ericsson) Date: Tue, 11 Dec 2007 09:13:44 +0100 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap) In-Reply-To: <475D929D.8040603@aei.ca> References: <475D4EC3.1020008@op5.se> <475D929D.8040603@aei.ca> Message-ID: <475E46B8.7040407@op5.se> Thomas Guyot-Sionnest wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 10/12/07 09:35 AM, Andreas Ericsson wrote: >> SourceForge.net wrote: >>> Patches item #1847879, was opened at 2007-12-10 14:59 Message >>> generated for change (Tracker Item Submitted) made by Item Submitter >>> You can respond by visiting: >>> https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1847879&group_id=29880 >>> >>> >>> Please note that this message will contain a full copy of the comment >>> thread, including the initial issue submission, for this request, not >>> just the latest update. Category: Enhancement Group: None Status: >>> Open Resolution: None Priority: 5 Private: No Submitted By: Christian >>> Heim (g_phreak) Assigned to: Nobody/Anonymous (nobody) Summary: >>> check_ram plugin (based on check_swap) >>> >>> Initial Comment: Find attached a C-based version of the check_ram >>> plugin. The code is based upon the check_swap plugin minus the >>> BSD/AIX (and others) code. >>> >> Why not just use sysconf(_SC_PHYS_PAGES) - sysconf(_SC_AV_PHYS_PAGES) ? >> >> Fiddling with /proc/meminfo isn't very portable. > > Lol. I didn't read the plug-in yet but I would have assumed from start > that it was portable. I'm sure we want a memory check plugin, so I'll > rework it it there's a way to make it portable. This won't be for the > upcoming release though... > _SC_PHYS_PAGES and _SC_AV_PHYS_PAGES are in POSIX.1-2001. They need to be multiplied with _SC_PAGESIZE (defined in the same standard) to get actual byte values (which may well be huge), but many systems support it even though they don't follow the rest of the standard. I'd suggest finding the correct value to divide the resource-values with to get human-readable numbers and just storing everything in unsigned long's. Something like the attached, perhaps? It doesn't really give very accurate numbers though, since nearly all unices cache until physical RAM is pretty much full. It doesn't parse arguments or anything either, but should give a decent idea of how one could go about implementing it fairly portable. It's commented to the point of being insulting, since I have no idea who might get his/her hands on it and I really don't feel like answering questions about that particular subject ;-) -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 -------------- next part -------------- A non-text attachment was scrubbed... Name: check_ram.c Type: text/x-csrc Size: 1091 bytes Desc: not available URL: From ton.voon at altinity.com Tue Dec 11 10:12:29 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 11 Dec 2007 09:12:29 +0000 Subject: [Nagiosplug-devel] Fwd: Coreutils bug? In-Reply-To: <475D91F1.1090804@aei.ca> References: <475D91F1.1090804@aei.ca> Message-ID: <661DAAB3-50D0-4EEC-B139-DC44583D2832@altinity.com> On 10 Dec 2007, at 19:22, Thomas Guyot-Sionnest wrote: > On 10/12/07 10:04 AM, Ton Voon wrote: >> Alternatively, maybe we should do a sync with gnulib? Any volunteers? >> I'm happy to go through it with someone and we can put an entry in >> nagiosplugins.org while we do it. > > If there are clear and simple path to it I could give it a shot after > next release... OK, let's do this after the release. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From ton.voon at altinity.com Tue Dec 11 11:19:48 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 11 Dec 2007 10:19:48 +0000 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 Message-ID: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> Hi! I'm just checking over the tinderbox builds before creating the new release, and there are a couple of failures that need investigating: http://tinderbox.altinity.org/nagiosplug/status.html check_ntp errors: tests are failing on Holger's Vatikan box and tola box (forgot who's that belongs to) check_ping: I think these are known errors on Holger's enterprise freebsd box test_cmd.t: My mini1 box test_base64.t: My opsviewdev1 box I'll look into the two boxes that I own. I'm surprised that test_base64 is failing given the simplicity of the test and the code. Any ideas on why this is? Also, I think Holger mentioned that the logs were not very interesting as they do not show enough detail. I'll see if there is a switch in Test::Harness to dump extra information. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From ton.voon at altinity.com Tue Dec 11 13:06:49 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 11 Dec 2007 12:06:49 +0000 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> Message-ID: <7D19E295-7628-4664-8AEE-177E55AC0C65@altinity.com> On 11 Dec 2007, at 10:19, Ton Voon wrote: > test_cmd.t: > My mini1 box Found this is a difference in Mac OS X to other unices (/bin/grep doesn't exist - is in /usr/sbin/grep). I've changed the test to use / bin/sh which should be available on all Unix systems. I've also added a test to check for a non-existent command too. In svn now. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From dermoth at aei.ca Tue Dec 11 14:31:36 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Tue, 11 Dec 2007 08:31:36 -0500 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> Message-ID: <475E9138.8030204@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/12/07 05:19 AM, Ton Voon wrote: > Hi! > > I'm just checking over the tinderbox builds before creating the new > release, and there are a couple of failures that need investigating: > > http://tinderbox.altinity.org/nagiosplug/status.html > > check_ntp errors: > tests are failing on Holger's Vatikan box and tola box (forgot > who's that belongs to) Tests 39-42 have a bare '~' in the threshold ranges. My guess is that there's a small difference causing the ~ to get expanded to $HOME. I put a \ in front if them. Test 20 is the read function returning -1 if an ICMP port unreachable message came back (those are often blocked by firewalls). Fixed. > test_base64.t: > My opsviewdev1 box > > I'll look into the two boxes that I own. I'm surprised that > test_base64 is failing given the simplicity of the test and the code. > Any ideas on why this is? > > Also, I think Holger mentioned that the logs were not very interesting > as they do not show enough detail. I'll see if there is a switch in > Test::Harness to dump extra information. Dumping each command ran in verbose mode would be awesome. I find myself often trying to reproduce what was actually run to find what certain tests failed. Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXpE46dZ+Kt5BchYRAsz0AJ9SJdmlPTmJIZySadQ3Ut3pab/P+QCgpvbM QVjoN3RRWHejpsUIzjUasCA= =9cVY -----END PGP SIGNATURE----- From dermoth at aei.ca Tue Dec 11 14:51:33 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Tue, 11 Dec 2007 08:51:33 -0500 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1847879 ] check_ram plugin (based on check_swap) In-Reply-To: <475E46B8.7040407@op5.se> References: <475D4EC3.1020008@op5.se> <475D929D.8040603@aei.ca> <475E46B8.7040407@op5.se> Message-ID: <475E95E5.20900@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/12/07 03:13 AM, Andreas Ericsson wrote: > Thomas Guyot-Sionnest wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 10/12/07 09:35 AM, Andreas Ericsson wrote: >>> Why not just use sysconf(_SC_PHYS_PAGES) - sysconf(_SC_AV_PHYS_PAGES) ? >>> >>> Fiddling with /proc/meminfo isn't very portable. >> >> Lol. I didn't read the plug-in yet but I would have assumed from start >> that it was portable. I'm sure we want a memory check plugin, so I'll >> rework it it there's a way to make it portable. This won't be for the >> upcoming release though... >> > > _SC_PHYS_PAGES and _SC_AV_PHYS_PAGES are in POSIX.1-2001. They need to > be multiplied with _SC_PAGESIZE (defined in the same standard) to get > actual byte values (which may well be huge), but many systems support > it even though they don't follow the rest of the standard. > > I'd suggest finding the correct value to divide the resource-values > with to get human-readable numbers and just storing everything in > unsigned long's. Thanks for the info! > Something like the attached, perhaps? It doesn't really give very > accurate numbers though, since nearly all unices cache until physical > RAM is pretty much full. It doesn't parse arguments or anything I'm aware of that. Honestly there's not much point of a ram check that doesn't subtracts cache memory. While it works on most servers, servers with very stable memory usage can get very close to 0 MB free (I've seen only a few megs free on our 32GB database, for example!). I'll see what I can do. Maybe getting cache via another mean on supported platforms... There's plenty of memory checks out there not taking count of cache anyways ;) Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXpXl6dZ+Kt5BchYRAmVZAKCSq24JvNBzYFdri+La2htgRH/T+QCgkCee VZ2Il0ZMyfKoFrPuqBm1BEs= =2vM6 -----END PGP SIGNATURE----- From nagios at babar.us Tue Dec 11 14:54:27 2007 From: nagios at babar.us (Olivier 'Babar' Raginel) Date: Tue, 11 Dec 2007 14:54:27 +0100 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> Message-ID: <20071211135427.GA28914@mail.babar.us> On Tue, Dec 11, 2007 at 10:19:48AM +0000, Ton Voon wrote: > check_ntp errors: > tests are failing on Holger's Vatikan box and tola box (forgot > who's that belongs to) tola is my home box, used to test check_ups. Here is a detailed output of the errors, which are due to the range of ~:-1: (I've removed the ok tests, let me know if you need more information) Also, I've noted the "Range format incorrect "message doesn't contain a newline character at the end, is that on purpose? $ NPTEST_DEBUG=1 perl t/check_ntp.t [...skip...] not ok 20 - check_ntp_peer: Output match no NTP service # Failed test 'check_ntp_peer: Output match no NTP service' # in t/check_ntp.t at line 73. # 'NTP CRITICAL: Server not synchronized, Offset unknown|' # doesn't match '/^(CRITICAL - Socket timeout after 3 seconds)|(NTP CRITICAL: No response from NTP server)$/' [...skip...] testCmd: Called from line 99 in t/check_ntp.t Testing: ./check_ntp_peer -H pool.ntp.org -w 1000 -c 2000 -W ~:-1 -C 21 -j 100000 -k 200000 Output: Range format incorrect Return code: 3 not ok 39 - check_ntp_peer: Warning NTP result with jitter and stratum check # Failed test 'check_ntp_peer: Warning NTP result with jitter and stratum check' # in t/check_ntp.t at line 102. # got: 3 # expected: 1 not ok 40 - check_ntp_peer: Output match WARNING with jitter and stratum # Failed test 'check_ntp_peer: Output match WARNING with jitter and stratum' # in t/check_ntp.t at line 103. # 'Range format incorrect' # doesn't match '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}/' testCmd: Called from line 105 in t/check_ntp.t Testing: ./check_ntp_peer -H pool.ntp.org -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k ~:-1 Output: Range format incorrect Return code: 3 not ok 41 - check_ntp_peer: Critical NTP result with jitter and stratum check # Failed test 'check_ntp_peer: Critical NTP result with jitter and stratum check' # in t/check_ntp.t at line 108. # got: 3 # expected: 2 not ok 42 - check_ntp_peer: Output match CRITICAL with jitter and stratum # Failed test 'check_ntp_peer: Output match CRITICAL with jitter and stratum' # in t/check_ntp.t at line 109. # 'Range format incorrect' # doesn't match '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}/' # Looks like you failed 5 tests of 42. So 4 tests fail because of range format incorrect, other one seems to be that the error message returned is not the one the tests expects. As I don't really understand why it shouldn't return this message (from the code, it looks fine), I can't help you. Let me know if you need to test anything else. Kind regards, -- Babar. From dermoth at aei.ca Tue Dec 11 15:06:20 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Tue, 11 Dec 2007 09:06:20 -0500 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <20071211135427.GA28914@mail.babar.us> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <20071211135427.GA28914@mail.babar.us> Message-ID: <475E995C.4020408@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/12/07 08:54 AM, Olivier 'Babar' Raginel wrote: > On Tue, Dec 11, 2007 at 10:19:48AM +0000, Ton Voon wrote: >> check_ntp errors: >> tests are failing on Holger's Vatikan box and tola box (forgot >> who's that belongs to) > > tola is my home box, used to test check_ups. Try using SVN HEAD or applying the attached patch. Test #20 should be fixed and hopefully tests 39-42 as well. Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXplc6dZ+Kt5BchYRAlnAAJ9gXiBoNhXuJ20RXV5dvZED00XBDACgoYD6 ymhAfnuyc60kE0eZ+99BNtA= =AVVB -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: check_ntp.various_fixes.patch Type: text/x-diff Size: 1764 bytes Desc: not available URL: From nagios at babar.us Tue Dec 11 15:20:39 2007 From: nagios at babar.us (Olivier 'Babar' Raginel) Date: Tue, 11 Dec 2007 15:20:39 +0100 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475E995C.4020408@aei.ca> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <20071211135427.GA28914@mail.babar.us> <475E995C.4020408@aei.ca> Message-ID: <20071211142039.GA12152@mail.babar.us> On Tue, Dec 11, 2007 at 09:06:20AM -0500, Thomas Guyot-Sionnest wrote: > Try using SVN HEAD or applying the attached patch. Test #20 should be > fixed and hopefully tests 39-42 as well. All tests are successful with these changes, which I manually applied. -- Babar. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From ae at op5.se Tue Dec 11 15:29:36 2007 From: ae at op5.se (Andreas Ericsson) Date: Tue, 11 Dec 2007 15:29:36 +0100 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475E9138.8030204@aei.ca> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> Message-ID: <475E9ED0.9090008@op5.se> Thomas Guyot-Sionnest wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 11/12/07 05:19 AM, Ton Voon wrote: >> Hi! >> >> I'm just checking over the tinderbox builds before creating the new >> release, and there are a couple of failures that need investigating: >> >> http://tinderbox.altinity.org/nagiosplug/status.html >> >> check_ntp errors: >> tests are failing on Holger's Vatikan box and tola box (forgot >> who's that belongs to) > > Tests 39-42 have a bare '~' in the threshold ranges. My guess is that > there's a small difference causing the ~ to get expanded to $HOME. I put > a \ in front if them. > > Test 20 is the read function returning -1 if an ICMP port unreachable > message came back (those are often blocked by firewalls). Fixed. > >> test_base64.t: >> My opsviewdev1 box >> >> I'll look into the two boxes that I own. I'm surprised that >> test_base64 is failing given the simplicity of the test and the code. >> Any ideas on why this is? >> >> Also, I think Holger mentioned that the logs were not very interesting >> as they do not show enough detail. I'll see if there is a switch in >> Test::Harness to dump extra information. > > Dumping each command ran in verbose mode would be awesome. I find myself > often trying to reproduce what was actually run to find what certain > tests failed. > If you're looking at reworking/improving the test-suite, sneak a peek at what git uses. It's quite amazingly simple to add additional tests to it, although it doesn't solve the worst issue with the plugins (environment to test in). Oh, and it's in shell, so even us poor perl illiterate folks can join in on the testing frenzy ;-) -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 From dermoth at aei.ca Tue Dec 11 15:50:37 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Tue, 11 Dec 2007 09:50:37 -0500 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475E9ED0.9090008@op5.se> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> <475E9ED0.9090008@op5.se> Message-ID: <475EA3BD.2030403@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/12/07 09:29 AM, Andreas Ericsson wrote: > Thomas Guyot-Sionnest wrote: >> On 11/12/07 05:19 AM, Ton Voon wrote: >>> test_base64.t: >>> My opsviewdev1 box >>> >>> I'll look into the two boxes that I own. I'm surprised that >>> test_base64 is failing given the simplicity of the test and the code. >>> Any ideas on why this is? >>> >>> Also, I think Holger mentioned that the logs were not very interesting >>> as they do not show enough detail. I'll see if there is a switch in >>> Test::Harness to dump extra information. >> Dumping each command ran in verbose mode would be awesome. I find myself >> often trying to reproduce what was actually run to find what certain >> tests failed. >> > > If you're looking at reworking/improving the test-suite, sneak a peek at > what git uses. It's quite amazingly simple to add additional tests to it, > although it doesn't solve the worst issue with the plugins (environment > to test in). Oh, and it's in shell, so even us poor perl illiterate folks > can join in on the testing frenzy ;-) What you do with git looks nice but do you have a simple tutorial to start with (hint: apart the fact that it's the Linux kernel's RCS I know absolutely nothing about it)? ;) Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXqO96dZ+Kt5BchYRAh5wAKCOUJoOXt5cCJQKz5PfYtxjJR8RwgCfaoSO TXQvvJiIuf2x5PnLLUs64AA= =YbrH -----END PGP SIGNATURE----- From ae at op5.se Tue Dec 11 22:12:32 2007 From: ae at op5.se (Andreas Ericsson) Date: Tue, 11 Dec 2007 22:12:32 +0100 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475EA3BD.2030403@aei.ca> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> <475E9ED0.9090008@op5.se> <475EA3BD.2030403@aei.ca> Message-ID: <475EFD40.6070301@op5.se> Thomas Guyot-Sionnest wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 11/12/07 09:29 AM, Andreas Ericsson wrote: >> Thomas Guyot-Sionnest wrote: >>> On 11/12/07 05:19 AM, Ton Voon wrote: >>>> test_base64.t: >>>> My opsviewdev1 box >>>> >>>> I'll look into the two boxes that I own. I'm surprised that >>>> test_base64 is failing given the simplicity of the test and the code. >>>> Any ideas on why this is? >>>> >>>> Also, I think Holger mentioned that the logs were not very interesting >>>> as they do not show enough detail. I'll see if there is a switch in >>>> Test::Harness to dump extra information. >>> Dumping each command ran in verbose mode would be awesome. I find myself >>> often trying to reproduce what was actually run to find what certain >>> tests failed. >>> >> If you're looking at reworking/improving the test-suite, sneak a peek at >> what git uses. It's quite amazingly simple to add additional tests to it, >> although it doesn't solve the worst issue with the plugins (environment >> to test in). Oh, and it's in shell, so even us poor perl illiterate folks >> can join in on the testing frenzy ;-) > > What you do with git looks nice but do you have a simple tutorial to > start with (hint: apart the fact that it's the Linux kernel's RCS I know > absolutely nothing about it)? ;) > Well, the git docs are here: http://www.kernel.org/pub/software/scm/git/docs/ But you should be able to grab a tar-ball and just have a look at any file under t/ to get an idea of how to write tests using the test-lib we've cooked up for git. In short though, it works like this: --%<---%<---%<--- . test-lib.sh test_description 'A simple test for sed' test_expect_success 'Test single char substitution' \ ' var=$(echo foo | sed s/f//) test "$var" = "oo" ' test_done ---%<---%<---%<--- Which would produce the following output * ok 1: Test single char substitution * passed all 1 test(s) with the last line printed in green when all tests pass, and in red when any of them fail. One can stack any amount of tests between test_description and test_done. The really nifty thing about this mode of testing is that each test is a shell-script on its own, so it's easy to set up a small environment for the commands that need it using plain shell commands between tests. We're looking into using it for pretty much everything except neb-modules at the moment (nebs always need their own tester). Tests can also be skipped quite easily if some predefined criteria isn't matched, such as a certain program not being installed or some such. Ah well, I'll stop preaching and go back to fiddling with Nagios' config reading instead. It's just that wretched template chaining left before it's done. -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 From ton.voon at altinity.com Wed Dec 12 00:40:30 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 11 Dec 2007 23:40:30 +0000 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475EFD40.6070301@op5.se> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> <475E9ED0.9090008@op5.se> <475EA3BD.2030403@aei.ca> <475EFD40.6070301@op5.se> Message-ID: <3A253E3A-7287-48A6-B0CF-F18C36F5F5AB@altinity.com> On 11 Dec 2007, at 21:12, Andreas Ericsson wrote: > In short though, it works like this: > > --%<---%<---%<--- > . test-lib.sh > test_description 'A simple test for sed' > > test_expect_success 'Test single char substitution' \ > ' > var=$(echo foo | sed s/f//) > test "$var" = "oo" > ' > > test_done > ---%<---%<---%<--- > > Which would produce the following output > > * ok 1: Test single char substitution > * passed all 1 test(s) > > with the last line printed in green when all tests pass, and in red > when any of them fail. You just described something exceedingly similar to perl's Test Anything Protocol (http://en.wikipedia.org/wiki/Test_Anything_Protocol and http://search.cpan.org/dist/TAP-1.00/TAP.pm). However, annoyingly, it looks like git's test system doesn't exactly use TAP format, which means it now cannot hook into Test::Harness (http://search.cpan.org/dist/Test-Harness-3.05/lib/Test/Harness.pm ). I can see a place for running shell commands instead of via perl (which is only just invoking executables anyway), but which shell do you program against? Assuming sh is going to be too restrictive. In fact, perl was designed to be a cross platform shell! So it makes sense to stick with that. If you think a tutorial is required for understanding the plugins' test system, then say that - I can see there is probably a hole in this regard: http://nagiosplugins.org/node/12. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From ton.voon at altinity.com Wed Dec 12 00:45:56 2007 From: ton.voon at altinity.com (Ton Voon) Date: Tue, 11 Dec 2007 23:45:56 +0000 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475E9138.8030204@aei.ca> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> Message-ID: On 11 Dec 2007, at 13:31, Thomas Guyot-Sionnest wrote: > Tests 39-42 have a bare '~' in the threshold ranges. My guess is that > there's a small difference causing the ~ to get expanded to $HOME. I > put > a \ in front if them. That exposes an interesting thought - perhaps using ~ as a special character in ranges is a poor choice. Something to bear in mind when changing range definitions.... > Dumping each command ran in verbose mode would be awesome. I find > myself > often trying to reproduce what was actually run to find what certain > tests failed. I agree. I think that it is fair that the tinderbox testing outputs in verbose mode, though I can see that if you were manually running tests, you don't want streams of output. I'll have a go now at creating a new "make test-debug" macro which will dump in verbose and use that for the tinderbox testing. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From dermoth at aei.ca Wed Dec 12 09:17:31 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Wed, 12 Dec 2007 03:17:31 -0500 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> Message-ID: <475F991B.1050002@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/12/07 05:19 AM, Ton Voon wrote: > Hi! > > I'm just checking over the tinderbox builds before creating the new > release, and there are a couple of failures that need investigating: > > http://tinderbox.altinity.org/nagiosplug/status.html > > check_ntp errors: > tests are failing on Holger's Vatikan box and tola box (forgot > who's that belongs to) > > check_ping: > I think these are known errors on Holger's enterprise freebsd box > > test_cmd.t: > My mini1 box My Solaris box too (I just managed to install libtap - I had to add gnulib to get it to work on Solaris so this served as a practice ;) ). It work well with bash instead of sh. $ sh nonexistent nonexistent: not found $ echo $? 1 Assuming everyone have bash we could use /bin/bash in test_cmd.c:205 (worst-case would require a link from bash to sh if there's no bash). > test_base64.t: > My opsviewdev1 box My Solaris box as well. Strangely a SMTP AUTH LOGIN worked on both my PC and Solaris, so it appears to work. The test is probably overkill and it might be wiser to use a few passes with various small data sets (like printable, ASCII, control chars...). Since there was no change to the function this can be ignored. Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHX5kb6dZ+Kt5BchYRAgnkAJ0W6PV4eNtxGFjaz1Z1ygAvUPs9aACg+3nc HfPP90Wookg1qEKsk3kpAj4= =ENbp -----END PGP SIGNATURE----- From ton.voon at altinity.com Wed Dec 12 10:13:11 2007 From: ton.voon at altinity.com (Ton Voon) Date: Wed, 12 Dec 2007 09:13:11 +0000 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <475F991B.1050002@aei.ca> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475F991B.1050002@aei.ca> Message-ID: <8E15F943-9790-4728-99F8-468FA4E4509C@altinity.com> On 12 Dec 2007, at 08:17, Thomas Guyot-Sionnest wrote: >> test_cmd.t: >> My mini1 box > > My Solaris box too (I just managed to install libtap - I had to add > gnulib to get it to work on Solaris so this served as a practice ;) ). > It work well with bash instead of sh. > > $ sh nonexistent > nonexistent: not found > $ echo $? > 1 > > Assuming everyone have bash we could use /bin/bash in test_cmd.c:205 > (worst-case would require a link from bash to sh if there's no bash). Another option is test for non-zero, but I guess that's not definitive. >> test_base64.t: >> My opsviewdev1 box > > My Solaris box as well. Strangely a SMTP AUTH LOGIN worked on both > my PC > and Solaris, so it appears to work. > > The test is probably overkill and it might be wiser to use a few > passes > with various small data sets (like printable, ASCII, control > chars...). > Since there was no change to the function this can be ignored. OK. If you can change to a few smaller tests, that would be good, but can be after this release. I'll probably wait for the next round of tinderbox tests, but otherwise it looks good for a cut later today. Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From ae at op5.se Wed Dec 12 14:38:42 2007 From: ae at op5.se (Andreas Ericsson) Date: Wed, 12 Dec 2007 14:38:42 +0100 Subject: [Nagiosplug-devel] Preparation for release 1.4.11 In-Reply-To: <3A253E3A-7287-48A6-B0CF-F18C36F5F5AB@altinity.com> References: <721F1ABB-7470-429A-AB92-9B4CC4B69C66@altinity.com> <475E9138.8030204@aei.ca> <475E9ED0.9090008@op5.se> <475EA3BD.2030403@aei.ca> <475EFD40.6070301@op5.se> <3A253E3A-7287-48A6-B0CF-F18C36F5F5AB@altinity.com> Message-ID: <475FE462.1000505@op5.se> Ton Voon wrote: > On 11 Dec 2007, at 21:12, Andreas Ericsson wrote: > >> In short though, it works like this: >> >> --%<---%<---%<--- >> . test-lib.sh >> test_description 'A simple test for sed' >> >> test_expect_success 'Test single char substitution' \ >> ' >> var=$(echo foo | sed s/f//) >> test "$var" = "oo" >> ' >> >> test_done >> ---%<---%<---%<--- >> >> Which would produce the following output >> >> * ok 1: Test single char substitution >> * passed all 1 test(s) >> >> with the last line printed in green when all tests pass, and in red >> when any of them fail. > > > You just described something exceedingly similar to perl's Test > Anything Protocol (http://en.wikipedia.org/wiki/Test_Anything_Protocol > and http://search.cpan.org/dist/TAP-1.00/TAP.pm). > It's similar, but not identical. Its output could be made identical pretty easy, but for git's purposes the current design is quite alright and a bit more pleasant than the machine-parsable strict TAP-standard. > > I can see a place for running shell commands instead of via perl > (which is only just invoking executables anyway), but which shell do > you program against? Assuming sh is going to be too restrictive. In > fact, perl was designed to be a cross platform shell! So it makes > sense to stick with that. > > If you think a tutorial is required for understanding the plugins' > test system, then say that - I can see there is probably a hole in > this regard: http://nagiosplugins.org/node/12. > It's more along the lines of "I as a programmer have absolutely no idea of how to add a test". I could do some research, but it's not entirely clear where, or what to look for (I'm a lazy bastard, like everyone else, and started by looking at an existing test). Since I saw Thomas talking about the test-suite on the list, I offered a quick view into the simplest and best-designed testing library for small-ish command-line programs I've seen. -- Andreas Ericsson andreas.ericsson at op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 From noreply at sourceforge.net Thu Dec 13 23:23:44 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 13 Dec 2007 14:23:44 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1789000 ] Minor VPATH prob in plugins-root MF Message-ID: Bugs item #1789000, was opened at 2007-09-05 22:21 Message generated for change (Comment added) made by tonvoon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1789000&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Compilation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Tom Payerle (payerle) >Assigned to: Ton Voon (tonvoon) Summary: Minor VPATH prob in plugins-root MF Initial Comment: When compiling in a subdirectory, e.g. i386_rel30 of main plugins root directory, get the following error after running ../configure make [ eliding much successful compilations ... ] Making all in plugins-root make[2]: Entering directory `[...]/Nagios/src/plugins/nagios-plugins-1.4.9/i386_rel30/plugins-root' make[2]: *** No rule to make target `check_dhcp.c', needed by `check_dhcp.o'. Stop. The problem appears to be in Makefile in plugins-root, changing it to include $(srcdir) in VPATH, e.g. 133c133 < VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t --- > VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir) seems to fix the problem ---------------------------------------------------------------------- >Comment By: Ton Voon (tonvoon) Date: 2007-12-13 22:23 Message: Logged In: YES user_id=664364 Originator: NO Tom, Thanks for the report. This is fixed in SVN now. Ton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1789000&group_id=29880 From noreply at sourceforge.net Thu Dec 13 23:28:00 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 13 Dec 2007 14:28:00 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1776916 ] Configure nagios-plugins inside vserver hangs Message-ID: Bugs item #1776916, was opened at 2007-08-18 17:12 Message generated for change (Comment added) made by tonvoon You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Compilation Group: Release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: norbert (norbertklein) Assigned to: Nobody/Anonymous (nobody) Summary: Configure nagios-plugins inside vserver hangs Initial Comment: nagios-plugins-1.4.9 ./configure Gentoo Tested on x86 AMD64 gcc Configure nagios-plugins hangs inside vserver environment (or any other environment without IP 127.0.0.1) as soon as the configure script tries to check the ICMP syntax. Reproducible: Always Gentoo output: checking for ps... /bin/ps checking for ps syntax... /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args' checking for ping... /bin/ping checking for ping6... /bin/ping6 checking for ICMP ping syntax... ctrl-c /usr/portage/net-analyzer/nagios-plugins/nagios-plugins-1.4.9.ebuild: src_compile aborted; exiting. The reason is that 127.0.0.1 is hardcoded as localhost IP inside the configure script. This is done for checking ICMP syntax and nslookup syntax. But vservers don't have this IP. The following files contain 127.0.0.1 hardcoded: configure.in check_dig.c check_pgsql.c check_smtp.c check_tcp.c check_ups.c I tested these five checks inside a vserver environment and check_dig was the only one which didn't work. As far as I understand the code the reason is that check_dig calls the program dig which fails in case of 127.0.0.1. The others use system calls for their operations. To fix it I modified configure.in and used the hostname in check_dig.c. I attached a patch for the two mentioned files. For Gentoo you find a modified ebuild below which contains the patchs as well. I tested it on two different Gentoo machines and it worked for me. http://www.acodedb.com/download/linux/nagios-plugins.tgz ---------------------------------------------------------------------- >Comment By: Ton Voon (tonvoon) Date: 2007-12-13 22:28 Message: Logged In: YES user_id=664364 Originator: NO Norbert, Thanks for the report. Would using "localhost" be okay in configure.in? What impact would this have in IPv4 or IPv6 environments? Ton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880 From combr at reg.ru Fri Dec 14 15:21:12 2007 From: combr at reg.ru (Mike Lykov) Date: Fri, 14 Dec 2007 18:21:12 +0400 Subject: [Nagiosplug-devel] check_http responce code control Message-ID: <200712141821.12988.combr@reg.ru> Hi all. I use $ ./check_http -V check_http (nagios-plugins 1.4.8) 1.101 And almost all work fine, but I have a question or feature request about control over http responce codes. When code = 200, 301, 302 plugin give OK Code = 401, 404 etc give WARNING code = 500 etc give CRITICAL and all it built-in in the plugin? I have a site with basic authentication which reply 401 code HTTP WARNING: HTTP/1.1 401 Authorization Required but if site responded like this for my request i think it's live and i want to return OK status from the plugin. I don't want to create special user for nagios in that system/site by security considerations (plaintext passwords in configs, and if someone know it he can enter and manage someting on the site). Can I use some option in 1.4.8 to make 401=OK state? Or, maybe, in later version? Mike From dermoth at aei.ca Fri Dec 14 15:55:11 2007 From: dermoth at aei.ca (Thomas Guyot-Sionnest) Date: Fri, 14 Dec 2007 09:55:11 -0500 Subject: [Nagiosplug-devel] check_http responce code control In-Reply-To: <200712141821.12988.combr@reg.ru> References: <200712141821.12988.combr@reg.ru> Message-ID: <4762994F.6000904@aei.ca> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 14/12/07 09:21 AM, Mike Lykov wrote: > Hi all. > > I use > $ ./check_http -V > check_http (nagios-plugins 1.4.8) 1.101 > > And almost all work fine, but I have a question or feature request about > control over http responce codes. > > When code = 200, 301, 302 plugin give OK > Code = 401, 404 etc give WARNING > code = 500 etc give CRITICAL > > and all it built-in in the plugin? > > I have a site with basic authentication which reply 401 code > HTTP WARNING: HTTP/1.1 401 Authorization Required > > but if site responded like this for my request i think it's live and i want to > return OK status from the plugin. > > I don't want to create special user for nagios in that system/site by security > considerations (plaintext passwords in configs, and if someone know it he can > enter and manage someting on the site). > > Can I use some option in 1.4.8 to make 401=OK state? > Or, maybe, in later version? Hi, I believe there's no such feature in check_http (you can double check by running "check_http --help" and looking at the options). However I'm planing to rework some parts of the plugin as there's some issues right now (for example a 302 ok status will not check the response time). Please submit your feature to the "feature request" tracker of the Nagios-plugins SF page located at: http://sourceforge.net/projects/nagiosplug/ I will assign it to myself and make sure it's being looked at when I rework the plugin. I can't guarantee you any date as I work on Nagios-plugins during my free time, but if you're lucky it could be for the next release... Thanks, Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHYplP6dZ+Kt5BchYRAiotAJ0a9Sq1CXQAgd3JLgN7SN0BQ+RcSQCgsP32 ef2DQsA6xkDhJhgC5Gi9Gvs= =lN3k -----END PGP SIGNATURE----- From cmies at itnovum.de Fri Dec 14 15:58:03 2007 From: cmies at itnovum.de (Mies, Christian) Date: Fri, 14 Dec 2007 15:58:03 +0100 Subject: [Nagiosplug-devel] Check_nwstat still not fixed Message-ID: Hi Guys, the check_nwstat source code of Plugin Version 1.4.11 is still buggy. In Pluginversion 1.4.10 this was the Patch, I've posted here +++ ./nagios-plugins-1.4.10/plugins/check_nwstat.c 2007-12-04 15:08:09.000000000 +0100 @@ -1676,7 +1676,7 @@ printf (" %s\n", _(" (available from http://www.engr.wisc.edu/~drews/mrtg/)")); printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds")); printf (" %s\n", _(" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, ")); - printf (" %S\n", _(" TCB, LRUS and LRUM.\n")); + printf (" %s\n", _(" TCB, LRUS and LRUM.\n")); printf (_(UT_SUPPORT)); } The Upper Case 'S' must be a lowercase. regards Christian it-novum GmbH Ein Unternehmen der Mehler AG Christian Mies Consultant Systemmanagement Edelzeller Stra?e 44 36043 Fulda FON: +49 (661) 103-874 (-333) FAX: +49 (661) 103-17874 (-334) MAIL: cmies at itnovum.de WEB: http://www.itnovum.de Handelsregister: Amtsgericht Fulda, HRB 1934 Geschaftsfuhrer: Michael Kienle Sitz der Gesellschaft: Fulda, Deutschland/Germany UstID-Nr: DE813211784 Steuernr.: 018/225/03095 Der Inhalt dieser E-Mail ist vertraulich. Wenn Sie nicht der eigentliche Empfanger sein sollten, informieren Sie bitte sofort den Absender oder vernichten umgehend diese Mail. Jegliche unerlaubte Vervielfaltigung oder Weiterleitung dieser Mail ist strengstens verboten. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ton.voon at altinity.com Fri Dec 14 16:58:11 2007 From: ton.voon at altinity.com (Ton Voon) Date: Fri, 14 Dec 2007 15:58:11 +0000 Subject: [Nagiosplug-devel] Check_nwstat still not fixed In-Reply-To: References: Message-ID: <170D56E4-B406-498F-BBFB-6B3A42DFDAD9@altinity.com> On 14 Dec 2007, at 14:58, Mies, Christian wrote: > +++ ./nagios-plugins-1.4.10/plugins/check_nwstat.c 2007-12-04 > 15:08:09.000000000 +0100 > @@ -1676,7 +1676,7 @@ > printf (" %s\n", _(" (available from http://www.engr.wisc.edu/~drews/mrtg/) > ")); > printf (" %s\n", _("- Values for critical thresholds should be > lower than warning thresholds")); > printf (" %s\n", _(" when the following variables are checked: > VPF, VKF, LTCH, CBUFF, DCB, ")); > - printf (" %S\n", _(" TCB, LRUS and LRUM.\n")); > + printf (" %s\n", _(" TCB, LRUS and LRUM.\n")); > > printf (_(UT_SUPPORT)); > } > The Upper Case 'S' must be a lowercase. > Long story. I forgot to apply this before the release. Now done in svn. Will have to wait for next release :( Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From alessandro.ren at opservices.com.br Fri Dec 14 19:56:12 2007 From: alessandro.ren at opservices.com.br (Alessandro Ren) Date: Fri, 14 Dec 2007 16:56:12 -0200 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. Message-ID: <4762D1CC.2000608@opservices.com.br> Ton, attached is the patch for check_nt for INSTANCES support. Thanks. Alessandro Ren -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: check_nt_INSTANCES_patch.txt URL: From ravenmaster at users.sourceforge.net Fri Dec 14 21:26:30 2007 From: ravenmaster at users.sourceforge.net (ravenmaster at users.sourceforge.net) Date: Fri, 14 Dec 2007 14:26:30 -0600 Subject: [Nagiosplug-devel] check_http responce code control In-Reply-To: <200712141821.12988.combr@reg.ru> References: <200712141821.12988.combr@reg.ru> Message-ID: <20071214202630.GA2339@thinkunix.net> Mike Lykov wrote: > I have a site with basic authentication which reply 401 code > HTTP WARNING: HTTP/1.1 401 Authorization Required > > but if site responded like this for my request i think it's live and i > want to return OK status from the plugin. Hi Mike, I struggled with this for a while but ended using the following and it works well. Note the message returned in the 401 might vary based on the webserver software. I've included a couple of examples for Apache2 and Sun ONE 6.1. I believe I used curl to determine the exact string returned by the 401. In commands.cfg: # check Apache https website that requires a login # returns message: "HTTP WARNING: HTTP/1.1 401 Authorization Required" define command { command_name check_apache_ssl_auth command_line $USER1$/check_http -L -w 5 -c 10 -S -e "Authorization Required" -H $ARG1$ -f follow } # check Sun ONE webserver https website that requires a login # returns message: "HTTP WARNING: HTTP/1.1 401 Unauthorized" define command { command_name check_sunone_ssl_auth command_line $USER1$/check_http -L -w 5 -c 10 -S -e "Unauthorized" -H $ARG1$ -f follow } Then in services.cfg: define service { use generic-service host_name host.domain.com service_description HTTPS:securesite.domain.com check_command check_apache_ssl_auth!securesite.domain.com ... } I'm running a later version but I think the "-e" option was included in previous versions: $ check_http -V check_http v1759 (nagios-plugins 1.4.10) This should be a FAQ. -- scot From noreply at sourceforge.net Fri Dec 14 21:37:37 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Fri, 14 Dec 2007 12:37:37 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1851035 ] check_mysql_query -- Check value of specified column Message-ID: Patches item #1851035, was opened at 2007-12-14 12:37 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Greg Wittel (glwittel) Assigned to: Nobody/Anonymous (nobody) Summary: check_mysql_query -- Check value of specified column Initial Comment: Currently check_mysql_query only reads the value from the first column of the first row. This patch lets you specify the column number to read the result from instead. This is useful since some queries (like the 'show') queries do not give you control over the columns returned. If the column argument is not given, the current behavior of reading the first column is used. This patch numbers columns starting from '0', but that is easy enough to change. ---- Patch against Plugin Version (-V output): check_mysql_query N/A (nagios-plugins 1.4.11) Plugin Name: check_mysql_query Example Plugin Commandline: ./check_mysql_query -H test -q 'show slave status' --column 32 Tested on operating system: Linux robotron 2.6.10-1.770 Tested on architecture: i686 Tested with compiler: gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) Diff generated vs. SVN revision: 1590 off trunk. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 From noreply at sourceforge.net Fri Dec 14 21:39:05 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Fri, 14 Dec 2007 12:39:05 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1851035 ] check_mysql_query -- Check value of specified column Message-ID: Patches item #1851035, was opened at 2007-12-14 12:37 Message generated for change (Comment added) made by glwittel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Greg Wittel (glwittel) Assigned to: Nobody/Anonymous (nobody) Summary: check_mysql_query -- Check value of specified column Initial Comment: Currently check_mysql_query only reads the value from the first column of the first row. This patch lets you specify the column number to read the result from instead. This is useful since some queries (like the 'show') queries do not give you control over the columns returned. If the column argument is not given, the current behavior of reading the first column is used. This patch numbers columns starting from '0', but that is easy enough to change. ---- Patch against Plugin Version (-V output): check_mysql_query N/A (nagios-plugins 1.4.11) Plugin Name: check_mysql_query Example Plugin Commandline: ./check_mysql_query -H test -q 'show slave status' --column 32 Tested on operating system: Linux robotron 2.6.10-1.770 Tested on architecture: i686 Tested with compiler: gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) Diff generated vs. SVN revision: 1590 off trunk. ---------------------------------------------------------------------- >Comment By: Greg Wittel (glwittel) Date: 2007-12-14 12:39 Message: Logged In: YES user_id=1297361 Originator: YES Forgot to attach the diff ;o) Generated via: diff -Naur File Added: check_mysql_query.c.diff ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 From thomas at zango.com Fri Dec 14 23:58:26 2007 From: thomas at zango.com (Thomas Guyot-Sionnest) Date: Fri, 14 Dec 2007 17:58:26 -0500 Subject: [Nagiosplug-devel] check_http responce code control In-Reply-To: <20071214202630.GA2339@thinkunix.net> References: <200712141821.12988.combr@reg.ru> <20071214202630.GA2339@thinkunix.net> Message-ID: <47630A92.90808@zango.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ravenmaster at users.sourceforge.net wrote: > Mike Lykov wrote: >> I have a site with basic authentication which reply 401 code >> HTTP WARNING: HTTP/1.1 401 Authorization Required >> >> but if site responded like this for my request i think it's live and i >> want to return OK status from the plugin. > > > Hi Mike, > > I struggled with this for a while but ended using the following and it > works well. Note the message returned in the 401 might vary based on > the webserver software. I've included a couple of examples for Apache2 > and Sun ONE 6.1. I believe I used curl to determine the exact string > returned by the 401. Actually there's another way too (I was probably still sleeping while writing the email this morning...). You can use check_tcp with send and expect strings to test it. Just use telnet and send something like this (two CRs after the "Host:" line; change the hostname to the one associated to your server.): - -- GET / HTTP/1.1 Host: www.example.com - -- Look at the reply, then use this send string in check_tcp: "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n" And the expect string should match whatever you got in reply in telnet (I guess something like "HTTP/1.1 401 Authorization Required"). - -- Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHYwqR6dZ+Kt5BchYRAoBOAKCmywp8jNStwSigevr3qbuaoZMJQwCgtWWF FF1RIDcpJgmf83fzWHHidMc= =zz0r -----END PGP SIGNATURE----- From patrick.postfix at cervicek.de Sat Dec 15 23:51:07 2007 From: patrick.postfix at cervicek.de (Patrick Cervicek) Date: Sat, 15 Dec 2007 23:51:07 +0100 Subject: [Nagiosplug-devel] patch for check_dhcp "Rogue DHCP server detection" Message-ID: I wrote a litte patch to detect rogue dhcp servers It looks like this: [root at pc4 plugins-root]# ./check_dhcp -s 192.168.1.1 -x CRITICAL: Rogue DHCP Server detected! Server 192.168.1.205 offered 192.168.1.239 Patrick -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: check_dhcp_roguedhcpserverpatch.txt URL: From noreply at sourceforge.net Sun Dec 16 10:34:33 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Sun, 16 Dec 2007 01:34:33 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1776916 ] Configure nagios-plugins inside vserver hangs Message-ID: Bugs item #1776916, was opened at 2007-08-18 18:12 Message generated for change (Comment added) made by norbertklein You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Compilation Group: Release (specify) Status: Open Resolution: None Priority: 5 Private: No Submitted By: norbert (norbertklein) Assigned to: Nobody/Anonymous (nobody) Summary: Configure nagios-plugins inside vserver hangs Initial Comment: nagios-plugins-1.4.9 ./configure Gentoo Tested on x86 AMD64 gcc Configure nagios-plugins hangs inside vserver environment (or any other environment without IP 127.0.0.1) as soon as the configure script tries to check the ICMP syntax. Reproducible: Always Gentoo output: checking for ps... /bin/ps checking for ps syntax... /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args' checking for ping... /bin/ping checking for ping6... /bin/ping6 checking for ICMP ping syntax... ctrl-c /usr/portage/net-analyzer/nagios-plugins/nagios-plugins-1.4.9.ebuild: src_compile aborted; exiting. The reason is that 127.0.0.1 is hardcoded as localhost IP inside the configure script. This is done for checking ICMP syntax and nslookup syntax. But vservers don't have this IP. The following files contain 127.0.0.1 hardcoded: configure.in check_dig.c check_pgsql.c check_smtp.c check_tcp.c check_ups.c I tested these five checks inside a vserver environment and check_dig was the only one which didn't work. As far as I understand the code the reason is that check_dig calls the program dig which fails in case of 127.0.0.1. The others use system calls for their operations. To fix it I modified configure.in and used the hostname in check_dig.c. I attached a patch for the two mentioned files. For Gentoo you find a modified ebuild below which contains the patchs as well. I tested it on two different Gentoo machines and it worked for me. http://www.acodedb.com/download/linux/nagios-plugins.tgz ---------------------------------------------------------------------- >Comment By: norbert (norbertklein) Date: 2007-12-16 10:34 Message: Logged In: YES user_id=1870307 Originator: YES Hi Ton unfortunately you can never be sure that "localhost" or "127.0.0.1" is reachable in a vserver. The point is that in the downloadable vserver templates I have seen so far, the file /etc/hosts always contains the typical record "127.0.0.1 localhost". This is obvious because the actual IP you will use for the vserver is unknown. If you use localhost in configure.in you assume that the maintainer of the vserver has set localhost in /etc/hosts to a valid IP. So maybe the easiest solution is to use localhost as you have suggested along with a warning or break off if it isn't reachable. You could additionally add some lines which check the first IP of the first network interface if localhost is unavailable. For ipv6, replacing ::1 with localhost should be the same, the standard /etc/hosts contains an ipv6 record for localhost and configure.in handles ipv6 with ping6. Norbert ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2007-12-13 23:28 Message: Logged In: YES user_id=664364 Originator: NO Norbert, Thanks for the report. Would using "localhost" be okay in configure.in? What impact would this have in IPv4 or IPv6 environments? Ton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880 From ton.voon at altinity.com Mon Dec 17 10:09:39 2007 From: ton.voon at altinity.com (Ton Voon) Date: Mon, 17 Dec 2007 09:09:39 +0000 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. In-Reply-To: <4762D1CC.2000608@opservices.com.br> References: <4762D1CC.2000608@opservices.com.br> Message-ID: <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> Alessandro, This patch appears to be malformed. Can you attach the patch instead? Ton On 14 Dec 2007, at 18:56, Alessandro Ren wrote: > > Ton, > > attached is the patch for check_nt for INSTANCES support. > > Thanks. > > Alessandro Ren > > --- nagios-plugins-1.4.11/plugins/check_nt.c 2007-01-28 > 19:46:41.000000000 -0200 > +++ nagios-plugins-1.4.11-op/plugins/check_nt.c 2007-12-14 > 16:49:03.000000000 -0200 > @@ -55,7 +55,8 @@ enum checkvars { > CHECK_PROCSTATE, > CHECK_MEMUSE, > CHECK_COUNTER, > - CHECK_FILEAGE > + CHECK_FILEAGE, > + CHECK_INSTANCES > }; > > enum { > @@ -121,7 +122,7 @@ int main(int argc, char **argv){ > setlocale (LC_ALL, ""); > bindtextdomain (PACKAGE, LOCALEDIR); > textdomain (PACKAGE); > - > + > if(process_arguments(argc,argv) == ERROR) > usage4 (_("Could not parse arguments")); > > @@ -396,7 +397,6 @@ int main(int argc, char **argv){ > break; > > case CHECK_FILEAGE: > - > if (value_list==NULL) > output_message = strdup (_("No counter specified")); > else { > @@ -414,7 +414,7 @@ int main(int argc, char **argv){ > return_code=STATE_WARNING; > else > return_code=STATE_OK; > - } > + } > else { /* inverse > thresholds */ > if(check_critical_value==TRUE && age_in_minutes <= critical_value) > return_code=STATE_CRITICAL; > @@ -426,6 +426,21 @@ int main(int argc, char **argv){ > } > break; > > + case CHECK_INSTANCES: > + if (value_list==NULL) > + output_message = strdup (_("No counter specified")); > + else { > + asprintf(&send_buffer,"%s&10&%s", req_password,value_list); > + fetch_data (server_address, server_port, send_buffer); > + if (!strncmp(recv_buffer,"ERROR",5)) { > + printf("NSClient - %s\n",recv_buffer); > + exit(STATE_UNKNOWN); > + } > + asprintf(&output_message,"%s",recv_buffer); > + return_code=STATE_OK; > + } > + break; > + > case CHECK_NONE: > default: > usage4 (_("Please specify a variable to check")); > @@ -483,14 +498,13 @@ int process_arguments(int argc, char **a > strcpy(argv[c],"-c"); > } > > - while (1){ > + while (1) { > c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",longopts,&option); > > if (c==-1||c==EOF||c==1) > break; > > - switch (c) > - { > + switch (c) { > case '?': /* print short usage statement if args not parsable */ > usage5 (); > case 'h': /* help */ > @@ -533,6 +547,8 @@ int process_arguments(int argc, char **a > vars_to_check=CHECK_COUNTER; > else if(!strcmp(optarg,"FILEAGE")) > vars_to_check=CHECK_FILEAGE; > + else if(!strcmp(optarg,"INSTANCES")) > + vars_to_check=CHECK_INSTANCES; > else > return ERROR; > break; > @@ -556,7 +572,6 @@ int process_arguments(int argc, char **a > if(socket_timeout<=0) > return ERROR; > } > - > } > > if (vars_to_check==CHECK_NONE) > @@ -569,7 +584,6 @@ int process_arguments(int argc, char **a > } > > > - > void fetch_data (const char *address, int port, const char *sendb) { > int result; > > @@ -690,6 +704,20 @@ void print_help(void) > printf (" %s\n", _("Some examples:")); > printf (" %s\n", "\"Paging file usage is %%.2f %%%%\""); > printf (" %s\n\n", "\"%%.f %%%% paging file used.\""); > + printf (" %s\n", "INSTANCES ="); > + printf (" %s\n", _("Check any performance counter object NT/ > 2000")); > + printf (" %s\n", _("Syntax: check_nt -H -p -v > INSTANCES -l ")); > + printf (" %s\n", _("counter object> is a Windows Perfmon Counter > object (eg. Process),")); > + printf (" %s\n", _("if it is two words, it should be enclosed in > quotes")); > + printf (" %s\n", _("The returned results will be a comma- > separated list of instances on ")); > + printf (" %s\n", _(" the selected computer for that object.")); > + printf (" %s\n", _("The purpose of this is to be run from > command line to determine what instances")); > + printf (" %s\n", _(" are available for monitoring without having > to log onto the Windows server")); > + printf (" %s\n", _(" to run Perfmon directly.")); > + printf (" %s\n", _("It can also be used in scripts that > automatically create Nagios service")); > + printf (" %s\n", _(" configuration files.")); > + printf (" %s\n", _("Example")); > + printf (" %s\n\n", _("check_nt -H 192.168.1.1 -p 1248 -v > INSTANCES -l Process")); > printf (_("Notes:")); > printf (" %s\n", _("- The NSClient service should be running on > the server to get any information")); > printf (" %s\n", "(http://nsclient.ready2run.nl)."); http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From noreply at sourceforge.net Mon Dec 17 10:39:01 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 17 Dec 2007 01:39:01 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1852188 ] Check_by_ssh exit code always 0 Message-ID: Bugs item #1852188, was opened at 2007-12-17 10:39 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852188&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General plugin execution Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ADW (alain_dewit) Assigned to: Nobody/Anonymous (nobody) Summary: Check_by_ssh exit code always 0 Initial Comment: The "check_by_ssh" plugin report always an exit status/code of 0 when it should return a value of "2". Should be the same for the other exit code values. Plugin compiled from nagios-plugins-1.4.7.tar.gz on a RedHat Fedora Core Intel system. Best regards ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852188&group_id=29880 From noreply at sourceforge.net Mon Dec 17 10:56:56 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 17 Dec 2007 01:56:56 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1852198 ] Check_by_ssh exit code always 0 Message-ID: Bugs item #1852198, was opened at 2007-12-17 10:56 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852198&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General plugin execution Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ADW (alain_dewit) Assigned to: Nobody/Anonymous (nobody) Summary: Check_by_ssh exit code always 0 Initial Comment: The "check_by_ssh" plugin report always an exit status/code of 0 when it should return a value of "2". Should be the same for the other exit code values. Plugin compiled from nagios-plugins-1.4.7.tar.gz on a RedHat Fedora Core Intel system. Best regards ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852198&group_id=29880 From noreply at sourceforge.net Mon Dec 17 11:02:00 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 17 Dec 2007 02:02:00 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1852201 ] Added -o option to sort returned addresses Message-ID: Patches item #1852201, was opened at 2007-12-17 21:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1852201&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Thiago Figueiro (thiagocsf) Assigned to: Nobody/Anonymous (nobody) Summary: Added -o option to sort returned addresses Initial Comment: On round-robin setups, DNS queries will return addresses on a different order on each request. This renders the -a option useless. The attached patch will add option -o to sort the returned addresses, making -a option useful again. For more info, please see http://microrants.blogspot.com/2007/11/checking-your-round-robin-dns-with.html Patch against Plugin Version (-V output): 1.4.10 Plugin Name: check_dns Example Plugin Commandline: check_dns -H google.com.au -o -a 72.14.203.104,72.14.207.104,72.14.235.104 Tested on operating system: Debian Etch, Solaris 10 Tested on architecture: i686, sparc Tested with compiler: gcc 4.2.3, Sun's crazy-ass compiler (can't remember the version) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1852201&group_id=29880 From noreply at sourceforge.net Mon Dec 17 11:02:31 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 17 Dec 2007 02:02:31 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1852201 ] check_dns: added -o option to sort returned addresses Message-ID: Patches item #1852201, was opened at 2007-12-17 21:02 Message generated for change (Settings changed) made by thiagocsf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1852201&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Thiago Figueiro (thiagocsf) Assigned to: Nobody/Anonymous (nobody) >Summary: check_dns: added -o option to sort returned addresses Initial Comment: On round-robin setups, DNS queries will return addresses on a different order on each request. This renders the -a option useless. The attached patch will add option -o to sort the returned addresses, making -a option useful again. For more info, please see http://microrants.blogspot.com/2007/11/checking-your-round-robin-dns-with.html Patch against Plugin Version (-V output): 1.4.10 Plugin Name: check_dns Example Plugin Commandline: check_dns -H google.com.au -o -a 72.14.203.104,72.14.207.104,72.14.235.104 Tested on operating system: Debian Etch, Solaris 10 Tested on architecture: i686, sparc Tested with compiler: gcc 4.2.3, Sun's crazy-ass compiler (can't remember the version) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1852201&group_id=29880 From alessandro.ren at opservices.com.br Mon Dec 17 11:33:37 2007 From: alessandro.ren at opservices.com.br (Alessandro Ren) Date: Mon, 17 Dec 2007 08:33:37 -0200 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. In-Reply-To: <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> References: <4762D1CC.2000608@opservices.com.br> <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> Message-ID: <47665081.80407@opservices.com.br> Ton, I had attached it before, dont know what happened. I am attaching it zipped. I've just retested the patch against 1.4.11, it applied cleanly and compiled. Any problems, just let me know. []s. Ton Voon wrote: > Alessandro, > > This patch appears to be malformed. Can you attach the patch instead? > > Ton > > On 14 Dec 2007, at 18:56, Alessandro Ren wrote: > > > -- __________________________________________________ *Alessandro Ren* /*OpServices*/ /*Luciana de Abreu, 471 - Sala 403*/ /*Porto Alegre, RS - CEP 90570-060*/ *(* phone 55(51)3061-3588 *4* fax 55(51)3061-3588 *Q* mobile 55(48)9987-0625 *:* email alessandro.ren at opservices.com.br __________________________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: check_nt_INSTANCES_patch.txt.gz Type: application/gzip Size: 1755 bytes Desc: not available URL: From noreply at sourceforge.net Mon Dec 17 12:11:21 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Mon, 17 Dec 2007 03:11:21 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1852198 ] Check_by_ssh exit code always 0 Message-ID: Bugs item #1852198, was opened at 2007-12-17 10:56 Message generated for change (Comment added) made by alain_dewit You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852198&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General plugin execution Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ADW (alain_dewit) Assigned to: Nobody/Anonymous (nobody) Summary: Check_by_ssh exit code always 0 Initial Comment: The "check_by_ssh" plugin report always an exit status/code of 0 when it should return a value of "2". Should be the same for the other exit code values. Plugin compiled from nagios-plugins-1.4.7.tar.gz on a RedHat Fedora Core Intel system. Best regards ---------------------------------------------------------------------- >Comment By: ADW (alain_dewit) Date: 2007-12-17 12:11 Message: Logged In: YES user_id=1961631 Originator: YES I forgot to say that the problem only occur when using the "-f" (fork) option. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1852198&group_id=29880 From ton.voon at altinity.com Mon Dec 17 12:49:58 2007 From: ton.voon at altinity.com (Ton Voon) Date: Mon, 17 Dec 2007 11:49:58 +0000 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. In-Reply-To: <47665081.80407@opservices.com.br> References: <4762D1CC.2000608@opservices.com.br> <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> <47665081.80407@opservices.com.br> Message-ID: On 17 Dec 2007, at 10:33, Alessandro Ren wrote: > Ton, I had attached it before, dont know what happened. > I am attaching it zipped. I've just retested the patch against > 1.4.11, it applied cleanly and compiled. > Any problems, just let me know. This is applied now in SVN. Unfortunately, there are no tests for this, so is a bit hard to ensure this functionality works. It would be great if there was a small C (or preferably perl) library that acted as a stub so that we can prove that commands are being sent properly by check_nt to the daemon at the other end. However, this is a nice-to- have. How is it going with the RFC for the NT daemon? Ton http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From alessandro.ren at opservices.com.br Mon Dec 17 13:33:10 2007 From: alessandro.ren at opservices.com.br (Alessandro Ren) Date: Mon, 17 Dec 2007 10:33:10 -0200 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. In-Reply-To: References: <4762D1CC.2000608@opservices.com.br> <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> <47665081.80407@opservices.com.br> Message-ID: <47666C86.2050404@opservices.com.br> It would be usefull to have this test for sure, but the patch was tested against nsclient and opmonagent. I have not taken the time yet to think about it, but Anthony's proposition seems very good. With this patch, we get the last feature that was added to nsclient a long time ago and can start thinking about the NT deamon RFC and how to properly add new features to it. []s. Ton Voon wrote: > On 17 Dec 2007, at 10:33, Alessandro Ren wrote: > > >> Ton, I had attached it before, dont know what happened. >> I am attaching it zipped. I've just retested the patch against >> 1.4.11, it applied cleanly and compiled. >> Any problems, just let me know. >> > > > This is applied now in SVN. Unfortunately, there are no tests for > this, so is a bit hard to ensure this functionality works. It would be > great if there was a small C (or preferably perl) library that acted > as a stub so that we can prove that commands are being sent properly > by check_nt to the daemon at the other end. However, this is a nice-to- > have. > > How is it going with the RFC for the NT daemon? > > Ton > > http://www.altinity.com > UK: +44 (0)870 787 9243 > US: +1 866 879 9184 > Fax: +44 (0)845 280 1725 > Skype: tonvoon > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________________ > Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net > Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > ::: Please include plugins version (-v) and OS when reporting any issue. > ::: Messages without supporting info will risk being sent to /dev/null > -- __________________________________________________ *Alessandro Ren* /*OpServices*/ /*Luciana de Abreu, 471 - Sala 403*/ /*Porto Alegre, RS - CEP 90570-060*/ *(* phone 55(51)3061-3588 *4* fax 55(51)3061-3588 *Q* mobile 55(48)9987-0625 *:* email alessandro.ren at opservices.com.br __________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From amontibello at gmail.com Tue Dec 18 01:31:28 2007 From: amontibello at gmail.com (Anthony Montibello) Date: Mon, 17 Dec 2007 19:31:28 -0500 Subject: [Nagiosplug-devel] Check_nt INSTANCES patch with help. In-Reply-To: <47666C86.2050404@opservices.com.br> References: <4762D1CC.2000608@opservices.com.br> <616F5451-13A1-4636-93B3-40A0EB9B3AE4@altinity.com> <47665081.80407@opservices.com.br> <47666C86.2050404@opservices.com.br> Message-ID: I have had a hard time finding the time to work on that, Hopefully my schedual will be opening up as the holidays pass. Just out of curiosity; In NC_Nets flavor of check_nt I included a COMMAND specifice Help and an OTHER command that I think the Main BRanch of CHECK_NT would benifit from. A third addition I added was a Command line switch that overcomes the output buffer limit of Check_nt. Can you Take a look at it (Alessandro/Ton) and see if you would agree if these would benifit ALL Client sides. The Check_OTHER basically passes the -l directly to the Windows client as it is. and then outputs the results AS is. this commamd allows for check_nt to issue any command to a WIndows Host and then a wrapper script could handle the parsing of -c or -w since that. link to check_nc_net (My Test host is still down so I cannot build a Diff off the Check_nt Head of the non NC_NEt specific enhancements I addedinto this) http://downloads.sourceforge.net/nc-net/check_nc_net_040107.zip?modtime=1175541733&big_mirror=0&filesize=17953 Thank you, TOny (Author of NC_NEt) On Dec 17, 2007 7:33 AM, Alessandro Ren wrote: > > It would be usefull to have this test for sure, but the patch was > tested against nsclient and opmonagent. > I have not taken the time yet to think about it, but Anthony's > proposition seems very good. With this patch, we get the last feature that > was added to nsclient a long time ago and can start thinking about the NT > deamon RFC and how to properly add new features to it. > > []s. > > > Ton Voon wrote: > > On 17 Dec 2007, at 10:33, Alessandro Ren wrote: > > > > Ton, I had attached it before, dont know what happened. > I am attaching it zipped. I've just retested the patch against 1.4.11, it applied cleanly and compiled. > Any problems, just let me know. > > > This is applied now in SVN. Unfortunately, there are no tests for > this, so is a bit hard to ensure this functionality works. It would be > great if there was a small C (or preferably perl) library that acted > as a stub so that we can prove that commands are being sent properly > by check_nt to the daemon at the other end. However, this is a nice-to- > have. > > How is it going with the RFC for the NT daemon? > > Ton > http://www.altinity.com > UK: +44 (0)870 787 9243 > US: +1 866 879 9184 > Fax: +44 (0)845 280 1725 > Skype: tonvoon > > > -------------------------------------------------------------------------SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source.http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________________ > Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net > Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > ::: Please include plugins version (-v) and OS when reporting any issue. > ::: Messages without supporting info will risk being sent to /dev/null > > > > -- > __________________________________________________ > *Alessandro Ren* > *OpServices* > *Luciana de Abreu, 471 - Sala 403* > *Porto Alegre, RS - CEP 90570-060* > *(* phone 55(51)3061-3588 > *4* fax 55(51)3061-3588 > *Q* mobile 55(48)9987-0625 > *:* email alessandro.ren at opservices.com.br<%22alessandro.ren at opservices.com.br%22> > __________________________________________________ > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________________ > Nagios Plugin Development Mailing List > Nagiosplug-devel at lists.sourceforge.net > Unsubscribe at > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > ::: Please include plugins version (-v) and OS when reporting any issue. > ::: Messages without supporting info will risk being sent to /dev/null > -------------- next part -------------- An HTML attachment was scrubbed... URL: From combr at reg.ru Tue Dec 18 16:09:16 2007 From: combr at reg.ru (Mike Lykov) Date: Tue, 18 Dec 2007 19:09:16 +0400 Subject: [Nagiosplug-devel] check_mailq don't have permissions Message-ID: <200712181909.16218.combr@reg.ru> Hi all. I try to use check_mailq for sendmail via nrpe. i install check_mailq (nagios-plugins 1.4.8) 1.7 on remote server, configure command in nrpe as here command[check_mailq]=/usr/lib/nagios/plugins/check_mailq -w 100 -c -200 (all other nrpe command work well) and try to use it from nagios server. $ ./check_nrpe -H (remote server ip) -c check_mailq CRITICAL: Error code 78 returned from /usr/bin/mailq I think this is mean "no privilegies" (I run nrpe via xinetd under "nrpe" user) when i configure sudo and command[check_mailq]=/usr/bin/sudo /usr/lib/nagios/plugins/check_mailq -w 100 -c -200 i get $ ./check_nrpe -H (remote server ip) -c check_mailq NRPE: Unable to read output on remote host from "nrpe" user print: $ /usr/lib/nagios/plugins/check_mailq -v -w 100 -c 200 /usr/bin/mailq = can not chdir(/var/spool/mqueue/): Permission denied Program mode requires special privileges, e.g., root or TrustedUser. CRITICAL: Error code 78 returned from /usr/bin/mailq $ id uid=497(nrpe) gid=497(nrpe) I put nrpe in sendmail trusted-users file, but no effect. or $ sudo /usr/lib/nagios/plugins/check_mailq -w 100 -c 200 OK: mailq (68) is below threshold (100/200)|unsent=68;100;200;0 but last variant can't work, when it run by nrpe, not a shell. I can't find any answers in documentation, only standard options description, but i find that other users encounter same problems. Are there "the right way" and "the best practice" to run check_mailq via nrpe? How other people use it? Maybe add some documentation about it? Mike From combr at reg.ru Wed Dec 19 10:36:37 2007 From: combr at reg.ru (Mike Lykov) Date: Wed, 19 Dec 2007 13:36:37 +0400 Subject: [Nagiosplug-devel] check_mailq don't have permissions Message-ID: <200712191336.37270.combr@reg.ru> Hi all. I try to use check_mailq for sendmail via nrpe. i install check_mailq (nagios-plugins 1.4.8) 1.7 on remote server, configure command in nrpe as here command[check_mailq]=/usr/lib/nagios/plugins/check_mailq -w 100 -c -200 (all other nrpe command work well) and try to use it from nagios server. $ ./check_nrpe -H (remote server ip) -c check_mailq CRITICAL: Error code 78 returned from /usr/bin/mailq I think this is mean "no privilegies" (I run nrpe via xinetd under "nrpe" user) when i configure sudo and command[check_mailq]=/usr/bin/sudo /usr/lib/nagios/plugins/check_mailq -w 100 -c -200 i get $ ./check_nrpe -H (remote server ip) -c check_mailq NRPE: Unable to read output on remote host from "nrpe" user print: $ /usr/lib/nagios/plugins/check_mailq -v -w 100 -c 200 /usr/bin/mailq = can not chdir(/var/spool/mqueue/): Permission denied Program mode requires special privileges, e.g., root or TrustedUser. CRITICAL: Error code 78 returned from /usr/bin/mailq $ id uid=497(nrpe) gid=497(nrpe) I put nrpe in sendmail trusted-users file, but no effect. or $ sudo /usr/lib/nagios/plugins/check_mailq -w 100 -c 200 OK: mailq (68) is below threshold (100/200)|unsent=68;100;200;0 but last variant can't work, when it run by nrpe, not a shell. (from nagios server i get "unable to read output") I try to set less restrictive permissions to /var/spool/mqueue, and again no effect. I can't find any answers in documentation, only standard options description, but i find that other users encounter same problems. Are there "the right way" and "the best practice" to run check_mailq via nrpe? How other people use it? Maybe add some documentation about it? Mike From noreply at sourceforge.net Wed Dec 19 22:03:04 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Wed, 19 Dec 2007 13:03:04 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1854415 ] check_dhcp: patch for "Rogue DHCP server detection" Message-ID: Patches item #1854415, was opened at 2007-12-19 21:03 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1854415&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Patrick Cervicek (pcervicek) Assigned to: Nobody/Anonymous (nobody) Summary: check_dhcp: patch for "Rogue DHCP server detection" Initial Comment: This patch helps check_dhcp to detect rogue dhcp servers. Use it with the "-x" flag example output: [root pc4 plugins-root]# ./check_dhcp -s 192.168.1.1 -x CRITICAL: Rogue DHCP Server detected! Server 192.168.1.205 offered 192.168.1.239 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1854415&group_id=29880 From noreply at sourceforge.net Thu Dec 20 00:48:21 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Wed, 19 Dec 2007 15:48:21 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1348746 ] check_disk reports incorrect disk free with neg space on BSD Message-ID: Bugs item #1348746, was opened at 2005-11-05 01:59 Message generated for change (Comment added) made by altpeter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parsing problem Group: Release (specify) Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Ted Cabeen (secabeen) Assigned to: Nobody/Anonymous (nobody) Summary: check_disk reports incorrect disk free with neg space on BSD Initial Comment: With check_disk running on FreeBSD 5-STABLE, when a disk has negative free space remaining, the amount of free space goes hugely positive: DISK CRITICAL - free space: /usr 36028797018963968 MB (1191472380510208%): Here's a df from the time: /dev/ad4s1g 3096462 2989082 -140336 105% /usr ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-12-20 00:48 Message: Logged In: YES user_id=145970 Originator: NO Sorry for not having time to look into this yet, but too much work at the office... :) I just checked out nagios-plugins in version 1.4.11 and tested again, and so far, it seems to count correctly now. ---------------------------------------------------------------------- Comment By: Thomas Guyot (dermoth) Date: 2007-12-08 17:53 Message: Logged In: YES user_id=375623 Originator: NO This is fixed in SVN. The root cause of the problem is in Gnulib which is why it was so hard to track this problem; I implemented a simple workaround in check_disk. The credits should go to Matthias as he was kind enough to upload me a FreeBSD VM to test on. You can try on the latest SVN HEAD (which will likely be released next week) or use the next daily snapshot. To get the HEAD: $ svn co http://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk/ nagiosplug Snapshots are there (Make sure it's at least Dec. 9 2007): http://nagiosplug.sourceforge.net/snapshot/ ---------------------------------------------------------------------- Comment By: Matthias Eble (psychotrahe) Date: 2007-12-03 10:41 Message: Logged In: YES user_id=1694341 Originator: NO Hello Altpeter, I'm pretty sure, the threshold/argument problem doesn't exist in the latest versions including 1.4.10. The debug output of your command line is commented out in the current code. negative freespace: I currently can't imagine where the negative values come from but IMO they shouldn't be there. However, I'll try to find some time to test. Matthias ---------------------------------------------------------------------- Comment By: Thomas Guyot (dermoth) Date: 2007-12-01 02:44 Message: Logged In: YES user_id=375623 Originator: NO Sorry about that. A few of us looked into it a while back and couldn't find the issue. I can take a second look, but it would help if you first patch check_disk with the attached check_disk.extra-debug.patch and send me the full output after running the plugin with -vvv (Please limit it to one path if possible). Since I don't have a BSD system to test with the attached patch will give me what I need to simulate your system and hopefully reproduce the bug. File Added: check_disk.extra-debug.patch ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 22:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-30 22:05 Message: Logged In: YES user_id=145970 Originator: NO Are there any efforts on this topic yet? Can i help somehow in finding out the reason for this? Me, personally, thinks that this should go on a somewhat high priority because this bug makes check_disk more or less untrustable ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-21 10:35 Message: Logged In: YES user_id=145970 Originator: NO Hmmm, just detected one more problem with check_disk processing on FreeBSD: root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union /var DISK WARNING - free space: /var 498 MB (5% inode=97%);| /var=9419MB;8924;9420;97;9916 root at canismajor:~ # /usr/local/libexec/nagios/check_disk -w 10% -c 5% -X devfs -X procfs -X linprocfs -X tmpfs -X union -vvv DISK OK - free space: / 264 MB (53% inode=92%); /tmp 177 MB (36% inode=90%); /usr 6458 MB (65% inode=83%); /var 496 MB (5% inode=97%); /var/spool 31789 MB (69% inode=95%); /var/spool/mail 72962 MB (54% inode=87%); 264 of 496 MB (53% inode=92%) free on /dev/amrd0s1a (type ufs mounted on /) warn:0 crit:0 warn%:10% crit%:5% 177 of 496 MB (36% inode=90%) free on /dev/amrd0s1d (type ufs mounted on /tmp) warn:0 crit:0 warn%:0% crit%:0% 6458 of 9916 MB (65% inode=83%) free on /dev/amrd0s1f (type ufs mounted on /usr) warn:0 crit:0 warn%:0% crit%:0% 496 of 9916 MB (5% inode=97%) free on /dev/amrd0s1e (type ufs mounted on /var) warn:0 crit:0 warn%:0% crit%:0% 31789 of 46096 MB (69% inode=95%) free on /dev/amrd0s1g (type ufs mounted on /var/spool) warn:0 crit:0 warn%:0% crit%:0% 72962 of 135854 MB (54% inode=87%) free on /dev/amrd1s1d (type ufs mounted on /var/spool/mail) warn:0 crit:0 warn%:0% crit%:0%| /=231MB;445;470;92;495 /tmp=318MB;495;495;90;495 /usr=3459MB;9916;9916;83;9916 /var=9420MB;9916;9916;97;9916 /var/spool=14307MB;46096;46096;94;46096 /var/spool/mail=62891MB;135853;135853;87;135853 e.g. when checking a mount point directly, the insufficient space gives a warning, but when checked as a summary, the state is OK because it looks like that the warning and critical criteria are only used for the first found mount point ... ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 23:42 Message: Logged In: YES user_id=145970 Originator: NO A little more input, because just hinted from #nagios: # df -h /tmp Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # check_disk -vvv /tmp | head -1 For /tmp, used_pct=101 free_pct=-1 used_units=460 free_units=1.75922e+13 total_units=495 used_inodes_pct=1 free_inodes_pct=99 fsp.fsu_blocksize=2048 mult=1048576 ---------------------------------------------------------------------- Comment By: Holger Weiss (hweiss) Date: 2007-11-20 23:22 Message: Logged In: YES user_id=759506 Originator: NO Thanks, we'll have to look into it. ---------------------------------------------------------------------- Comment By: Frank Altpeter (altpeter) Date: 2007-11-20 23:14 Message: Logged In: YES user_id=145970 Originator: NO I would like this bug to have reopened. It still exists in nagios-plugins version 1.4.10 at least at FreeBSD 6.2-RELEASE-p5, as the following test shows: Filesystem Size Used Avail Capacity Mounted on /dev/amrd0s1e 496M 461M -4.5M 101% /tmp # /usr/local/libexec/nagios/check_disk /tmp DISK OK - free space: /tmp 17592186044411 MB (-1% inode=99%);| /tmp=460MB;;;0;495 Would be great to have a fix soon - this is quite bad since i cannot trust check_disk anymore with that... ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2006-11-03 04:20 Message: Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-10-19 21:49 Message: Logged In: YES user_id=664364 Doesn't look like any updates since I last requested in July. Marking call into pending. Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2006-07-20 01:18 Message: Logged In: YES user_id=664364 Ted, Can you try the latest snapshot at http://nagiosplug.sf.net/snapshot. There have been major changes to check_disk to sync it with coreutils' df so there shouldn't be sign problems. If you still have problems, can you tell me what version of df are you using? Ton ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2005-11-08 13:05 Message: Logged In: YES user_id=664364 >From 1.4 onwards, we use the GNU coreutils library to get df data. I don't know if FreeBSD use their own routines or not, but GNU coreutils should support it. Yes, I guess signed integers should fix. Was an assumption on our part that values would be always positive. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-08 12:28 Message: Logged In: YES user_id=226838 hi, well chalk this up to my having been away from traditional unix/bsd implementations. afaict in linux such reserved space is still taken into calculation of total available space (ie, you could get ENOSPC before the disk reached 0%). but anyway, i think the fix is still obvious, that we should do all scans and assignments as signed integers instead of unsigned. if i don't hear any complaints from anyone else on the plugins team, i'll probably do this at some point (and hope that it doesn't break something else) also, having taken a look at the check_disk code, i can't seem to find any references to the df program... so i guess if you're using 1.4.2 or later that it's purely within the internal disk space routines. ---------------------------------------------------------------------- Comment By: Ted Cabeen (secabeen) Date: 2005-11-07 22:25 Message: Logged In: YES user_id=40466 All modern unix file-systems reserve a portion (5-10%) of the disk space for use by root only and to speed disk accesses. If the root user exceeds the normal disk space and uses some of the reserve space, the system will represent the amount of free space as negative. I don't know how check_disk is checking the disk space (df or internal routines). Is there an easy way to check? check_disk (nagios-plugins 1.4.2) 1.57 is the version I'm running. ---------------------------------------------------------------------- Comment By: M. Sean Finney (seanius) Date: 2005-11-07 13:56 Message: Logged In: YES user_id=226838 hi, um, i just have to ask. how do you have negative free space? some other information that would be helpful: - is check_disk using the df command or internal disk space routines? - if df, what df command syntax is check_disk using? - what version of the plugins are you using? i believe that the plugin is making an assumption that the amount of disk space available is unsigned, because, er... well i'd never heard of negative disk space, anyway :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1348746&group_id=29880 From ton.voon at altinity.com Thu Dec 20 17:24:26 2007 From: ton.voon at altinity.com (Ton Voon) Date: Thu, 20 Dec 2007 16:24:26 +0000 Subject: [Nagiosplug-devel] Fwd: Patch proposal for check_icmp References: <20071220092955.dz985aajjpusssow@mail.lin.at> Message-ID: Hi! I got this email from Harald re: check_icmp specifying a source address. I don't know too much about check_icmp, so can anyone else look over this? Begin forwarded message: > From: Harald Jenny > Date: 20 December 2007 08:29:55 GMT > To: tonvoon at users.sourceforge.net > Subject: Patch proposal for check_icmp > > Dear Tom Voon, > > I got the advise to contact you from Ingo Lantschner in order to > get a little patch into the official nagios-plugins. What the patch > does is to give the option of binding check_icmp to a specific ip > address. Main purpose for me is to be able to to icmp-tests trough a > vpn-tunnel but I'm fairly sure that there are other uses to (for > example when pinging from interfaces with multiple ip addresses). > The patch in this form cleanly applies to nagios-plugins-1.4.11 from > the nagios-website and also compiles (at least under debian etch) > without problems. As I just allow specifing an ip but not an > interface no changes in dropping of root-privileges where necessary. > Please reply and tell me wether inclusion is possible. > > Regards > Harald Jenny -------------- next part -------------- A non-text attachment was scrubbed... Name: check_icmp+source-ip.patch Type: text/x-diff Size: 2109 bytes Desc: not available URL: -------------- next part -------------- http://www.altinity.com UK: +44 (0)870 787 9243 US: +1 866 879 9184 Fax: +44 (0)845 280 1725 Skype: tonvoon From patrick.postfix at cervicek.de Thu Dec 20 20:27:46 2007 From: patrick.postfix at cervicek.de (Patrick Cervicek) Date: Thu, 20 Dec 2007 20:27:46 +0100 Subject: [Nagiosplug-devel] Fwd: Patch proposal for check_icmp In-Reply-To: References: <20071220092955.dz985aajjpusssow@mail.lin.at> Message-ID: Ton Voon schrieb: > Hi! > > I got this email from Harald re: check_icmp specifying a source > address. I don't know too much about check_icmp, so can anyone else > look over this? I applied this patch and it works, but i have 3 questions: > Begin forwarded message: > +#include 1) in.h is already included 5 lines higher. Is this #include necessary? It compiles & works also without it. > +static int > +add_source_ip(char *arg) > + if (bind(icmp_sock, (struct sockaddr *) &src, sizeof(struct sockaddr_un)) == -1) { 2) Wouldn't it better to check before, if 'icmp_sock' or 'sockets' is >0 ? 3) Is 'sizeof(struct sockaddr_UN)' good? In all other examples on the web to networkprogramming i find only 'sizeof(struct sockaddr)' or 'sizeof(struct sockaddr_in)'. I did a test with sizeof and get different results on my system: > sizeof test > sockaddr_un: 110 > sockaddr_in: 16 > sockaddr : 16 testcode: > #include > #include > #include > > > void main (void) { > > printf("sizeof test\n" > "sockaddr_un: %d\n" > "sockaddr_in: %d\n" > "sockaddr : %d\n" > ,sizeof(struct sockaddr_un), > sizeof(struct sockaddr_in), > sizeof(struct sockaddr)); > } > Patrick From holger at CIS.FU-Berlin.DE Thu Dec 20 20:48:12 2007 From: holger at CIS.FU-Berlin.DE (Holger Weiss) Date: Thu, 20 Dec 2007 20:48:12 +0100 Subject: [Nagiosplug-devel] Fwd: Patch proposal for check_icmp In-Reply-To: References: <20071220092955.dz985aajjpusssow@mail.lin.at> Message-ID: <20071220194812.GW26793517@CIS.FU-Berlin.DE> * Patrick Cervicek [2007-12-20 20:27]: > Ton Voon schrieb: > > I got this email from Harald re: check_icmp specifying a source > > address. I don't know too much about check_icmp, so can anyone else > > look over this? Looks fine to me (apart from the fact that it won't work with IPv6, but check_icmp currently doesn't support IPv6 anyway; we should fix this sometime). I cleaned things up a bit and added the possibility to specify interface names (which doesn't require root-privileges). If nobody objects, I'll commit the attached version of the patch. > > +#include > > 1) in.h is already included 5 lines higher. Is this #include necessary? No. > > + if (bind(icmp_sock, (struct sockaddr *) &src, sizeof(struct sockaddr_un)) == -1) { > > 2) Wouldn't it better to check before, if 'icmp_sock' or 'sockets' is >0 ? That's not necessary. If icmp_sock wasn't created the bind(2) call will fail and the plugin will spit out an error message such as "check_icmp: Cannot bind to IP address 127.0.0.1: Bad file descriptor". > 3) Is 'sizeof(struct sockaddr_UN)' good? Nope. Thanks to Harald for the patch and thanks to Patrick for looking into it! Holger -------------- next part -------------- Index: check_icmp.c =================================================================== --- check_icmp.c (revision 1880) +++ check_icmp.c (working copy) @@ -54,6 +54,7 @@ #include "netutils.h" #include "utils.h" +#include #include #include #include @@ -66,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -178,11 +180,13 @@ void print_usage (void); static u_int get_timevar(const char *); static u_int get_timevaldiff(struct timeval *, struct timeval *); +static in_addr_t get_ip_address(const char *); static int wait_for_reply(int, u_int); static int recvfrom_wto(int, char *, unsigned int, struct sockaddr *, u_int *); static int send_icmp_ping(int, struct rta_host *); static int get_threshold(char *str, threshold *th); static void run_checks(void); +static void set_source_ip(char *); static int add_target(char *); static int add_target_ip(char *, struct in_addr *); static int handle_random_icmp(struct icmp *, struct sockaddr_in *); @@ -446,7 +450,7 @@ /* parse the arguments */ for(i = 1; i < argc; i++) { - while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:i:b:I:l:m:")) != EOF) { + while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:S:i:b:I:l:m:")) != EOF) { switch(arg) { case 'v': debug++; @@ -489,6 +493,9 @@ crit_down = (unsigned char)strtoul(ptr + 1, NULL, 0); } break; + case 'S': /* specify source ip for ping */ + set_source_ip(optarg); + break; case 'V': /* version */ /*print_revision (progname, revision);*/ /* FIXME: Why? */ exit (STATE_OK); @@ -1109,6 +1116,40 @@ return 0; } + +static void +set_source_ip(char *arg) +{ + struct sockaddr_in src; + + memset(&src, 0, sizeof(src)); + src.sin_family = AF_INET; + if((src.sin_addr.s_addr = inet_addr(arg)) == INADDR_NONE) + src.sin_addr.s_addr = get_ip_address(arg); + if (bind(icmp_sock, (struct sockaddr *)&src, sizeof(src)) == -1) + crash("Cannot bind to IP address %s", arg); +} + +/* TODO: Move this to netutils.c and also change check_dhcp to use that. */ +static in_addr_t +get_ip_address(const char *ifname) +{ +#if defined(SIOCGIFADDR) + struct ifreq ifr; + struct in_addr ip; + + strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); + ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; + if (ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1) + crash("Cannot determine IP address of interface %s", ifname); + ip = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr; + return ip.s_addr; +#else + errno = 0; + crash("Cannot get interface IP address on this platform."); +#endif +} + /* * u = micro * m = milli @@ -1225,6 +1266,8 @@ printf (" %s\n", "-H"); printf (" %s\n", _("specify a target")); + printf (" %s\n", "-S"); + printf (" %s\n", _("specify a source IP address or device name")); printf (" %s\n", "-w"); printf (" %s", _("warning threshold (currently ")); printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000 , warn.pl / 1000); From patrick.postfix at cervicek.de Fri Dec 21 13:00:36 2007 From: patrick.postfix at cervicek.de (Patrick Cervicek) Date: Fri, 21 Dec 2007 13:00:36 +0100 Subject: [Nagiosplug-devel] Fwd: Patch proposal for check_icmp In-Reply-To: <20071220194812.GW26793517@CIS.FU-Berlin.DE> References: <20071220092955.dz985aajjpusssow@mail.lin.at> <20071220194812.GW26793517@CIS.FU-Berlin.DE> Message-ID: Holger Weiss schrieb: > I cleaned things up a bit and added the possibility to > specify interface names (which doesn't require root-privileges). If > nobody objects, I'll commit the attached version of the patch. compiles & works as expected Patrick From noreply at sourceforge.net Fri Dec 21 13:13:21 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Fri, 21 Dec 2007 04:13:21 -0800 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-1851035 ] check_mysql_query -- Check value of specified column Message-ID: Patches item #1851035, was opened at 2007-12-14 20:37 Message generated for change (Comment added) made by pcervicek You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Greg Wittel (glwittel) Assigned to: Nobody/Anonymous (nobody) Summary: check_mysql_query -- Check value of specified column Initial Comment: Currently check_mysql_query only reads the value from the first column of the first row. This patch lets you specify the column number to read the result from instead. This is useful since some queries (like the 'show') queries do not give you control over the columns returned. If the column argument is not given, the current behavior of reading the first column is used. This patch numbers columns starting from '0', but that is easy enough to change. ---- Patch against Plugin Version (-V output): check_mysql_query N/A (nagios-plugins 1.4.11) Plugin Name: check_mysql_query Example Plugin Commandline: ./check_mysql_query -H test -q 'show slave status' --column 32 Tested on operating system: Linux robotron 2.6.10-1.770 Tested on architecture: i686 Tested with compiler: gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) Diff generated vs. SVN revision: 1590 off trunk. ---------------------------------------------------------------------- Comment By: Patrick Cervicek (pcervicek) Date: 2007-12-21 12:13 Message: Logged In: YES user_id=1963684 Originator: NO A Typo in print_help() "unless -c says otherwise" it should be a big -C (or --column) ---------------------------------------------------------------------- Comment By: Greg Wittel (glwittel) Date: 2007-12-14 20:39 Message: Logged In: YES user_id=1297361 Originator: YES Forgot to attach the diff ;o) Generated via: diff -Naur File Added: check_mysql_query.c.diff ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1851035&group_id=29880 From holger at CIS.FU-Berlin.DE Fri Dec 21 14:25:56 2007 From: holger at CIS.FU-Berlin.DE (Holger Weiss) Date: Fri, 21 Dec 2007 14:25:56 +0100 Subject: [Nagiosplug-devel] Fwd: Patch proposal for check_icmp In-Reply-To: References: <20071220092955.dz985aajjpusssow@mail.lin.at> <20071220194812.GW26793517@CIS.FU-Berlin.DE> Message-ID: <20071221132556.GC28313306@CIS.FU-Berlin.DE> * Patrick Cervicek [2007-12-21 13:00]: > Holger Weiss schrieb: > > I cleaned things up a bit and added the possibility to > > specify interface names (which doesn't require root-privileges). If > > nobody objects, I'll commit the attached version of the patch. > > compiles & works as expected Thanks! I changed the option to "-s" instead of "-S" (or is there a reason to use "-S"?) and committed the patch. Holger