From elauri at lacitec.on.ca Tue Jun 1 05:13:04 2004 From: elauri at lacitec.on.ca (Eric Lauriault) Date: Tue Jun 1 05:13:04 2004 Subject: [Nagiosplug-devel] aix 5.2 patch for nagios-plugins-1.4.0alpha1 Message-ID: Hi, Here's a small patch I wrote for aix 5.2. It fixes compilation issues due to misplacement of a VA_COPY and an infinite loop while in read_filesystem_list. Enjoy! Eric Lauriault, eric at lacitec.on.ca Analyste/Administrateur UNIX/telecom/reseau La Cite collegiale -------------- next part -------------- A non-text attachment was scrubbed... Name: nagios-plugins-1.4.0alpha1-aix52.patch Type: application/octet-stream Size: 1645 bytes Desc: not available URL: From seanius at seanius.net Tue Jun 1 05:13:06 2004 From: seanius at seanius.net (sean finney) Date: Tue Jun 1 05:13:06 2004 Subject: [Nagiosplug-devel] bug with "-e" argument to check_disk [patch included] Message-ID: <20040531170107.GA9022@seanius.net> hi there, i've been looking into getting disk space monitoring integrated into the other nagios monitoring i'm already doing, and i think i've found a bug with on of the command line options, "-e". the description says: -e, --errors-only Display only devices/mountpoints with errors when running on a system with no disk space errors: cork[~]12:49:49$ /usr/local/sbin/check_disk -w 15% -c 10% DISK OK [1247916 kB (63%) free on /dev/sda7] [25815 kB (26%) free on /dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 kB (52%) free on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] [9166460 kB (93%) free on /dev/sda5] [16410780 kB (74%) free on /dev/emcpowerb6] [92890296 kB (78%) free on /dev/emcpowera1] [51267056 kB (43%) free on /dev/emcpowera2] [22861384 kB (79%) free on /dev/emcpowerb3] [7366696 kB (51%) free on /dev/emcpowerb5] however, when running with -e cork[~]12:50:05$ /usr/local/sbin/check_disk -w 15% -c 10% -e Unable to read output /bin/df -Pk /dev/emcpowerb5 15124868 6983988 7372576 49% /usr/local/swat very strange indeed! even stranger, if you specify the run with the -v option, the behaviour goes away: cork[~]12:50:44$ /usr/local/sbin/check_disk -w 15% -c 10% -e -v /bin/df -Pk ==> DISK OK [1247900 kB (63%) free on /dev/sda7] [25815 kB (26%) free on /dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 kB (52%) free on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] [9166276 kB (93%) free on /dev/sda5] [16410760 kB (74%) free on /dev/emcpowerb6] [92899616 kB (78%) free on /dev/emcpowera1] [51266780 kB (43%) free on /dev/emcpowera2] [22861368 kB (79%) free on /dev/emcpowerb3] [7326368 kB (51%) free on /dev/emcpowerb5] some investigation turned up what looks like a bug in the flow of execution in the main while loop processing the output of df, which causes the last processed line to always have result == STATE_UNKNOWN. specifically, line 121-122: if (disk_result==STATE_OK && erronly && !verbose) continue result is not set to the value of disk_result (via calling max_state at the end of the while loop, which is skipped by this continue statement), and as such is still in STATE_UNKNOWN. attached is a very short patch (diff -u) which i believe fixes the problem. sean ps - please cc me with any correspondance, i'm not subscribed to the list -------------- next part -------------- --- check_disk.c.old 2004-05-31 12:04:37.000000000 -0400 +++ check_disk.c 2004-05-31 12:45:11.000000000 -0400 @@ -118,8 +118,10 @@ if (strcmp (file_system, "none") == 0) strncpy (file_system, mntp, MAX_INPUT_BUFFER-1); - if (disk_result==STATE_OK && erronly && !verbose) + if (disk_result==STATE_OK && erronly && !verbose){ + result = max_state (result, disk_result); continue; + } if (disk_result!=STATE_OK || verbose>=0) asprintf (&output, "%s [%.0f kB (%d%%) free on %s]", output, -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From verdon at cict.fr Tue Jun 1 05:41:02 2004 From: verdon at cict.fr (carole verdon) Date: Tue Jun 1 05:41:02 2004 Subject: [Nagiosplug-devel] bug with "-e" argument to check_disk [patch included] In-Reply-To: <20040531170107.GA9022@seanius.net> References: <20040531170107.GA9022@seanius.net> Message-ID: <40BC7913.7040905@cict.fr> Hi, I haven't got the same error. On the other hand, i have another problem. If i execute this command ./check_disk -e -w 10% -c 5% -X lofs -X nfs, i obtain the following result that i don't understand: DISK CRITICAL - free space: /var/mail.avant.coque 1085 MB (10%); /aurore6 305 MB (8%); /aurore9 1546 MB (8%); /aurore14 4666 MB (94%); /aurore15 3384 MB (70%);| /=996MB;2292;2419;0;2547 /tmp=4333MB;3899;4116;0;4333 /var/mail.avant.coque=1085MB;9983;10538;0;11093 /usr/local=759MB;3631;3833;0;4035 /aurore1=1721MB;2723;2874;0;3026 /aurore2=1185MB;2723;2874;0;3026 /aurore3=3803MB;3902;4119;0;4336 /aurore4=1023MB;3631;3833;0;4035 /aurore5=1031MB;3631;3833;0;4035 /aurore6=304MB;3631;3833;0;4035 /aurore7=2127MB;2257;2382;0;2508 /aurore8=12265MB;18152;19160;0;20169 /aurore9=1546MB;18152;19160;0;20169 /aurore10=3421MB;18152;19160;0;20169 /aurore11=9207MB;18152;19160;0;20169 /aurore12=14657MB;15954;16840;0;17727 /aurore13=24646MB;34092;35986;0;37881 /aurore14=4665MB;4954;4954;0;4954 /aurore15=3384MB;4840;4840;0;4840 Why the output displays "/aurore14 4666 MB (94%)" and "/aurore15 3384 MB (70%)" whereas they have respectively 94% and 70% of free space? Does your patch correct also this error ? Carole. sean finney wrote: >hi there, > >i've been looking into getting disk space monitoring integrated into >the other nagios monitoring i'm already doing, and i think i've found >a bug with on of the command line options, "-e". the description says: > > -e, --errors-only > Display only devices/mountpoints with errors > >when running on a system with no disk space errors: > >cork[~]12:49:49$ /usr/local/sbin/check_disk -w 15% -c 10% >DISK OK [1247916 kB (63%) free on /dev/sda7] [25815 kB (26%) free on >/dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 kB (52%) free >on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] [9166460 kB (93%) >free on /dev/sda5] [16410780 kB (74%) free on /dev/emcpowerb6] [92890296 >kB (78%) free on /dev/emcpowera1] [51267056 kB (43%) free on >/dev/emcpowera2] [22861384 kB (79%) free on /dev/emcpowerb3] [7366696 kB >(51%) free on /dev/emcpowerb5] > >however, when running with -e > >cork[~]12:50:05$ /usr/local/sbin/check_disk -w 15% -c 10% -e >Unable to read output >/bin/df -Pk >/dev/emcpowerb5 15124868 6983988 7372576 49% >/usr/local/swat > >very strange indeed! even stranger, if you specify the run with the >-v option, the behaviour goes away: > >cork[~]12:50:44$ /usr/local/sbin/check_disk -w 15% -c 10% -e -v >/bin/df -Pk ==> DISK OK [1247900 kB (63%) free on /dev/sda7] [25815 kB >(26%) free on /dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 >kB (52%) free on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] >[9166276 kB (93%) free on /dev/sda5] [16410760 kB (74%) free on >/dev/emcpowerb6] [92899616 kB (78%) free on /dev/emcpowera1] [51266780 >kB (43%) free on /dev/emcpowera2] [22861368 kB (79%) free on >/dev/emcpowerb3] [7326368 kB (51%) free on /dev/emcpowerb5] > >some investigation turned up what looks like a bug in the flow of >execution in the main while loop processing the output of df, which >causes the last processed line to always have result == STATE_UNKNOWN. >specifically, line 121-122: > >if (disk_result==STATE_OK && erronly && !verbose) > continue > >result is not set to the value of disk_result (via calling max_state at >the end of the while loop, which is skipped by this continue statement), >and as such is still in STATE_UNKNOWN. > >attached is a very short patch (diff -u) which i believe fixes the >problem. > > > sean > >ps - please cc me with any correspondance, i'm not subscribed to the > list > > >------------------------------------------------------------------------ > >--- check_disk.c.old 2004-05-31 12:04:37.000000000 -0400 >+++ check_disk.c 2004-05-31 12:45:11.000000000 -0400 >@@ -118,8 +118,10 @@ > if (strcmp (file_system, "none") == 0) > strncpy (file_system, mntp, MAX_INPUT_BUFFER-1); > >- if (disk_result==STATE_OK && erronly && !verbose) >+ if (disk_result==STATE_OK && erronly && !verbose){ >+ result = max_state (result, disk_result); > continue; >+ } > > if (disk_result!=STATE_OK || verbose>=0) > asprintf (&output, "%s [%.0f kB (%d%%) free on %s]", output, > > -- ********************************** VERDON Carole Ing?nieur Syst?me CICT - Universit? Paul Sabatier 118, route de Narbonne 31062 Toulouse Cedex T?l.: 05.61.36.60.44 Fax: 05.61.52.14.58 Mail: verdon at cict.fr ********************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ton.Voon at egg.com Tue Jun 1 06:01:13 2004 From: Ton.Voon at egg.com (Voon, Ton) Date: Tue Jun 1 06:01:13 2004 Subject: [Nagiosplug-devel] bug with "-e" argument to check_disk [patc h included] Message-ID: Sean, Which version of the plugins are you using? It looks like 1.3.1. Does this exist in 1.4? If so, can you provide a patch against CVS HEAD and I'll apply it. Ton -----Original Message----- From: sean finney [mailto:seanius at seanius.net] Sent: 31 May 2004 18:01 To: nagiosplug-devel at lists.sourceforge.net Subject: [Nagiosplug-devel] bug with "-e" argument to check_disk [patch included] hi there, i've been looking into getting disk space monitoring integrated into the other nagios monitoring i'm already doing, and i think i've found a bug with on of the command line options, "-e". the description says: -e, --errors-only Display only devices/mountpoints with errors when running on a system with no disk space errors: cork[~]12:49:49$ /usr/local/sbin/check_disk -w 15% -c 10% DISK OK [1247916 kB (63%) free on /dev/sda7] [25815 kB (26%) free on /dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 kB (52%) free on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] [9166460 kB (93%) free on /dev/sda5] [16410780 kB (74%) free on /dev/emcpowerb6] [92890296 kB (78%) free on /dev/emcpowera1] [51267056 kB (43%) free on /dev/emcpowera2] [22861384 kB (79%) free on /dev/emcpowerb3] [7366696 kB (51%) free on /dev/emcpowerb5] however, when running with -e cork[~]12:50:05$ /usr/local/sbin/check_disk -w 15% -c 10% -e Unable to read output /bin/df -Pk /dev/emcpowerb5 15124868 6983988 7372576 49% /usr/local/swat very strange indeed! even stranger, if you specify the run with the -v option, the behaviour goes away: cork[~]12:50:44$ /usr/local/sbin/check_disk -w 15% -c 10% -e -v /bin/df -Pk ==> DISK OK [1247900 kB (63%) free on /dev/sda7] [25815 kB (26%) free on /dev/sda2] [1931628 kB (100%) free on /dev/shm] [1768884 kB (52%) free on /dev/sda6] [7517516 kB (76%) free on /dev/sda3] [9166276 kB (93%) free on /dev/sda5] [16410760 kB (74%) free on /dev/emcpowerb6] [92899616 kB (78%) free on /dev/emcpowera1] [51266780 kB (43%) free on /dev/emcpowera2] [22861368 kB (79%) free on /dev/emcpowerb3] [7326368 kB (51%) free on /dev/emcpowerb5] some investigation turned up what looks like a bug in the flow of execution in the main while loop processing the output of df, which causes the last processed line to always have result == STATE_UNKNOWN. specifically, line 121-122: if (disk_result==STATE_OK && erronly && !verbose) continue result is not set to the value of disk_result (via calling max_state at the end of the while loop, which is skipped by this continue statement), and as such is still in STATE_UNKNOWN. attached is a very short patch (diff -u) which i believe fixes the problem. sean ps - please cc me with any correspondance, i'm not subscribed to the list This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which is authorised and regulated by the Financial Services Authority. Egg Investments Ltd. is entered in the FSA register under number 190518. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. From jhmartin at toger.us Tue Jun 1 09:27:05 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:27:05 2004 Subject: [Nagiosplug-devel] check_tcp patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against check_tcp from the 1.3.1 release does the following: * 02-14-04 Jason Martin * Allow non-integer timing thresholds * 02-06-04 Todd Carter * Corrected core problem in solaris 2.6 - 2.9 enviroments. * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. * The result is in solaris this condition causes this plugin to core dump A new function is_numnonneg is iuncluded in aws-utils.c, but of course that should be merged with utils.c. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvK4il2ODWuqVSBMRAjDuAJwK00RPe0pwIE0QhtCV/lbOZaF2hACeLHPx 0CN+QMTRI8DClXc1g/aOGtk= =ixnO -----END PGP SIGNATURE----- -------------- next part -------------- --- check_tcp.c Mon Jun 9 21:56:47 2003 +++ /home/nagios/plugins_build/nagios-plugins-1.3.1/plugins/aws_check_tcp.c Thu Feb 26 12:29:26 2004 @@ -18,11 +18,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: check_tcp.c,v 1.13.2.3 2003/06/02 14:46:48 kdebisschop Exp $ - * + * $Id: aws_check_tcp.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ + * + * Revision: + * 02-14-04 Jason Martin + * Allow non-integer timing thresholds + * 02-06-04 Todd Carter + * Corrected core problem in solaris 2.6 - 2.9 enviroments. + * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. + * The result is in solaris this condition causes this plugin to core dump + * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, + * check_overcr and check_dns plugins. *****************************************************************************/ -#define REVISION "$Revision: 1.13.2.3 $" +#define REVISION "$Revision: 1.1.1.1 $" #define DESCRIPTION "Check a TCP port" #define AUTHOR "Ethan Galstad" #define EMAIL "nagios at nagios.org" @@ -393,7 +402,10 @@ break; switch (c) { - case '?': /* print short usage statement if args not parsable */ + case '?': + /* print short usage statement if args not parsable */ + /* TEC and JSM Fix 2/6/04 */ + if (optarg != NULL) printf ("%s: Unknown argument: %s\n\n", progname, optarg); print_usage (); exit (STATE_UNKNOWN); @@ -401,7 +413,7 @@ print_help (); exit (STATE_OK); case 'V': /* version */ - print_revision (progname, "$Revision: 1.13.2.3 $"); + print_revision (progname, "$Revision: 1.1.1.1 $"); exit (STATE_OK); case 'v': /* verbose mode */ verbose = TRUE; @@ -412,14 +424,14 @@ server_address = optarg; break; case 'c': /* critical */ - if (!is_intnonneg (optarg)) - usage ("Critical threshold must be a nonnegative integer\n"); + if (!is_numnonneg (optarg)) + usage ("Critical threshold must be a nonnegative number\n"); critical_time = strtod (optarg, NULL); check_critical_time = TRUE; break; case 'w': /* warning */ - if (!is_intnonneg (optarg)) - usage ("Warning threshold must be a nonnegative integer\n"); + if (!is_numnonneg (optarg)) + usage ("Warning threshold must be a nonnegative number\n"); warning_time = strtod (optarg, NULL); check_warning_time = TRUE; break; @@ -501,7 +513,7 @@ void print_help (void) { - print_revision (progname, "$Revision: 1.13.2.3 $"); + print_revision (progname, "$Revision: 1.1.1.1 $"); printf ("Copyright (c) 1999 Ethan Galstad (nagios at nagios.org)\n\n" "This plugin tests %s connections with the specified host.\n\n", -------------- next part -------------- /* plugins/aws-utils.h. Generated automatically by configure. */ int is_numnonneg(char *); -------------- next part -------------- /***************************************************************************** * * utils.c * * Library of useful functions for plugins * * Copyright (c) 2000 Karl DeBisschop (karl at debisschop.net) * License: GPL * * $Revision: 1.1.1.1 $ * $Date: 2004/02/26 20:29:26 $ ****************************************************************************/ #include "config.h" #include "common.h" #include "version.h" #include #include int is_numnonneg (char *); #define LABELLEN 63 #define STRLEN 64 #define TXTBLK 128 /* ************************************************************************** * max_state(STATE_x, STATE_y) * compares STATE_x to STATE_y and returns result based on the following * STATE_UNKNOWN < STATE_OK < STATE_WARNING < STATE_CRITICAL * * Note that numerically the above does not hold ****************************************************************************/ #define max(a,b) (((a)>(b))?(a):(b)) int is_numnonneg (char *number) { if (strcmp("0",number) != 0 && strtod(number,NULL) == 0.0 && strtod(number,NULL) >= 0.0) return FALSE; else return TRUE; } From jhmartin at toger.us Tue Jun 1 09:30:01 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:30:01 2004 Subject: [Nagiosplug-devel] check_udp patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against check_udp from the 1.3.1 release does the following: > * 02-13-04 Jason Martin > * Changed to only print one line, hide netutils.c pollution > * Accept non-integer timing thresholds > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump It requires the is_numnonneg function from the check_tcp patch. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvK69l2ODWuqVSBMRArN0AKCPxNrDSE2CfrV3XzDDvfzWMzjbowCePoH6 GwIw6R7rniE4k78RkHcT9wU= =oPzp -----END PGP SIGNATURE----- -------------- next part -------------- 9c9 < * Last Modified: $Date: 2003/03/07 06:40:33 $ --- > * Last Modified: $Date: 2004/02/26 20:29:26 $ 36a37,46 > * Revision > * 02-13-04 Jason Martin > * Changed to only print one line, hide netutils.c pollution > * Accept non-integer timing thresholds > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, > * check_overcr and check_dns plugins. 42a53 > #include "unistd.h" 45a57 > int stdout_save; 59a72,73 > struct timeval tv; > double elapsed_time; 76c90,97 < time (&start_time); --- > gettimeofday (&tv, NULL); > > /* hide stdout during process_udp request since it pollutes unless verbose*/ > if (! verbose) { > dup2(1,stdout_save); > close(1); > } > 80c101,107 < time (&end_time); --- > > /* restore stdout if we hid it during process_udp_request */ > if (! verbose) { > fflush(stdout); > dup2(stdout_save,1); > } > 97a125 > elapsed_time = delta_time (tv); 103c131 < && (end_time - start_time) > critical_time) result = STATE_CRITICAL; --- > && elapsed_time > critical_time) result = STATE_CRITICAL; 105c133 < && (end_time - start_time) > warning_time) result = --- > && elapsed_time > warning_time) result = 108c136 < printf ("Connection %s on port %d - %d second response time\n", --- > printf ("Connection %s on port %d - %7.3f second response time\n", 110c138 < (int) (end_time - start_time)); --- > elapsed_time); 115d142 < 168a196,197 > /* TEC and JHM Fix 2/6/04 */ > if (optarg != NULL) 176c205 < print_revision (progname, "$Revision: 1.4.2.1 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); 187,188c216,217 < if (!is_intnonneg (optarg)) < usage ("Critical threshold must be a nonnegative integer\n"); --- > if (!is_numnonneg (optarg)) > usage ("Critical threshold must be a nonnegative number\n"); 193,194c222,223 < if (!is_intnonneg (optarg)) < usage ("Warning threshold must be a nonnegative integer\n"); --- > if (!is_numnonneg (optarg)) > usage ("Warning threshold must be a nonnegative number\n"); 249c278 < print_revision (progname, "$Revision: 1.4.2.1 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); From jhmartin at toger.us Tue Jun 1 09:36:01 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:36:01 2004 Subject: [Nagiosplug-devel] check_ldap patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch addes non-integer timing thresholds to check_ldap. It also makes naming changes that are not necessary; the important thing is the threshold changes. It requires the is_numnonneg function from the check_tcp patch I submitted. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLAml2ODWuqVSBMRAroEAJ4hjSHwSVqrUEunwLX+gzarZoXcpwCfZmNx FLuFpCXRRlFFJpcqnczPbnk= =rBhM -----END PGP SIGNATURE----- -------------- next part -------------- 8c8 < * Last Modified: $Date: 2003/01/29 06:16:15 $ --- > * Last Modified: $Date: 2004/02/26 20:29:26 $ 10c10 < * Command line: check_ldap -h -b -p -w -w --- > * Command line: aws_check_ldap -h -b -p -w -w 23,24c23,24 < const char *progname = "check_ldap"; < const char *revision = "$Revision: 1.4 $"; --- > const char *progname = "aws_check_ldap"; > const char *revision = "$Revision: 1.1.1.1 $"; 51,52c51,53 < int warn_time = UNDEFINED; < int crit_time = UNDEFINED; --- > double warn_time = UNDEFINED; > double crit_time = UNDEFINED; > double elapsed_time; 61,62c62,64 < int t_diff; < time_t time0, time1; --- > /* int t_diff; */ > /* time_t time0, time1; */ > struct timeval tv; 65c67 < usage ("check_ldap: could not parse arguments\n"); --- > usage ("aws_check_ldap: could not parse arguments\n"); 74c76 < time (&time0); --- > gettimeofday(&tv,NULL); 86c88 < /*ldap_perror(ld, "ldap_bind"); */ --- > ldap_perror(ld, "ldap_bind"); 106c108 < time (&time1); --- > elapsed_time=delta_time(tv); 109c111 < t_diff = time1 - time0; --- > /* t_diff = time1 - time0; */ 111,112c113,114 < if (crit_time!=UNDEFINED && t_diff>=crit_time) { < printf ("LDAP critical - %i seconds response time\n", t_diff); --- > if (crit_time!=UNDEFINED && elapsed_time >= crit_time) { > printf ("LDAP critical - %7.3f seconds response time\n", elapsed_time); 116,117c118,119 < if (warn_time!=UNDEFINED && t_diff>=warn_time) { < printf ("LDAP warning - %i seconds response time\n", t_diff); --- > if (warn_time!=UNDEFINED && elapsed_time >= warn_time) { > printf ("LDAP warning - %7.3f seconds response time\n", elapsed_time); 122c124 < printf ("LDAP ok - %i seconds response time\n", t_diff); --- > printf ("LDAP ok - %7.3f seconds response time\n", elapsed_time); 201c203,205 < warn_time = atoi (optarg); --- > if (!is_numnonneg(optarg)) > usage2 ("timeout interval must be a positive integer", optarg); > warn_time = strtod (optarg,NULL); 204c208,210 < crit_time = atoi (optarg); --- > if (!is_numnonneg(optarg)) > usage2 ("timeout interval must be a positive integer", optarg); > crit_time = strtod (optarg,NULL); 207c213 < usage ("check_ldap: could not parse arguments\n"); --- > usage ("aws_check_ldap: could not parse arguments\n"); From jhmartin at toger.us Tue Jun 1 09:36:05 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:36:05 2004 Subject: [Nagiosplug-devel] check_smtp patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against the 1.3.1 release does the following: > * Revision: > * Jason Martin > * Handle non-integer time thresholds > * It requires the is_numnonneg function from the check_tcp patch I submitted earlier. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvK9il2ODWuqVSBMRAoobAJ0byGWKe0vcRLJLzi5D7jHCfoWmaQCfRWYg jn63LebXnaLPob/hGHf7VvQ= =YGMd -----END PGP SIGNATURE----- -------------- next part -------------- 9c9 < * $Id: check_smtp.c,v 1.9.2.2 2003/03/07 07:15:40 kdebisschop Exp $ --- > * $Id: aws_check_smtp.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ 18a19,22 > * Revision: > * Jason Martin > * Handle non-integer time thresholds > * 72c76 < int warning_time = 0; --- > double warning_time = 0; 74c78 < int critical_time = 0; --- > double critical_time = 0; 76a81,82 > struct timeval tv; > double elapsed_time; 111c117,118 < time (&start_time); --- > /* time (&start_time); */ > gettimeofday (&tv, NULL); 129c136 < printf ("Invalid SMTP response received from host\n"); --- > {printf ("Invalid SMTP response received from host\n");} 131,132c138,139 < printf ("Invalid SMTP response received from host on port %d\n", < server_port); --- > {printf ("Invalid SMTP response received from host on port %d\n", > server_port);} 163c170,171 < time (&end_time); --- > /* time (&end_time); */ > elapsed_time = delta_time (tv); 165c173 < if (check_critical_time == TRUE && (end_time - start_time) > critical_time) --- > if (check_critical_time == TRUE && elapsed_time > critical_time) 167c175 < else if (check_warning_time == TRUE && (end_time - start_time) > warning_time) --- > else if (check_warning_time == TRUE && elapsed_time > warning_time) 171,172c179 < printf ("SMTP %s - %d sec. response time, %s\n", < state_text (result), (int) (end_time - start_time), buffer); --- > printf ("SMTP %s - %7.3f sec. response time, %s\n", state_text (result), elapsed_time, buffer); 174c181 < printf ("SMTP %s - %d second response time\n", state_text (result), (int) (end_time - start_time)); --- > printf ("SMTP %s - %7.3f second response time\n", state_text (result), elapsed_time); 253,254c260,261 < if (is_intnonneg (optarg)) { < critical_time = atoi (optarg); --- > if (is_numnonneg (optarg)) { > critical_time = strtod(optarg,NULL); 262,263c269,270 < if (is_intnonneg (optarg)) { < warning_time = atoi (optarg); --- > if (is_numnonneg (optarg)) { > warning_time = strtod(optarg,NULL); 282c289 < print_revision (progname, "$Revision: 1.9.2.2 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); 328c335 < print_revision (progname, "$Revision: 1.9.2.2 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); From jhmartin at toger.us Tue Jun 1 09:39:03 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:39:03 2004 Subject: [Nagiosplug-devel] check_overcr patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attach patch against check_overcr from the 1.3.1 release does the following: > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. Seems that getoptlong* .c in solaris returns a NULL value for opt arg and in linux it returns a "". > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, > * check_overcr and check_dns plugins. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLDsl2ODWuqVSBMRAvIeAJ9MwKPqXrQI/7GLZ23x7no3FtzrRACeMNHK deHz3ZMXwx4kV/J6G3D2xNk= =OM9M -----END PGP SIGNATURE----- -------------- next part -------------- 9c9 < * $Id: check_overcr.c,v 1.2 2003/01/13 12:15:16 kdebisschop Exp $ --- > * $Id: aws_check_overcr.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ 26c26,32 < * --- > * > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. Seems that getoptlong* .c in solaris returns a NULL value for optarg and in linux it returns a "". > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, > * check_overcr and check_dns plugins. > * 370,372c376,380 < printf ("%s: Unknown argument: %s\n\n", progname, optarg); < print_usage (); < exit (STATE_UNKNOWN); --- > /* TEC and JHM Fix 2/6/04 */ > if (optarg != NULL) > printf ("%s: Unknown argument: %s\n\n", progname, optarg); > print_usage (); > exit (STATE_UNKNOWN); 377c385 < print_revision (progname, "$Revision: 1.2 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); 451c459 < print_revision (progname, "$Revision: 1.2 $"); --- > print_revision (progname, "$Revision: 1.1.1.1 $"); From jhmartin at toger.us Tue Jun 1 09:43:03 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:43:03 2004 Subject: [Nagiosplug-devel] check_dns patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against check_dns from the 1.3.1 release does the following: > * - Corrected core problem in solaris 2.6 - 2.9 environments. > * - Todd Carter/Jason Martin 4 Feb 2004 - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLHOl2ODWuqVSBMRAu64AJ9J6Ktbi5tzkIL0EdaHEpO6Yn/mvACaAlzv c5TtYouqKkcwR4KSUZrg6jU= =lfda -----END PGP SIGNATURE----- -------------- next part -------------- 9,10c9,10 < * Last Modified: $Date: 2003/05/31 14:39:33 $ < * --- > * Last Modified: $Date: 2004/02/26 20:29:26 $ > * 13a14,15 > * - Corrected core problem in solaris 2.6 - 2.9 environments. > * - Todd Carter/Jason Martin 4 Feb 2004 52c54 < #define REVISION "$Revision: 1.8.2.3 $" --- > #define REVISION "$Revision: 1.1.1.1 $" 304d305 < 307c308 < --- > /* JHM + TEC 2-4-04 */ 310c311,312 < printf ("%s: Unknown argument: %s\n\n", progname, optarg); --- > if (optarg != NULL) > printf ("%s: Unknown argument: %s\n\n", progname, "optarg") ; 326c328 < if (is_host (optarg) == FALSE) { --- > if (optarg==NULL || is_host (optarg) == FALSE) { From jhmartin at toger.us Tue Jun 1 09:44:04 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:44:04 2004 Subject: [Nagiosplug-devel] check_nt patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against the 1.3.1 release of check_nt does the following: > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLIbl2ODWuqVSBMRAjqFAJ9Ei5O5v4YvSCH0rBNTWNG6MT/MBwCdH+qM lnmE7QE/S/XPE3VvoWvRT+8= =LAbo -----END PGP SIGNATURE----- -------------- next part -------------- 28a29,35 > * Revision: > * * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, > * check_overcr and check_dns plugins. 437,440c444,450 < case '?': /* print short usage statement if args not parsable */ < printf("%s: Unknown argument: %s\n\n",progname,optarg); < print_usage(); < exit(STATE_UNKNOWN); --- > case '?': > /* print short usage statement if args not parsable */ > /* TEC and JHM Fix 2/6/04 */ > if (optarg != NULL) > printf("%s: Unknown argument: %s\n\n",progname,optarg); > print_usage(); > exit(STATE_UNKNOWN); 445c455 < print_revision(progname,"$Revision: 1.7.2.3 $"); --- > print_revision(progname,"$Revision: 1.1.1.1 $"); 522c532 < print_revision(progname,"$Revision: 1.7.2.3 $"); --- > print_revision(progname,"$Revision: 1.1.1.1 $"); From jhmartin at toger.us Tue Jun 1 09:45:04 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:45:04 2004 Subject: [Nagiosplug-devel] check_nwstat patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached check_nwstat patch against the 1.3.1 release does the following: > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLJil2ODWuqVSBMRAtZAAJ4rsX1+nmAtQ5D/7VdUoYRmAQ5IWgCfY1Zj MrGODPjOBYK79xGFyEjn54w= =aN9E -----END PGP SIGNATURE----- -------------- next part -------------- 22c22 < * $Id: check_nwstat.c,v 1.4 2003/01/13 12:15:16 kdebisschop Exp $ --- > * $Id: aws_check_nwstat.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ 23a24,30 > * Revision: > * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux. > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt, > * check_overcr and check_dns plugins. 27c34 < #define REVISION "$Revision: 1.4 $" --- > #define REVISION "$Revision: 1.1.1.1 $" 674,677c681,687 < case '?': /* print short usage statement if args not parsable */ < printf ("%s: Unknown argument: %s\n\n", progname, optarg); < print_usage(); < exit(STATE_UNKNOWN); --- > case '?': > /* print short usage statement if args not parsable */ > /* TEC and JHM Fix 2/6/04 */ > if (optarg != NULL) > printf ("%s: Unknown argument: %s\n\n", progname, optarg); > print_usage(); > exit(STATE_UNKNOWN); 682c692 < print_revision(progname,"$Revision: 1.4 $"); --- > print_revision(progname,"$Revision: 1.1.1.1 $"); From jhmartin at toger.us Tue Jun 1 09:49:07 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 09:49:07 2004 Subject: [Nagiosplug-devel] check_http patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached check_http patch against the 1.3.1 release does the following: > * * 02-06-04 Jason Martin > * Allow non-integer timing thresholds > * Timing thresholds checked first > * Removed ^L's. > * * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a null value in solaris and a "" in linux. > * The result is in solaris this condition causes this plugin to core dump It also makes several textual changes that are not important and should not be used. 'Timing changes checked first' means that it checks the response time of a webserver prior to checking the response code, so even if redirect is 'ok', if the redirect comes back too slowly it'll still result in a warning. This patch requires the is_numnonneg function from the check_tcp patch. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLNTl2ODWuqVSBMRAixdAJ0ZEkFOS0mnguQUZsF6m45SrOmBLgCghAw2 qQHg9C2uhLVZddPr387QrWc= =t11r -----END PGP SIGNATURE----- -------------- next part -------------- 22c22 < * $Id: check_http.c,v 1.24.2.4 2003/06/21 05:31:23 kdebisschop Exp $ --- > * $Id: aws_check_http.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ 23a24,39 > * $Log: aws_check_http.c,v $ > * Revision 1.1.1.1 2004/02/26 20:29:26 nagios > * Imported sources > * > * > * Revision: > * * 02-06-04 Jason Martin > * Allow non-integer timing thresholds > * Timing thresholds checked first > * Removed ^L's. > * * 02-06-04 Todd Carter > * Corrected core problem in solaris 2.6 - 2.9 enviroments. > * Seems that getopt_long.c returns a null value in solaris and a "" in linux. > * The result is in solaris this condition causes this plugin to core dump > * - corrected. Also corrected in check_tcp, check_udp, aws_check_http, check_nt, > * check_overcr and check_dns plugins. 26,27c42,43 < const char *progname = "check_http"; < #define REVISION "$Revision: 1.24.2.4 $" --- > const char *progname = "aws_check_http"; > #define REVISION "$Revision: 1.1.1.1 $" 35a52 > #include "aws-utils.h" 120c137 < CHECK CONTENT: check_http -w 5 -c 10 --ssl www.verisign.com\n\n\ --- > CHECK CONTENT: aws_check_http -w 5 -c 10 --ssl www.verisign.com\n\n\ 125c142 < CHECK CERTIFICATE: check_http www.verisign.com -C 14\n\n\ --- > CHECK CERTIFICATE: aws_check_http www.verisign.com -C 14\n\n\ 229c246 < int check_http (void); --- > int aws_check_http (void); 243c260 < usage ("check_http: could not parse arguments\n"); --- > usage ("aws_check_http: could not parse arguments\n"); 280c297 < result = check_http (); --- > result = aws_check_http (); 283c300 < result = check_http (); --- > result = aws_check_http (); 287d303 < 346a363,364 > /* TEC and JHM - Fix 2/6/04 */ > if (optarg = NULL) 363c381 < if (!is_intnonneg (optarg)) --- > if (!is_numnonneg (optarg)) 369c387 < if (!is_intnonneg (optarg)) --- > if (!is_numnonneg (optarg)) 382c400 < usage ("check_http: invalid option - SSL is not available\n"); --- > usage ("aws_check_http: invalid option - SSL is not available\n"); 395c413 < usage ("check_http: invalid option - SSL is not available\n"); --- > usage ("aws_check_http: invalid option - SSL is not available\n"); 450c468 < usage ("check_http: call for regex which was not a compiled option\n"); --- > usage ("aws_check_http: call for regex which was not a compiled option\n"); 485c503 < usage ("check_http: you must specify a server address or host name\n"); --- > usage ("aws_check_http: you must specify a server address or host name\n"); 492d509 < 534d550 < 538c554 < check_http (void) --- > aws_check_http (void) 589c605 < asprintf (&buf, "%sUser-Agent: check_http/%s (nagios-plugins %s)\r\n", --- > asprintf (&buf, "%sUser-Agent: aws_check_http/%s (nagios-plugins %s)\r\n", 689a706,715 > /* check elapsed time first */ > elapsed_time = delta_time (tv); > asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n", > status_line, elapsed_time, timestamp, > (display_html ? "" : ""), elapsed_time); > if (check_critical_time == TRUE && elapsed_time > critical_time) > terminate (STATE_CRITICAL, msg); > if (check_warning_time == TRUE && elapsed_time > warning_time) > terminate (STATE_WARNING, msg); > 757c783 < check_http (); --- > aws_check_http (); 763c789 < check_http (); --- > aws_check_http (); 770c796 < check_http (); --- > aws_check_http (); 777c803 < check_http (); --- > aws_check_http (); 784c810 < check_http (); --- > aws_check_http (); 813,821d838 < /* check elapsed time */ < elapsed_time = delta_time (tv); < asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n", < status_line, elapsed_time, timestamp, < (display_html ? "" : ""), elapsed_time); < if (check_critical_time == TRUE && elapsed_time > critical_time) < terminate (STATE_CRITICAL, msg); < if (check_warning_time == TRUE && elapsed_time > warning_time) < terminate (STATE_WARNING, msg); 999d1015 < 1037d1052 < From jhmartin at toger.us Tue Jun 1 10:10:04 2004 From: jhmartin at toger.us (Jason Martin) Date: Tue Jun 1 10:10:04 2004 Subject: [Nagiosplug-devel] check_Disk_smp patch against 1.3.1 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch against check_disk_smb from the 1.3.1 release adds a check that the smbclient binary actually exists before attempting to execute it. - -Jason Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.5 (GNU/Linux) Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/ iD8DBQFAvLhPl2ODWuqVSBMRAnV/AJ4gUmFYmqKmZJvy+hfF1mqcUCF2HwCeKlab o5uKqWSrZnJE/XKzkW6tnGE= =ISCP -----END PGP SIGNATURE----- -------------- next part -------------- --- check_disk_smb.pl Thu Jul 10 23:03:49 2003 +++ /home/nagios/plugins_build/nagios-plugins-1.3.1/plugins-scripts/aws_check_disk_smb.pl Thu Feb 26 12:29:26 2004 @@ -16,7 +16,7 @@ # drives is a pain in the butt # 2-May-2002 - SGhosh fix for embedded perl # -# $Id: check_disk_smb.pl,v 1.8.2.1 2003/07/02 15:52:23 tonvoon Exp $ +# $Id: aws_check_disk_smb.pl,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $ # require 5.004; @@ -31,7 +31,7 @@ sub print_help (); sub print_usage (); -$PROGNAME = "check_disk_smb"; +$PROGNAME = "aws_check_disk_smb"; $ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; @@ -51,13 +51,17 @@ "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision: 1.8.2.1 $'); #' + print_revision($PROGNAME,'$Revision: 1.1.1.1 $'); #' exit $ERRORS{'OK'}; } if ($opt_h) {print_help(); exit $ERRORS{'OK'};} my $smbclient= "$utils::PATH_TO_SMBCLIENT " ; +if ( ! -x $smbclient ) { + print "Unable to locate smbclient: $smbclient\n"; + exit $ERRORS{"UNKNOWN"}; +} my $smbclientoptions=""; @@ -234,7 +238,7 @@ } sub print_help () { - print_revision($PROGNAME,'$Revision: 1.8.2.1 $'); + print_revision($PROGNAME,'$Revision: 1.1.1.1 $'); print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop Perl Check SMB Disk plugin for Nagios From seanius at seanius.net Sun Jun 6 08:15:00 2004 From: seanius at seanius.net (sean finney) Date: Sun Jun 6 08:15:00 2004 Subject: [Nagiosplug-devel] bug with "-e" argument to check_disk [patc h included] In-Reply-To: <40BC7913.7040905@cict.fr> References: <20040531170107.GA9022@seanius.net> <40BC7913.7040905@cict.fr> Message-ID: <20040604183929.GA23560@seanius.net> hi there, On Tue, Jun 01, 2004 at 01:32:53PM +0100, Voon, Ton wrote: > Sean, > > Which version of the plugins are you using? It looks like 1.3.1. yeah, this was off of 1.3.1, sorry for not specifying that. is 1.3.1 still being maintained, or will fixes only make their way into 1.4? > Does this exist in 1.4? If so, can you provide a patch against CVS HEAD and > I'll apply it. the specific problem doesn't seem to be there any longer, but now there seems to be something else: gingko[~/nagios-plugins-HEAD-200406040514/plugins]12:01:24$ ./check_disk -w 20% -c 15% -e DISK OK - free space:| /=246MB;358;380;0;448 /dev/shm=504MB;403;428;0;504 /boot=62MB;76;80;0;95 /home=15705MB;28079;29834;0;35099 /usr=9411MB;9660;10263;0;12075 /usr/local=5470MB;18721;19891;0;23402 /tmp=211MB;181;192;0;227 /var=1606MB;1877;1994;0;2347 /mnt=224MB;192;204;0;241 -e is only supposed to show the partitions/devices with errors, and here it is listing all of them. if i bump the warning level to something that triggers an error: gingko[~/nagios-plugins-HEAD-200406040514/plugins]12:01:32$ ./check_disk -w 30% -c 15% -e DISK WARNING - free space: /usr/local 5471 MB (23%);| /=246MB;313;380;0;448 /dev/shm=504MB;352;428;0;504 /boot=62MB;66;80;0;95 /home=15705MB;24569;29834;0;35099 /usr=9411MB;8452;10263;0;12075 /usr/local=5470MB;16381;19891;0;23402 /tmp=211MB;158;192;0;227 /var=1606MB;1642;1994;0;2347 /mnt=224MB;168;204;0;241 it looks good all the way up to the "|". looking at the src and the output of the first command it looks like the " - free space" is being initialized to something and printed regardless of whether or not there are errors, and everything after the "|" is printed regardless of whether or not -v was specified. or maybe this is intentional? the reason why this is not ideal for me is that these error messages are sent to an email->pager/sms gateway at my work, and these have a hard limit on the amount of text in any single message, and they are also limited to the amount of text they can display at any given time. i've attached a patch which does the following: - if "-v" is not specified and "-e" is, the "perf" data (the stuff after the "|") is not asprintf'd or later printed. i'm trying to make this the least intrusive possible, so if you think it makes sense to only print this information when -v is specified, feel free to patch my patch :) - if "-e" is specified and there are no errors, the " - free space: " string is not displayed, as it doesn't make much sense if this "perf" data is required output or the plugins now have some form of output syntax which they're expected to follow that this patch breaks, i'd be happy to find another way to work around the issue, just let me know. otherwise, here it is! thanks, sean -------------- next part -------------- --- check_disk.c.old 2004-06-04 14:35:04.000000000 -0400 +++ check_disk.c 2004-06-04 14:35:16.000000000 -0400 @@ -150,7 +150,7 @@ struct fs_usage fsp; struct name_list *temp_list; - output = strdup (" - free space:"); + output = strdup (""); details = strdup (""); perf = strdup (""); @@ -189,13 +189,16 @@ disk_result = check_disk (usp, fsp.fsu_bavail * fsp.fsu_blocksize); result = max_state (disk_result, result); psize = fsp.fsu_blocks*fsp.fsu_blocksize/mult; - asprintf (&perf, "%s %s", perf, - perfdata ((!strcmp(file_system, "none") || display_mntp) ? me->me_devname : me->me_mountdir, - fsp.fsu_bavail*fsp.fsu_blocksize/mult, units, - TRUE, min ((uintmax_t)psize-(uintmax_t)w_df, (uintmax_t)((1.0-w_dfp/100.0)*psize)), - TRUE, min ((uintmax_t)psize-(uintmax_t)c_df, (uintmax_t)((1.0-c_dfp/100.0)*psize)), - TRUE, 0, - TRUE, psize)); + // if -e was specified without -v, don't collect or print this data + if(!erronly || verbose){ + asprintf (&perf, "%s %s", perf, + perfdata ((!strcmp(file_system, "none") || display_mntp) ? me->me_devname : me->me_mountdir, + fsp.fsu_bavail*fsp.fsu_blocksize/mult, units, + TRUE, min ((uintmax_t)psize-(uintmax_t)w_df, (uintmax_t)((1.0-w_dfp/100.0)*psize)), + TRUE, min ((uintmax_t)psize-(uintmax_t)c_df, (uintmax_t)((1.0-c_dfp/100.0)*psize)), + TRUE, 0, + TRUE, psize)); + } if (disk_result==STATE_OK && erronly && !verbose) continue; @@ -218,7 +221,16 @@ } - asprintf (&output, "%s|%s", output, perf); + // if output has length > 0, there have been errors, so prefix if with + // the "free space" text + if(strlen(output)>0){ + asprintf (&output, " - free space: %s", output); + } + + // if the user has specified -e and not -v, don't affix the perf data + if(!erronly || verbose){ + asprintf (&output, "%s|%s", output, perf); + } if (verbose > 2) asprintf (&output, "%s%s", output, details); -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From ELauri at lacitec.on.ca Sun Jun 6 08:15:02 2004 From: ELauri at lacitec.on.ca (Eric Lauriault) Date: Sun Jun 6 08:15:02 2004 Subject: [Nagiosplug-devel] aix 5.2 patch for nagios-plugins-1.4.0alpha1... again Message-ID: Hi, It seems like my previous post didn't contain the patch. Here it is : diff -Paru nagios-plugins-1.4.0alpha1-orig/lib/mountlist.c nagios-plugins-1.4.0alpha1/lib/mountlist.c --- nagios-plugins-1.4.0alpha1-orig/lib/mountlist.c 2003-10-29 21:18:12.000000000 -0500 +++ nagios-plugins-1.4.0alpha1/lib/mountlist.c 2004-05-27 15:35:46.000000000 -0400 @@ -719,7 +719,7 @@ /* Get the list of mounted filesystems. */ mntctl (MCTL_QUERY, bufsize, (struct vmount *) entries); - for (thisent = entries; thisent < entries + bufsize; + for (thisent = entries; thisent < entries + bufsize && ((struct vmount *) thisent)->vmt_length; thisent += vmp->vmt_length) { char *options, *ignore; diff -Paru nagios-plugins-1.4.0alpha1-orig/lib/snprintf.c nagios-plugins-1.4.0alpha1/lib/snprintf.c --- nagios-plugins-1.4.0alpha1-orig/lib/snprintf.c 2003-03-07 20:59:30.000000000 -0500 +++ nagios-plugins-1.4.0alpha1/lib/snprintf.c 2004-05-27 15:30:53.000000000 -0400 @@ -85,6 +85,14 @@ #include #endif +#ifndef VA_COPY +#ifdef HAVE_VA_COPY +#define VA_COPY(dest, src) __va_copy(dest, src) +#else +#define VA_COPY(dest, src) (dest) = (src) +#endif +#endif + #if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF) /* only include stdio.h if we are not re-defining snprintf or vsnprintf */ #include @@ -109,13 +117,6 @@ #define SAFE_FREE(x) do { if ((x) != NULL) {free((x)); (x)=NULL;} } while(0) #endif -#ifndef VA_COPY -#ifdef HAVE_VA_COPY -#define VA_COPY(dest, src) __va_copy(dest, src) -#else -#define VA_COPY(dest, src) (dest) = (src) -#endif -#endif static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in); Eric Lauriault, eric at lacitec.on.ca Analyste/Administrateur UNIX/telecom/reseau La Cite collegiale From Ben at clewett.org.uk Mon Jun 7 01:10:05 2004 From: Ben at clewett.org.uk (Ben Clewett) Date: Mon Jun 7 01:10:05 2004 Subject: [Nagiosplug-devel] Re: [perfparse - Help] Missing metrics? In-Reply-To: References: Message-ID: <40C422F2.1020809@clewett.org.uk> Jason, You problem is unfortunately common. The nagios plugin's which support performance data are so new that even the alpha-release does not contain them. PerfParse does not contain an entry until it finds the first metric for a service. Then it will be created automatically. You need to get the latest snapshot, which is available from a link on the plugin web site: http://nagiosplug.sourceforge.net At time of writing, this is: http://nagiosplug.sourceforge.net/snapshot/nagios-plugins-HEAD-200406070514.tar.gz I have CC'd this message to the nagios plugin developers page, as I my self are very interested to know when these will be released. Please continue to enjoy PerfParse! Ben http://sourceforge.net/projects/perfparse/ PerfParse. Storage and analysis of binary performance data produced by Nagios. High quality accurate graphs of live data from standard Nagios plugins. Permanent history of plugin results with advanced analysis tools SourceForge.net wrote: > Read and respond to this message at: > https://sourceforge.net/forum/message.php?msg_id=2602758 > By: jasonashworth > > Just about got PerfParse running now - just got to get the shell script scheduled > in cron (maybe this should be in the docs soon?) > > Only problem is, the only metrics I seem to get is any based on the check_tcp > plugin. None of the rest are selectable, or even in the perfdata_service_bin > table, although they're all in the perfdata_service table. > > Why is this? Is it because I'm using Plugins v1.3.1? If so, is the new 1.4x > stable enough for production use? > > P.S. Looks like it's going to be a great product - just what Nagios has needed > for a long time!! From Jason.Ashworth at chrysalis.com Mon Jun 7 08:56:06 2004 From: Jason.Ashworth at chrysalis.com (Jason Ashworth) Date: Mon Jun 7 08:56:06 2004 Subject: [Nagiosplug-devel] check_nwstat disk figures wrong Message-ID: Hi, I downloaded nagios-plugins-HEAD-200406070514 to test, as I wanted to get performance data from service checks on NT and NW boxes to get PerfParse to read, although it looks like these plugins still don't output any performance info. Any idea when? (- REALLY want this feature so I can report on disk usages, CPU times, etc)!! However, when using this version, I also noticed that the disk usage stats didn't report the correct percentage. Here's an example - SERVICE ALERT: stealth;Sys;OK;HARD;1;548 MB (2147483648%) free on volume sys changed back to stealth;Sys;OK;HARD;1;547 MB (27%) free on volume sys after changing back to v1.3.1 of Nagios Plugins Cheers, Jason ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ********************************************************************** ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ From verdon at cict.fr Mon Jun 7 09:05:02 2004 From: verdon at cict.fr (carole verdon) Date: Mon Jun 7 09:05:02 2004 Subject: [Nagiosplug-devel] pb with nrpe and check_oracle Message-ID: <40C491BD.4040109@cict.fr> Hi, I wrote a script, check_oracle_databases.sh, that would permit to take dynamically into account the file /etc/oratab to verify all databases that it contains. This script calls the check_oracle.sh script. On remote host (HP-UX server), the script works fine: $ /usr/local/nagios/libexec/check_oracle_databases.sh + /usr/local/nagios/libexec/check_oracle_databases.sh all databases OK but on nagios server (solaris server), it don't work. if in my check_oracle_databases.sh script i put the following lines, i obtain that: if [ $result -eq 0 ] ; then echo "all databases OK" exit $STATE_OK else echo "$result" echo "$database_sid Database is DOWN" exit $STATE_CRITICAL fi ./check_nrpe_nossl -H telline.cict.fr -c check_oracle CHECK_NRPE: No output returned from daemon. if in my check_oracle_databases.sh script i put this: if [ $result -eq 0 ] ; then echo "all databases OK" exit $STATE_OK elif [ $result -eq 1 ] ; then echo "$result" echo "$database_sid Database is DOWN" exit $STATE_CRITICAL fi I obtain : ./check_nrpe_nossl -H telline.cict.fr -c check_oracle NRPE: Unable to read output N.B: command defined in nrpe.cfg on remote host: command[check_oracle]=/usr/local/nagios/libexec/check_oracle_databases.sh I don't understand why nrpe (compiled without ssl) don't arrive to read the output of plugin. All another checks (disk, load...) work well. Can you help me, please? It's very urgent. Thanks. Carole. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: check_oracle URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle_databases.sh Type: application/x-sh Size: 1465 bytes Desc: not available URL: From verdon at cict.fr Tue Jun 8 01:49:01 2004 From: verdon at cict.fr (carole verdon) Date: Tue Jun 8 01:49:01 2004 Subject: [Nagiosplug-devel] RESOLVED pb with nrpe and check_oracle In-Reply-To: <40C491BD.4040109@cict.fr> References: <40C491BD.4040109@cict.fr> Message-ID: <40C57D18.3020003@cict.fr> Hi, I found the solution of my problem. In fact, in my script i use a tempory file that it don't create when i use check_nrpe. So, i indicate a path (/tmp/_...) and now it works well. I join again my scripts if that can interest someone. Carole. carole verdon wrote: > Hi, > > I wrote a script, check_oracle_databases.sh, that would permit to take > dynamically into account the file /etc/oratab to verify all databases > that it contains. > > This script calls the check_oracle.sh script. > > On remote host (HP-UX server), the script works fine: > > $ /usr/local/nagios/libexec/check_oracle_databases.sh > + /usr/local/nagios/libexec/check_oracle_databases.sh > all databases OK > > but on nagios server (solaris server), it don't work. > > if in my check_oracle_databases.sh script i put the following lines, i > obtain that: > if [ $result -eq 0 ] ; then > echo "all databases OK" > exit $STATE_OK > else > echo "$result" > echo "$database_sid Database is DOWN" > exit $STATE_CRITICAL > fi > > ./check_nrpe_nossl -H telline.cict.fr -c check_oracle > CHECK_NRPE: No output returned from daemon. > > if in my check_oracle_databases.sh script i put this: > if [ $result -eq 0 ] ; then > echo "all databases OK" > exit $STATE_OK > elif [ $result -eq 1 ] ; then > echo "$result" > echo "$database_sid Database is DOWN" > exit $STATE_CRITICAL > fi > > I obtain : > ./check_nrpe_nossl -H telline.cict.fr -c check_oracle > NRPE: Unable to read output > > > N.B: command defined in nrpe.cfg on remote host: > command[check_oracle]=/usr/local/nagios/libexec/check_oracle_databases.sh > > > I don't understand why nrpe (compiled without ssl) don't arrive to > read the output of plugin. All another checks (disk, load...) work well. > > > Can you help me, please? It's very urgent. > > Thanks. > > Carole. > > > > > > > > > > >------------------------------------------------------------------------ > >#! /bin/sh ># ># latigid010 at yahoo.com ># 01/06/2000 ># ># This Nagios plugin was created to check Oracle status ># > >PROGNAME=`basename $0` >PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` >REVISION=`echo '$Revision: 1.9 $' | sed -e 's/[^0-9.]//g'` > >. $PROGPATH/utils.sh > > >print_usage() { > echo "Usage:" > echo " $PROGNAME --tns " > echo " $PROGNAME --db " > echo " $PROGNAME --login " > echo " $PROGNAME --cache " > echo " $PROGNAME --tablespace " > echo " $PROGNAME --oranames " > echo " $PROGNAME --help" > echo " $PROGNAME --version" >} > >print_help() { > print_revision $PROGNAME $REVISION > echo "" > print_usage > echo "" > echo "Check Oracle status" > echo "" > echo "--tns SID/IP Address" > echo " Check remote TNS server" > echo "--db SID" > echo " Check local database (search /bin/ps for PMON process) and check" > echo " filesystem for sgadefORACLE_SID.dbf" > echo "--login SID" > echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password" > echo "--cache" > echo " Check local database for library and buffer cache hit ratios" > echo " ---> Requires Oracle user/password and SID specified." > echo " ---> Requires select on v_$sysstat and v_$librarycache" > echo "--tablespace" > echo " Check local database for tablespace capacity in ORACLE_SID" > echo " ---> Requires Oracle user/password specified." > echo " ---> Requires select on dba_data_files and dba_free_space" > echo "--oranames Hostname" > echo " Check remote Oracle Names server" > echo "--help" > echo " Print this help screen" > echo "--version" > echo " Print version and license information" > echo "" > echo "If the plugin doesn't work, check that the ORACLE_HOME environment" > echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the" > echo "tnsnames.ora file is locatable and is properly configured." > echo "" > echo "When checking local database status your ORACLE_SID is case sensitive." > echo "" > echo "If you want to use a default Oracle home, add in your oratab file:" > echo "*:/opt/app/oracle/product/7.3.4:N" > echo "" > support >} > >case "$1" in >1) > cmd='--tns' > ;; >2) > cmd='--db' > ;; >*) > cmd="$1" > ;; >esac > ># Information options >case "$cmd" in >--help) > print_help > exit $STATE_OK > ;; >-h) > print_help > exit $STATE_OK > ;; >--version) > print_revision $PLUGIN $REVISION > exit $STATE_OK > ;; >-V) > print_revision $PLUGIN $REVISION > exit $STATE_OK > ;; >esac > ># Hunt down a reasonable ORACLE_HOME >if [ -z "$ORACLE_HOME" ] ; then > # Adjust to taste > for oratab in /var/opt/oracle/oratab /etc/oratab > do > [ ! -f $oratab ] && continue > ORACLE_HOME=`IFS=: > while read SID ORACLE_HOME junk; > do > if [ "$SID" = "$2" -o "$SID" = "*" ] ; then > echo $ORACLE_HOME; > exit; > fi; > done < $oratab` > [ -n "$ORACLE_HOME" ] && break > done >fi ># Last resort >[ -z "$ORACLE_HOME" -a -d $PROGPATH/oracle ] && ORACLE_HOME=$PROGPATH/oracle > >if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then > echo "Cannot determine ORACLE_HOME for sid $2" > exit $STATE_UNKNOWN >fi >PATH=$PATH:$ORACLE_HOME/bin >LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib >export ORACLE_HOME PATH LD_LIBRARY_PATH > >case "$cmd" in >--tns) > tnschk=` tnsping $2` > tnschk2=` echo $tnschk | grep -c OK` > if [ ${tnschk2} -eq 1 ] ; then > tnschk3=` echo $tnschk | sed -e 's/.*(//' -e 's/).*//'` > echo "OK - reply time ${tnschk3} from $2" > exit $STATE_OK > else > echo "No TNS Listener on $2" > exit $STATE_CRITICAL > fi > ;; >--oranames) > namesctl status $2 | awk ' > /Server has been running for:/ { > msg = "OK: Up" > for (i = 6; i <= NF; i++) { > msg = msg " " $i > } > status = '$STATE_OK' > } > /error/ { > msg = "CRITICAL: " $0 > status = '$STATE_CRITICAL' > } > END { > print msg > exit status > }' > ;; >--db) > pmonchk=`ps -ef | grep -v grep | grep ${2}$ | grep -c pmon` > if [ ${pmonchk} -ge 1 ] ; then > echo "0" > #echo "${2} OK - ${pmonchk} PMON process(es) running" > #exit $STATE_OK > #if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then > #if [ ${pmonchk} -eq 1 ] ; then > #utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55` > #echo "${2} OK - running since ${utime}" > #exit $STATE_OK > #fi > else > echo "1" > #echo "${2} Database is DOWN" > #exit $STATE_CRITICAL > fi > ;; >--login) > loginchk=`sqlplus dummy/user@$2 < /dev/null` > loginchk2=` echo $loginchk | grep -c ORA-01017` > if [ ${loginchk2} -eq 1 ] ; then > echo "OK - dummy login connected" > exit $STATE_OK > else > loginchk3=` echo "$loginchk" | grep "ORA-" | head -1` > echo "CRITICAL - $loginchk3" > exit $STATE_CRITICAL > fi > ;; >--cache) > if [ ${5} -gt ${6} ] ; then > echo "UNKNOWN - Warning level is less then Crit" > exit $STATE_UNKNOWN > fi > result=`sqlplus -s ${3}/${4}@${2} << EOF >set pagesize 0 >select (1-(pr.value/(dbg.value+cg.value)))*100 >from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg >where pr.name='physical reads' >and dbg.name='db block gets' >and cg.name='consistent gets'; >EOF` > > if [ -n "`echo $result | grep ORA-`" ] ; then > error=` echo "$result" | grep "ORA-" | head -1` > echo "CRITICAL - $error" > exit $STATE_CRITICAL > fi > > buf_hr=`echo $result | awk '{print int($1)}'` > result=`sqlplus -s ${3}/${4}@${2} << EOF >set pagesize 0 >select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 >from v\\$librarycache lc; >EOF` > > if [ -n "`echo $result | grep ORA-`" ] ; then > error=` echo "$result" | grep "ORA-" | head -1` > echo "CRITICAL - $error" > exit $STATE_CRITICAL > fi > > lib_hr=`echo $result | awk '{print int($1)}'` > > if [ $buf_hr -le ${5} -o $lib_hr -le ${5} ] ; then > echo "${2} CRITICAL - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" > exit $STATE_CRITICAL > fi > if [ $buf_hr -le ${6} -o $lib_hr -le ${6} ] ; then > echo "${2} WARNING - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" > exit $STATE_WARNING > fi > echo "${2} OK - Cache Hit Rates: $lib_hr% Lib -- $buf_hr% Buff" > > exit $STATE_OK > ;; >--tablespace) > if [ ${6} -lt ${7} ] ; then > echo "UNKNOWN - Warning level is more then Crit" > exit $STATE_UNKNOWN > fi > result=`sqlplus -s ${3}/${4}@${2} << EOF >set pagesize 0 >select b.free,a.total,100 - trunc(b.free/a.total * 1000) / 10 prc >from ( >select tablespace_name,sum(bytes)/1024/1024 total >from dba_data_files group by tablespace_name) A, >( select tablespace_name,sum(bytes)/1024/1024 free >from dba_free_space group by tablespace_name) B >where a.tablespace_name=b.tablespace_name and a.tablespace_name='${5}'; >EOF` > > if [ -n "`echo $result | grep ORA-`" ] ; then > error=` echo "$result" | grep "ORA-" | head -1` > echo "CRITICAL - $error" > exit $STATE_CRITICAL > fi > > ts_free=`echo $result | awk '{print int($1)}'` > ts_total=`echo $result | awk '{print int($2)}'` > ts_pct=`echo $result | awk '{print int($3)}'` > if [ $ts_free -eq 0 -a $ts_total -eq 0 -a $ts_pct -eq 0 ] ; then > echo "No data returned by Oracle - tablespace $5 not found?" > exit $STATE_UNKNOWN > fi > if [ $ts_pct -ge ${6} ] ; then > echo "${2} : ${5} CRITICAL - $ts_pct% used [ $ts_free / $ts_total MB available ]" > exit $STATE_CRITICAL > fi > if [ $ts_pct -ge ${7} ] ; then > echo "${2} : ${5} WARNING - $ts_pct% used [ $ts_free / $ts_total MB available ]" > exit $STATE_WARNING > fi > echo "${2} : ${5} OK - $ts_pct% used [ $ts_free / $ts_total MB available ]" > exit $STATE_OK > ;; >*) > print_usage > exit $STATE_UNKNOWN >esac > > -- ********************************** VERDON Carole Ing?nieur Syst?me CICT - Universit? Paul Sabatier 118, route de Narbonne 31062 Toulouse Cedex T?l.: 05.61.36.60.44 Fax: 05.61.52.14.58 Mail: verdon at cict.fr ********************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle.sh Type: application/x-sh Size: 7660 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle_databases.sh Type: application/x-sh Size: 2119 bytes Desc: not available URL: From verdon at cict.fr Tue Jun 8 08:15:05 2004 From: verdon at cict.fr (carole verdon) Date: Tue Jun 8 08:15:05 2004 Subject: [Nagiosplug-devel] PB with NRPE: No output returned from plugin Message-ID: <40C5D79F.7020609@cict.fr> Hi, In web interface of nagios (v 1.2), i obtain a status UNKNOWN with this message: (No output returned from plugin) If i execute the check_nrpe (v 2.0) in line command on server nagios, it works well: $ ./check_nrpe_nossl -H telline.cict.fr -c check_oracle all databases OK check_oracle is defined in nrpe.cfg as: command[check_oracle]=/usr/local/nagios/libexec/check_oracle_databases.sh the check_oracle_databases.sh is a script i wrote to take dynamically into account the file /etc/oratab to verify all databases that it contains. It calls the check_oracle scripts of core distribution of nagios-plugins-1.4.0alpha1 that i modified a little. I use NagMin 2.1.0 to configure nagios. So i define a service called "Oracle" with the check command : check_nrpe_nossl!check_oracle In service.cfg: define service { use generic-service host_name telline.cict.fr service_description Oracle contact_groups nagios-admins check_period 24x7 notification_interval 2880 notification_options w,u,c,r notification_period 24x7 check_command check_nrpe_nossl!check_oracle max_check_attempts 3 normal_check_interval 10 retry_check_interval 1 } I don't understand why it works in line commands on nagios server and that it don't work if i define this service in nagios. Can you tell me where is the error? What am i doing? Please, help me.... Thanks. Carole. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle.sh Type: application/x-sh Size: 7661 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: check_oracle_databases.sh Type: application/x-sh Size: 2120 bytes Desc: not available URL: From grosen at cc3.com Tue Jun 8 14:06:25 2004 From: grosen at cc3.com (gabriel rosenkoetter) Date: Tue Jun 8 14:06:25 2004 Subject: [Nagiosplug-devel] Trouble with check_by_ssh and Sun's SSH. Message-ID: <20040608205406.GA11231@cc3.com> [My apologies if this post appears twice. I *think* that Mailman on sourceforge is choking on my envelope address not matching my subscription--and functional email--address.] I seem to be having the same problem described by Patrick Walentiny here: http://sourceforge.net/mailarchive/message.php?msg_id=6714332 I can confirm that this happens only when running check_by_ssh against Sun's localized OpenSSH port that ships with Solaris 9. This announces itself as "SSH-2.0-Sun_SSH_1.0" on the wire. The relevant Sun packages are: system SUNWsshcu SSH Common, (Usr) system SUNWsshdr SSH Server, (Root) system SUNWsshdu SSH Server, (Usr) system SUNWsshr SSH Client and utilities, (Root) system SUNWsshu SSH Client and utilities, (Usr) The only relevant Sun patch that I seem to have is 113273-04, for the SUNWsshdu package. I'm executing this checkcommand: define command { command_name check_remote_disk command_line $USER1$/check_by_ssh -l nagios -i $USER2$/check_disk -H $HOSTADDRESS$ -C 'echo' } On the remote host, I have an SSH public key in ~nagios/.ssh/authorized_keys with: command="/usr/local/nagios/libexec/check_disk -w 10% -c 5% -l" ssh-dss [...] When I run check_by_ssh by hand and then echo $?, it invariable returns 0, but Nagios persists in producing output like this: --- Notification Type: PROBLEM Host: delta Service: disk usage - Unix Address: x.y.z.67 State: UNKNOWN Date/Time: Tue Jun 8 13:58:10 EDT 2004 Additional Info: DISK OK - free space: / 2961 MB (74%): /usr 9029 MB (89%): /var 4775 MB (95%): /var/run 1942 MB (100%): /tmp 1942 MB (99%): /opt 8474 MB (84%): /export/home 19878 MB (99%): /xy/moe/A 195575 MB (36%): --- This would seem to be inherently contradictory to me. I shouldn't be getting the "DISK OK" unless check_disk had returned a 0 exit code, which should be passed by sshd to check_by_ssh, which should then return this. I would be blaming Solaris here... if I didn't get exactly what I expected when I try to execute this same command on the system running the Nagios daemon: jedi:~# /usr/local/nagios/libexec/check_by_ssh -l nagios -i /etc/nagios/ssh-keys/check_disk -H delta -C 'echo' && echo "returned: $?" DISK OK - free space: / 2961 MB (74%); /usr 9029 MB (89%); /var 4775 MB (95%); /var/run 1923 MB (100%); /tmp 1923 MB (99%); /opt 8474 MB (84%); /export/home 19878 MB (99%); /xy/moe/A 195575 MB (36%);| /=2961MB;3624;3825;0;4027 /usr=9028MB;9079;9583;0;10088 /var=4775MB;4539;4791;0;5044 /var/run=1923MB;1730;1826;0;1923 /tmp=1923MB;1748;1845;0;1943 /opt=8473MB;9079;9583;0;10088 /export/home=19877MB;18155;19164;0;20173 /xy/moe/A=195575MB;483192;510036;0;536880 returned: 0 I am conscious of this reply: http://sourceforge.net/mailarchive/message.php?msg_id=6714335 but Meg seems to have misunderstood the problem. The issue is not that we're seeing false positives (OK--return code 0--returned when the service is not okay) but false negatives (UNKNOWN--return code 3--returned when the service IS okay, and even has returned the string saying it's okay). Has anyone figured out what's broken about Sun's SSH or the check_by_ssh plugin's interpretations of its replies that causes this? -- gabriel rosenkoetter Transcontinental CC3 Unix & Linux sysadmin grosen at cc3.com From ae at op5.se Tue Jun 8 14:37:07 2004 From: ae at op5.se (Andreas Ericsson) Date: Tue Jun 8 14:37:07 2004 Subject: [Nagiosplug-devel] check_icmp Message-ID: <40C62E34.2000005@op5.se> Ahoy all. I found a couple of small but irritating bugs in the check_icmp plugin I myself happen to maintain. ;-) It works a whole lot faster now, since it doesn't sit around and wait for the maximum rta threshold to timeout when it has received all its packets. Anyways... here's the source for it. There's no configure-script. Just run 'make' on any can with glibc 2.0 or above and it should work like a charm. Most of it is ANSI C, so I'm thinking it should compile cleanly even on a windows platform (with djgpp it might, anyways). -- Andreas Ericsson OP5 AB +46 (0)733 709032 andreas.ericsson at op5.se -------------- next part -------------- A non-text attachment was scrubbed... Name: check_icmp-0.4.tar.gz Type: application/gzip Size: 14090 bytes Desc: not available URL: From grosen at cc3.com Tue Jun 8 15:32:03 2004 From: grosen at cc3.com (gabriel rosenkoetter) Date: Tue Jun 8 15:32:03 2004 Subject: [Nagiosplug-devel] Trouble with check_by_ssh and Sun's SSH. Message-ID: <20040608204940.GR22140@cc3.com> I seem to be having the same problem described by Patrick Walentiny here: http://sourceforge.net/mailarchive/message.php?msg_id=6714332 I can confirm that this happens only when running check_by_ssh against Sun's localized OpenSSH port that ships with Solaris 9. This announces itself as "SSH-2.0-Sun_SSH_1.0" on the wire. The relevant Sun packages are: system SUNWsshcu SSH Common, (Usr) system SUNWsshdr SSH Server, (Root) system SUNWsshdu SSH Server, (Usr) system SUNWsshr SSH Client and utilities, (Root) system SUNWsshu SSH Client and utilities, (Usr) The only relevant Sun patch that I seem to have is 113273-04, for the SUNWsshdu package. I'm executing this checkcommand: define command { command_name check_remote_disk command_line $USER1$/check_by_ssh -l nagios -i $USER2$/check_disk -H $HOSTADDRESS$ -C 'echo' } On the remote host, I have an SSH public key in ~nagios/.ssh/authorized_keys with: command="/usr/local/nagios/libexec/check_disk -w 10% -c 5% -l" ssh-dss [...] When I run check_by_ssh by hand and then echo $?, it invariable returns 0, but Nagios persists in producing output like this: --- Notification Type: PROBLEM Host: delta Service: disk usage - Unix Address: x.y.z.67 State: UNKNOWN Date/Time: Tue Jun 8 13:58:10 EDT 2004 Additional Info: DISK OK - free space: / 2961 MB (74%): /usr 9029 MB (89%): /var 4775 MB (95%): /var/run 1942 MB (100%): /tmp 1942 MB (99%): /opt 8474 MB (84%): /export/home 19878 MB (99%): /xy/moe/A 195575 MB (36%): --- This would seem to be inherently contradictory to me. I shouldn't be getting the "DISK OK" unless check_disk had returned a 0 exit code, which should be passed by sshd to check_by_ssh, which should then return this. I would be blaming Solaris here... if I didn't get exactly what I expected when I try to execute this same command on the system running the Nagios daemon: jedi:~# /usr/local/nagios/libexec/check_by_ssh -l nagios -i /etc/nagios/ssh-keys/check_disk -H delta -C 'echo' && echo "returned: $?" DISK OK - free space: / 2961 MB (74%); /usr 9029 MB (89%); /var 4775 MB (95%); /var/run 1923 MB (100%); /tmp 1923 MB (99%); /opt 8474 MB (84%); /export/home 19878 MB (99%); /xy/moe/A 195575 MB (36%);| /=2961MB;3624;3825;0;4027 /usr=9028MB;9079;9583;0;10088 /var=4775MB;4539;4791;0;5044 /var/run=1923MB;1730;1826;0;1923 /tmp=1923MB;1748;1845;0;1943 /opt=8473MB;9079;9583;0;10088 /export/home=19877MB;18155;19164;0;20173 /xy/moe/A=195575MB;483192;510036;0;536880 returned: 0 I am conscious of this reply: http://sourceforge.net/mailarchive/message.php?msg_id=6714335 but Meg seems to have misunderstood the problem. The issue is not that we're seeing false positives (OK--return code 0--returned when the service is not okay) but false negatives (UNKNOWN--return code 3--returned when the service IS okay, and even has returned the string saying it's okay). Has anyone figured out what's broken about Sun's SSH or the check_by_ssh plugin's interpretations of its replies that causes this? -- gabriel rosenkoetter Transcontinental CC3 Unix & Linux sysadmin grosen at cc3.com From drw at adnc.com Tue Jun 8 22:22:09 2004 From: drw at adnc.com (Dan) Date: Tue Jun 8 22:22:09 2004 Subject: [Nagiosplug-devel] Checking printer ink levels Message-ID: <6.0.0.22.2.20040608221416.021c7120@mail.adnc.com> I've thrown together a nice easy to use perl script for use with nagios that is able to check printers for their supply levels. If anybody is interested in it I'll finish it up(add features like help and debug) and post it. It currently supports only a couple of different types of printers and uses SNMP. HP printers supported: LaserJet 2300 Deskjet cp1160 Business Inkjet 3000 Panasonic printers supported: CL-21 (almost done) Just as with other pluggins you can set your own warning and critical values. if you printers not on the list I've written this so others can be added in a few minutes using what's there as an example. -Dan From verdon at cict.fr Wed Jun 9 08:16:16 2004 From: verdon at cict.fr (carole verdon) Date: Wed Jun 9 08:16:16 2004 Subject: [Nagiosplug-devel] RESOLVED Re: PB with NRPE: No output returned from plugin In-Reply-To: <40C58DD7.3080407@cict.fr> References: <40C58DD7.3080407@cict.fr> Message-ID: <40C72940.3080805@cict.fr> Hi all, I finally find a solution of my problem. In fact the check_command "check_nrpe_nossl" was defined in Commands table of NagMin to accept arguments: $USER1$/check_nrpe_nossl -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$ $ARG13$ However, my script doesn't call upon the arguments. So I create a new command, that i called "check_nrpe_nossl_noarg", defined as this: $USER1$/check_nrpe_nossl -H $HOSTADDRESS$ -c $ARG1$ Now, it works fine. Carole. carole verdon wrote: >Hi, > >In web interface of nagios (v 1.2), i obtain a status UNKNOWN with this message: (No output returned from plugin) > >If i execute the check_nrpe (v 2.0) in line command on server nagios, it works well: >$ ./check_nrpe_nossl -H telline.cict.fr -c check_oracle >all databases OK > >check_oracle is defined in nrpe.cfg as: >command[check_oracle]=/usr/local/nagios/libexec/check_oracle_databases.sh > >the check_oracle_databases.sh is a script i wrote to take dynamically into account the file /etc/oratab to verify all databases >that it contains. It calls the check_oracle scripts of core distribution of nagios-plugins-1.4.0alpha1 that i modified a little. > >I use NagMin 2.1.0 to configure nagios. So i define a service called "Oracle" with the check command : check_nrpe_nossl!check_oracle > >In service.cfg: >define service { > use generic-service > host_name telline.cict.fr > service_description Oracle > contact_groups nagios-admins > check_period 24x7 > notification_interval 2880 > notification_options w,u,c,r > notification_period 24x7 > check_command check_nrpe_nossl!check_oracle > max_check_attempts 3 > normal_check_interval 10 > retry_check_interval 1 >} > > >I don't understand why it works in line commands on nagios server and that it don't work if i define this service in nagios. > >Can you tell me where is the error? What am i doing? > >Please, help me.... > >Thanks. > >Carole. > > > -- ********************************** VERDON Carole Ing?nieur Syst?me CICT - Universit? Paul Sabatier 118, route de Narbonne 31062 Toulouse Cedex T?l.: 05.61.36.60.44 Fax: 05.61.52.14.58 Mail: verdon at cict.fr ********************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From verdon at cict.fr Wed Jun 9 08:34:01 2004 From: verdon at cict.fr (carole verdon) Date: Wed Jun 9 08:34:01 2004 Subject: [Nagiosplug-devel] Bug in check_oracle.sh Message-ID: <40C72D80.7040207@cict.fr> Hi, I would indicate that there is a bug in check_oracle.sh line 161: --db) pmonchk=`ps -ef | grep -v grep | grep ${2} | grep -c pmon` In my case, in /etc/oratab, there is 2 databases called "etu92" et "etu923". The database "etu92" is active while "etu923" is no active. When i execute the check_oracle with the sid "etu92", it find that there is 1 PMON process running. In fact, it takes into account the process that corresponding to the sid "etu923". To solve this problem, it is enough to correct the line that calls the 'ps' command by: pmonchk=`ps -ef | grep -v grep | grep ${2}$ | grep -c pmon` I hope that will be corrected in the next version of the plugins. Carole. From gary at hekal.org Fri Jun 11 08:34:00 2004 From: gary at hekal.org (Gary Danko) Date: Fri Jun 11 08:34:00 2004 Subject: [Nagiosplug-devel] check_memory plugin Message-ID: <40C9D0A7.1050601@hekal.org> Hi all, After using the memory checking feature of the check_nt plugin, I wanted to create something similar for my Linux machines. So I wrote something in Perl to check memory and report on it. This plugin relies on the Linux "free" command so unfortunately it's currently limited to Linux machines... until I can find a better way to gather memory usage stats. Command usage is: Usage: check_memory -t [physical|swap|total] -w limit -c limit check_memory [-v|--version] check_memory [-h|--help] Output looks like this: [root at mandrake libexec]# ./check_memory --type=swap --warn=50 --crit=10 Swap Memory OK: Total: 1019.71 MB - Used: 0.95 MB (0%) - Free: 1018.77 MB (100%) [root at mandrake libexec]# ./check_memory --type=physical --warn=50 --crit=10 Physical Memory CRITICAL: Total: 501.83 MB - Used: 485.27 MB (97%) - Free: 16.12 MB (3%) [root at mandrake libexec]# ./check_memory --type=total --warn=50 --crit=10 Total Memory OK: Total: 1521.54 MB - Used: 486.14 MB (32%) - Free: 1035.40 MB (68%) This is my first real plugin for Nagios and I do not know how to submit it. What can I do to make it available for others? Thanks :) Gary From noreply at sourceforge.net Sun Jun 13 16:07:04 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Jun 13 16:07:04 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-972318 ] new(?) plugin check_cluster_mysql Message-ID: Patches item #972318, was opened at 2004-06-14 09:06 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=972318&group_id=29880 Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ian Holsman (webperf) Assigned to: Nobody/Anonymous (nobody) Summary: new(?) plugin check_cluster_mysql Initial Comment: code is available here: http://svn.webperf.org/WebSVN/filedetails.php?rep=0&path=trunk/plugins/check_cluster_mysql.pl&rev=0&sc=1 This plugin is identical in function to check_cluster, but it uses the service_status table in a mysql database. you need 2 other tables for it to work. hostgroup (hostgroup_id, hostgroup_name) and hostgroup_member( hostgroup_id, host_name) where hostgroup contains the name of the hostgroup, and hostgroup member contains the host's which belong to the hostgroup. I can provide the MySQL schema for the creation of these 2 tables if required Regards Ian ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=972318&group_id=29880 From serwah_s_gh at yahoo.com Sun Jun 13 22:22:03 2004 From: serwah_s_gh at yahoo.com (serwah sabet ghadam) Date: Sun Jun 13 22:22:03 2004 Subject: [Nagiosplug-devel] memory load & cpu fan speed Message-ID: <20040614051640.83299.qmail@web52304.mail.yahoo.com> Hi fellows, I've searched this mailing list archive but didn't find any about plugins about memory load and cpu fan speed. I appreciate your help. Sirwah --------------------------------- Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger -------------- next part -------------- An HTML attachment was scrubbed... URL: From GWCOOK at mactec.com Wed Jun 16 07:29:08 2004 From: GWCOOK at mactec.com (Cook, Garry) Date: Wed Jun 16 07:29:08 2004 Subject: [Nagiosplug-devel] Check_ifstatus patch Message-ID: <41FD7929498A174DAB86C45F28E0EC0D6E9285@golden-m.mactec.com> The check_ifstatus patch seems to output Performance Data incorrectly. I've patched it and included the patch below. For future reference, please let me know if I should submit this somewhere on sf.net, or if sending to the list is ok. Thanks. *** check_ifstatus.orig 2004-06-16 08:11:54.000000000 -0600 --- check_ifstatus 2004-06-16 08:12:31.000000000 -0600 *************** *** 207,213 **** $ifexclude, $ifunused); } ! my $perfdata = sprintf("up:%d,down:%d,dormant:%d,excluded:%d,unused:%d",$ifup,$ifdown,$ ifdormant,$ifexclude,$ifunused); print ("$state: $answer |$perfdata\n"); exit $ERRORS{$state}; --- 207,213 ---- $ifexclude, $ifunused); } ! my $perfdata = sprintf("up=%d,down=%d,dormant=%d,excluded=%d,unused=%d",$ifup,$ifdown,$ ifdormant,$ifexclude,$ifunused); print ("$state: $answer |$perfdata\n"); exit $ERRORS{$state}; Garry W. Cook, CCNA Network Infrastructure Manager MACTEC, Inc. - http://www.mactec.com/ 303.308.6228 (Office) - 720.220.1862 (Mobile) From GWCOOK at mactec.com Wed Jun 16 08:38:04 2004 From: GWCOOK at mactec.com (Cook, Garry) Date: Wed Jun 16 08:38:04 2004 Subject: [Nagiosplug-devel] RE: [Perfparse-users] Check_ifstatus patch Message-ID: <41FD7929498A174DAB86C45F28E0EC0D6E928C@golden-m.mactec.com> perfparse-users-admin at lists.sourceforge.net wrote: > The check_ifstatus patch seems to output Performance Data incorrectly. > I've patched it and included the patch below. For future reference, > please let me know if I should submit this somewhere on sf.net, or if > sending to the list is ok. Thanks. > > *** check_ifstatus.orig 2004-06-16 08:11:54.000000000 -0600 > --- check_ifstatus 2004-06-16 08:12:31.000000000 -0600 > *************** > *** 207,213 **** > $ifexclude, > $ifunused); > } > ! my $perfdata = > sprintf("up:%d,down:%d,dormant:%d,excluded:%d,unused:%d",$ifup > ,$ifdown,$ ifdormant,$ifexclude,$ifunused); > print ("$state: $answer |$perfdata\n"); > exit $ERRORS{$state}; > > --- 207,213 ---- > $ifexclude, > $ifunused); > } > ! my $perfdata = > sprintf("up=%d,down=%d,dormant=%d,excluded=%d,unused=%d",$ifup > ,$ifdown,$ ifdormant,$ifexclude,$ifunused); > print ("$state: $answer |$perfdata\n"); > exit $ERRORS{$state}; Looks like I was somewhat overzealous, and did not do enough testing. While the patch above does allow Nagios to process the performance data from the check_ifstatus plugin, the $PERFDATA output is still not formatted correctly. I'll look at it again when I have some more time, although I'm going to have to study up on the output method first, so it may take me a while. Garry W. Cook, CCNA Network Infrastructure Manager MACTEC, Inc. - http://www.mactec.com/ 303.308.6228 (Office) - 720.220.1862 (Mobile) From noreply at sourceforge.net Fri Jun 18 11:01:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Jun 18 11:01:51 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-975510 ] check_ink Message-ID: New Plugins item #975510, was opened at 2004-06-18 17:58 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: drew_92123 (drew_92123) Assigned to: Nobody/Anonymous (nobody) Summary: check_ink Initial Comment: Checks the remaining ink for specific printers. I was tired of using check_snmp to get the same data, this is much easier, at least for me..... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 From noreply at sourceforge.net Fri Jun 18 19:12:04 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Jun 18 19:12:04 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-975720 ] Monitors physical, swap, or total memory Message-ID: New Plugins item #975720, was opened at 2004-06-18 19:11 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975720&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: Gary Danko (gdanko) Assigned to: Nobody/Anonymous (nobody) Summary: Monitors physical, swap, or total memory Initial Comment: This Perl plugin will monitor and report on physical, swap, or total (physical + swap) memory. Here's the info from the help switch: The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute copies of the plugins under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. Copyright (c) 2004 Gary Danko Perl Check Memory plugin for Nagios Usage: check_memory -t [physical|swap|total] -w limit -c limit check_memory [-v|--version] check_memory [-h|--help] Required Arguments: -t, --type=[physical|swap|total] Measure either physical, swap, or total (physical + swap) memory (Default: Total) -w, --warning=PERCENT Exit with WARNING status is less than PERCENT of total memory is free (Default: 30%) -c, --critical=PERCENT Exit with CRITICAL status is less than PERCENT of total memory is free (Default: 10%) Example: check_memory --type=physical --warning=50 --critical=25 Send email to nagios-users at lists.sourceforge.net if you have questions regarding use of this software. To submit patches or suggest improvements, send email to nagiosplug-devel at lists.sourceforge.net And the output is pretty simple: [root at mandrake libexec]# ./check_memory Total Memory OK: Total: 1558.06 MB - Used: 414.18 MB (27%) - Free: 1143.88 MB (73%) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975720&group_id=29880 From wasik at broumovska.lbcfree.net Sat Jun 19 09:38:01 2004 From: wasik at broumovska.lbcfree.net (wasik) Date: Sat Jun 19 09:38:01 2004 Subject: [Nagiosplug-devel] Check_ping Message-ID: <20040619163719.GA17710@broumovska.lbcfree.net> Hello, I am using Nagios on Slackware 9.1 and Mandrake 10.0 and I found that check_ping plugin does not correctly recognize ping statistics under certain conditions (when there are errors present). I have made a simple patch for that. I have also noticed that ping on these systems does not write anything to STDERR where check_ping expects to have error messages, so check_ping does not detect "Host unreachable" and similar. Thanks for help, Jan Wasserbauer -------------- next part -------------- --- nagios-plugins-1.3.1/plugins/check_ping.c 2003-01-13 13:15:16.000000000 +0100 +++ nagios-plugins-1.3.1.mod/plugins/check_ping.c 2004-06-19 18:06:19.121931182 +0200 @@ -386,6 +386,8 @@ if (sscanf (input_buffer, "%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss", &pl) == 1 + || sscanf + (input_buffer, "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss, time", &pl) == 1 || sscanf (input_buffer, "%*d packets transmitted, %*d packets received, %d%% packet loss", &pl) == 1 From noreply at sourceforge.net Tue Jun 22 10:49:26 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Jun 22 10:49:26 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-778477 ] check_frontpage Message-ID: New Plugins item #778477, was opened at 2003-07-27 15:46 Message generated for change (Comment added) made by kyrian You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=778477&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kev Green (kyrian) Assigned to: Nobody/Anonymous (nobody) Summary: check_frontpage Initial Comment: In anger at that particular bane of unix sysadmins lives, or perhaps my own willingness to install it, the other day I wrote a nagios plugin to monitor whether frontpage appeared to be working on a given site. Do with it as you will, but I accept no responsibility for its failing to allow you to sleep soundly at night, save you from tearing your hair out, etc. Obviously FrontPage remains a trademark/copyright/whatever of Microsoft, and the fact that this plugin has ever proved necessary as a result of various misconfigurations and website migrations from server to server is not intended as any kind of indicator for or against the quality of Microsoft's software. ---------------------------------------------------------------------- >Comment By: Kev Green (kyrian) Date: 2004-06-22 18:48 Message: Logged In: YES user_id=99923 Just a bit more verbose. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=778477&group_id=29880 From noreply at sourceforge.net Tue Jun 22 10:49:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Jun 22 10:49:32 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-778477 ] check_frontpage Message-ID: New Plugins item #778477, was opened at 2003-07-27 15:46 Message generated for change (Comment added) made by kyrian You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=778477&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kev Green (kyrian) Assigned to: Nobody/Anonymous (nobody) Summary: check_frontpage Initial Comment: In anger at that particular bane of unix sysadmins lives, or perhaps my own willingness to install it, the other day I wrote a nagios plugin to monitor whether frontpage appeared to be working on a given site. Do with it as you will, but I accept no responsibility for its failing to allow you to sleep soundly at night, save you from tearing your hair out, etc. Obviously FrontPage remains a trademark/copyright/whatever of Microsoft, and the fact that this plugin has ever proved necessary as a result of various misconfigurations and website migrations from server to server is not intended as any kind of indicator for or against the quality of Microsoft's software. ---------------------------------------------------------------------- >Comment By: Kev Green (kyrian) Date: 2004-06-22 18:48 Message: Logged In: YES user_id=99923 Just a bit more verbose. ---------------------------------------------------------------------- Comment By: Kev Green (kyrian) Date: 2004-06-22 18:48 Message: Logged In: YES user_id=99923 Just a bit more verbose. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=778477&group_id=29880 From noreply at sourceforge.net Wed Jun 23 17:18:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jun 23 17:18:02 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-714625 ] new plugin: checking Compaq Smart Array Controllers Message-ID: New Plugins item #714625, was opened at 2003-04-03 08:16 Message generated for change (Comment added) made by recentcoin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=714625&group_id=29880 Category: System monitor Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guenther Mair (gunnyst) Assigned to: Nobody/Anonymous (nobody) Summary: new plugin: checking Compaq Smart Array Controllers Initial Comment: this plugin checks status from various older Compaq Smart Array Controllers - most of them still in use today most of this work is based on the source from cpqarrad- 1.3 by Hugo Trippaers it will be most usefull togehter with check_nrpe I'm looking for someone with knowledge about newer Smart Array Controllers and eventually some details about HP/Compaq's "health driver" - this would be a real fine thing to have integrated without "blind" snmp binaries ---------------------------------------------------------------------- Comment By: recentcoin (recentcoin) Date: 2004-06-23 19:15 Message: Logged In: YES user_id=992761 I know that compaq installes their own agent (SmartStart stuff) and their own MIBS in order to do the health checks on the drives and the controller. I have the Compaq MIB's if that will be of any assistance to you. I also have a lot of Sun, Cisco, etc. MIBS if anyone here needs them to aid in driver development. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=714625&group_id=29880 From noreply at sourceforge.net Wed Jun 23 23:06:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jun 23 23:06:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-714625 ] new plugin: checking Compaq Smart Array Controllers Message-ID: New Plugins item #714625, was opened at 2003-04-03 14:16 Message generated for change (Comment added) made by gunnyst You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=714625&group_id=29880 Category: System monitor Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guenther Mair (gunnyst) Assigned to: Nobody/Anonymous (nobody) Summary: new plugin: checking Compaq Smart Array Controllers Initial Comment: this plugin checks status from various older Compaq Smart Array Controllers - most of them still in use today most of this work is based on the source from cpqarrad- 1.3 by Hugo Trippaers it will be most usefull togehter with check_nrpe I'm looking for someone with knowledge about newer Smart Array Controllers and eventually some details about HP/Compaq's "health driver" - this would be a real fine thing to have integrated without "blind" snmp binaries ---------------------------------------------------------------------- >Comment By: Guenther Mair (gunnyst) Date: 2004-06-24 06:05 Message: Logged In: YES user_id=748821 hi recentcoin correct, Compaq has their own agents, but they expect you to install lot's of different agents and tolls and snmp and so on which (at least I do think so) noone needs nor want's what I'm looking for is something really small (at the best 100- 200 kb) which connect's to the SA hardware through the cciss interface; if it can do more like reading information about cpu and fan states, that would be fine but not required compaq/hp agents also pretend you to install redhat/suse servers which is quite a limited choice and even if it works i'm not so pleased with doing workarounds to have it running on debian ---------------------------------------------------------------------- Comment By: recentcoin (recentcoin) Date: 2004-06-24 00:15 Message: Logged In: YES user_id=992761 I know that compaq installes their own agent (SmartStart stuff) and their own MIBS in order to do the health checks on the drives and the controller. I have the Compaq MIB's if that will be of any assistance to you. I also have a lot of Sun, Cisco, etc. MIBS if anyone here needs them to aid in driver development. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=714625&group_id=29880 From noreply at sourceforge.net Thu Jun 24 13:22:04 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jun 24 13:22:04 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-975510 ] check_ink Message-ID: New Plugins item #975510, was opened at 2004-06-18 17:58 Message generated for change (Comment added) made by drew_92123 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: drew_92123 (drew_92123) Assigned to: Nobody/Anonymous (nobody) Summary: check_ink Initial Comment: Checks the remaining ink for specific printers. I was tired of using check_snmp to get the same data, this is much easier, at least for me..... ---------------------------------------------------------------------- >Comment By: drew_92123 (drew_92123) Date: 2004-06-24 20:21 Message: Logged In: YES user_id=1059775 Currently able to get proper readings from: Business Inkjet 3000 LaserJet 2300 cp1160 Can be easily made to work with other printers.... :-) Enjoy! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 From noreply at sourceforge.net Thu Jun 24 13:22:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jun 24 13:22:06 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-975510 ] check_ink Message-ID: New Plugins item #975510, was opened at 2004-06-18 17:58 Message generated for change (Comment added) made by drew_92123 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: drew_92123 (drew_92123) Assigned to: Nobody/Anonymous (nobody) Summary: check_ink Initial Comment: Checks the remaining ink for specific printers. I was tired of using check_snmp to get the same data, this is much easier, at least for me..... ---------------------------------------------------------------------- >Comment By: drew_92123 (drew_92123) Date: 2004-06-24 20:21 Message: Logged In: YES user_id=1059775 Currently able to get proper readings from: Business Inkjet 3000 LaserJet 2300 cp1160 Can be easily made to work with other printers.... :-) Enjoy! ---------------------------------------------------------------------- Comment By: drew_92123 (drew_92123) Date: 2004-06-24 20:21 Message: Logged In: YES user_id=1059775 Currently able to get proper readings from: Business Inkjet 3000 LaserJet 2300 cp1160 Can be easily made to work with other printers.... :-) Enjoy! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=975510&group_id=29880 From noreply at sourceforge.net Thu Jun 24 15:18:03 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jun 24 15:18:03 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-979313 ] check_disk 1.4.0_alpha perfdata problem Message-ID: Bugs item #979313, was opened at 2004-06-24 16:17 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=979313&group_id=29880 Category: Argument proccessing Group: Release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Garry W. Cook (g_force) Assigned to: Nobody/Anonymous (nobody) Summary: check_disk 1.4.0_alpha perfdata problem Initial Comment: check_disk in 1.4.0_alpha and the CVS HEAD from 20040116 both seem to contain the same check_disk.c from March of this year. The problem I'm having is with the performance data output, the warning and critical thresholds do not seem to be calculated properly. When checking a 100MB disk for % free space with warning at 30% and critical at 10%, if the disk is 25% full, the check works fine and no alerts are generated. However, the performance data will report the free space at 75MB (75%-correct), the warning threshold at 70MB (70%-incorrect), and the critical threshold at 90MB (90%-incorrect). The performance data from this check would then be considered to be at a 'warning' level. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=979313&group_id=29880 From noreply at sourceforge.net Mon Jun 28 06:40:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Jun 28 06:40:06 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-981253 ] Patch for is_hostname in utils.c Message-ID: Patches item #981253, was opened at 2004-06-28 15:39 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=981253&group_id=29880 Category: Bugfix Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guido Trotter (ultrotter) Assigned to: Nobody/Anonymous (nobody) Summary: Patch for is_hostname in utils.c Initial Comment: As an hostname is now allowed to begin with a digit so shall be a hostname component: es: ns.2way.de This patch fixes the problem (present in 1.3.1, I've not checked later versions) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=981253&group_id=29880 From verdon at cict.fr Mon Jun 28 08:50:06 2004 From: verdon at cict.fr (carole verdon) Date: Mon Jun 28 08:50:06 2004 Subject: [Nagiosplug-devel] Bug in check_smtp Message-ID: <40E03DB3.4010403@cict.fr> Hi, I think that there is a bug in plugin check_smtp. When i want to verify that this plugin works well and so i execute it on a host that doesn't have got this service implemented, i obtain this result: ./check_smtp -H vae.cict.fr Segmentation Fault(coredump) If the host has got smtp service that works, then i obtain the good result: $ ./check_smtp coque.cict.fr SMTP OK - 0.012 sec. response time|time=11876us;;;0 Can someone tell me why that arrives? Thanks for your help for advance. Carole. From noreply at sourceforge.net Wed Jun 30 19:04:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jun 30 19:04:06 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-946857 ] check_ping - output error Message-ID: Bugs item #946857, was opened at 2004-05-03 06:05 Message generated for change (Comment added) made by alex_b You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880 Category: Argument proccessing Group: Release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Pumuckel1980 (pumuckel1980) Assigned to: Nobody/Anonymous (nobody) Summary: check_ping - output error Initial Comment: Hello, I have some problems with the "nagios-plugins- 1.4.0alpha1". In this Version the check_ping plugin show me the following result: "bin/ping -n -U -c 1 ntest2ext Error: Could not interpret output from ping command" It's OK when I use the "nagios-plugins-1.3.1.tar.gz". ./check_ping -H ntest2ext -w 3000.0,80% -c 5000.0,100% -p 1 PING OK - Packet loss = 0%, RTA = 0.22 ms PING OK - Packet loss = 0%, RTA = 0.46 ms Here are my differnet settings: 1. nagios-plugins-1.3.1.tar.gz ############################## = uname -a "Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 15:21:08 CET 2003 i686 i686 i386 GNU/Linux" =./check_ping -H *HOSTNAME* -w 3000.0,80% -c 5000.0,100% -p 1 "PING OK - Packet loss = 0%, RTA = 0.22 ms PING OK - Packet loss = 0%, RTA = 0.48 ms" 2. "nagios-plugins-1.4.0alpha1" ############################## = uname -a "Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 1:21:08 CET 2003 i686 i686 i386 GNU/Linux" =./check_ping -H ntest2ext -w 3000.0,80% -c 5000.0,100% -p 1 "/bin/ping -n -U -c 1 ntest2ext Error: Could not interpret output from ping command" thanks for help bye ---------------------------------------------------------------------- Comment By: Alex Burger (alex_b) Date: 2004-06-30 22:03 Message: Logged In: YES user_id=85836 I am using Nagios-1.2 with nagios-plugins-1.3.1 and I am having a similar problem. On my Mandrake 9.2 system, host notifications for DOWN are showing the command line instead of the plugin output although the output for UP is correct. For example: [1088427108] HOST ALERT: server01;DOWN;SOFT;1;/bin/ping -n -U -c 1 server01 [1088427135] HOST NOTIFICATION: alex;server01;DOWN;host-notify-by-email;/bin/ping -n -U -c 1 server01 [1088427305] HOST NOTIFICATION: alex;server01;UP;host-notify-by-email;PING OK - Packet loss = 0%, RTA = 0.28 ms The host is using 'check-host-alive' which uses the following command line: /usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 It looks like check_ping is expecting the 'From 10.36.39.219 icmp_seq=1 Destination Host Unreachable' message to be sent to STDERR from ping, but on my system it goes to STDOUT. To test, I created a script that outputs to STDERR a ping result, and changed check_ping to call my script instead: #!/usr/bin/perl select STDERR; print "From 192.168.1.1 icmp_seq=1 Destination Host Unreachable\n"; print "\n"; print "--- 192.168.1.1 ping statistics ---\n"; print "echo 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms\n"; Calling check_ping, I get the correct output: PING CRITICAL - Host Unreachable If I changed the script by removing 'select STDERR', I get: Error: Could not interpret output from ping command Looking at the source code, if it can not interpret the output it outputs the command that was executed instead, for troubleshooting purposes I assume. Alex ---------------------------------------------------------------------- Comment By: Pumuckel1980 (pumuckel1980) Date: 2004-05-03 08:18 Message: Logged In: YES user_id=1034118 added: here is the output of the ping command: [root at pb3 nagios-plugins-1.4.0alpha1]# /bin/ping -n -U -c 1 192.168.1.3 PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data. 64 bytes from 192.168.1.3: icmp_seq=1 ttl=255 time=0.243 ms --- 192.168.1.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.243/0.243/0.243/0.000 ms At the moment I've test the CVS Version (1.27) of the check_ping command. With this there is the same error like in the "nagios-plugins-1.4.0alpha1" package. thanks bye ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880 From noreply at sourceforge.net Wed Jun 30 19:21:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jun 30 19:21:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-946857 ] check_ping - output error Message-ID: Bugs item #946857, was opened at 2004-05-03 06:05 Message generated for change (Comment added) made by alex_b You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880 Category: Argument proccessing Group: Release (specify) Status: Open Resolution: None Priority: 5 Submitted By: Pumuckel1980 (pumuckel1980) Assigned to: Nobody/Anonymous (nobody) Summary: check_ping - output error Initial Comment: Hello, I have some problems with the "nagios-plugins- 1.4.0alpha1". In this Version the check_ping plugin show me the following result: "bin/ping -n -U -c 1 ntest2ext Error: Could not interpret output from ping command" It's OK when I use the "nagios-plugins-1.3.1.tar.gz". ./check_ping -H ntest2ext -w 3000.0,80% -c 5000.0,100% -p 1 PING OK - Packet loss = 0%, RTA = 0.22 ms PING OK - Packet loss = 0%, RTA = 0.46 ms Here are my differnet settings: 1. nagios-plugins-1.3.1.tar.gz ############################## = uname -a "Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 15:21:08 CET 2003 i686 i686 i386 GNU/Linux" =./check_ping -H *HOSTNAME* -w 3000.0,80% -c 5000.0,100% -p 1 "PING OK - Packet loss = 0%, RTA = 0.22 ms PING OK - Packet loss = 0%, RTA = 0.48 ms" 2. "nagios-plugins-1.4.0alpha1" ############################## = uname -a "Linux *HOSTNAME* 2.4.22 #1 SMP Mit Okt 29 1:21:08 CET 2003 i686 i686 i386 GNU/Linux" =./check_ping -H ntest2ext -w 3000.0,80% -c 5000.0,100% -p 1 "/bin/ping -n -U -c 1 ntest2ext Error: Could not interpret output from ping command" thanks for help bye ---------------------------------------------------------------------- Comment By: Alex Burger (alex_b) Date: 2004-06-30 22:20 Message: Logged In: YES user_id=85836 My testing was with Mandrake 10, not 9.2. 10 seems to have a different output for ping. Patch 912996 should help with the output problem, but it won't help with the STDOUT/ERR problem. ---------------------------------------------------------------------- Comment By: Alex Burger (alex_b) Date: 2004-06-30 22:03 Message: Logged In: YES user_id=85836 I am using Nagios-1.2 with nagios-plugins-1.3.1 and I am having a similar problem. On my Mandrake 9.2 system, host notifications for DOWN are showing the command line instead of the plugin output although the output for UP is correct. For example: [1088427108] HOST ALERT: server01;DOWN;SOFT;1;/bin/ping -n -U -c 1 server01 [1088427135] HOST NOTIFICATION: alex;server01;DOWN;host-notify-by-email;/bin/ping -n -U -c 1 server01 [1088427305] HOST NOTIFICATION: alex;server01;UP;host-notify-by-email;PING OK - Packet loss = 0%, RTA = 0.28 ms The host is using 'check-host-alive' which uses the following command line: /usr/local/nagios/libexec/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 It looks like check_ping is expecting the 'From 10.36.39.219 icmp_seq=1 Destination Host Unreachable' message to be sent to STDERR from ping, but on my system it goes to STDOUT. To test, I created a script that outputs to STDERR a ping result, and changed check_ping to call my script instead: #!/usr/bin/perl select STDERR; print "From 192.168.1.1 icmp_seq=1 Destination Host Unreachable\n"; print "\n"; print "--- 192.168.1.1 ping statistics ---\n"; print "echo 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms\n"; Calling check_ping, I get the correct output: PING CRITICAL - Host Unreachable If I changed the script by removing 'select STDERR', I get: Error: Could not interpret output from ping command Looking at the source code, if it can not interpret the output it outputs the command that was executed instead, for troubleshooting purposes I assume. Alex ---------------------------------------------------------------------- Comment By: Pumuckel1980 (pumuckel1980) Date: 2004-05-03 08:18 Message: Logged In: YES user_id=1034118 added: here is the output of the ping command: [root at pb3 nagios-plugins-1.4.0alpha1]# /bin/ping -n -U -c 1 192.168.1.3 PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data. 64 bytes from 192.168.1.3: icmp_seq=1 ttl=255 time=0.243 ms --- 192.168.1.3 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.243/0.243/0.243/0.000 ms At the moment I've test the CVS Version (1.27) of the check_ping command. With this there is the same error like in the "nagios-plugins-1.4.0alpha1" package. thanks bye ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=946857&group_id=29880