Commit graph

58 commits

Author SHA1 Message Date
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
RincewindsHat
46c5327e34 Revert to poor man's logic 2021-10-02 23:37:12 +02:00
rincewind
66e2453759 Introduce new perfdata functions and stuff for using (u)int64_t 2021-09-25 23:24:34 +02:00
Sven Nierlein
e8325b39c4 fix maxfd being zero
If _SC_OPEN_MAX is available then maxfd was zero initialized and never set to the value from sysconf.
This leads to segfaults with free(): invalid size introduced by commit 7cafb0e845.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-05-24 14:51:10 +02:00
Sven Nierlein
7cafb0e845 check_by_ssh: fix child process leak on timeouts
When check_by_ssh runs into a timeout it simply exits keeping all child processes running.
Simply adopting the kill loop from runcmd_timeout_alarm_handler() fixes this.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-02-15 10:36:28 +01:00
John C. Frickson
a5983eda69 check_users not correctly detecting thresholds
Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/81

check_users now uses the standard warning and critical ranges parser and
a standard perdata output routine.
2016-11-07 21:36:25 +01:00
Thomas Guyot-Sionnest
fd20a72ad6 Remove accidental tabs inserted in macro 2014-01-23 03:06:21 -05:00
Ricardo Maraschini
82033b35b1 plugins/utils.h: avoiding warnings on empty printf statements
while compiling i keep receiving an warning statement as follow:

warning: zero-length gnu_printf format string

using an unorthodox method to remove them

Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com>
2014-01-22 16:11:57 +01:00
Holger Weiss
01e570f4a4 Capitalize "Monitoring Plugins"
"Monitoring Plugins" is a name.
2014-01-21 16:19:20 +01:00
Holger Weiss
7ee3525423 Merge branch 'maint'
* maint:
  check_ssh: Get rid of sshd: Read from socket failed: Connection reset by peer
  fixed tests when there is no direct internet connection
  NEWS: Mention fix for check_http's -S option
  Fix for SSL Versioning when multiple options are used.
  Fix #1217 spec file fails to build due to duplicate files and unused files
  check_http: Don't let "-N" expect an argument
  README: Change GitHub URL
  README: Clarify license notice
  Update URLs and mailing list addresses
  Just using the posix conform extended regular expression grep
  check_oracle: --db +ASM bad string matching check_oracle doesn't correctly check for pmon +ASM instance from at least Oracle 11 as the pmon proces was renamed from ora_pmon_.* to asm_pmon_.*. -- Just turning attached patch of github issue #1207 into a push request. (Closes #1207)
  Update web site URLs

Conflicts:
	FAQ
	NEWS
	README
	SUPPORT
	configure.in
	monitoring-plugins.spec.in
	pkg/solaris/pkginfo.in
	plugins-root/check_dhcp.c
	plugins-root/check_icmp.c
	plugins-scripts/check_ifoperstatus.pl
	plugins-scripts/check_mssql.pl
	plugins/check_apt.c
	plugins/check_by_ssh.c
	plugins/check_cluster.c
	plugins/check_dbi.c
	plugins/check_dig.c
	plugins/check_disk.c
	plugins/check_dns.c
	plugins/check_dummy.c
	plugins/check_fping.c
	plugins/check_game.c
	plugins/check_hpjd.c
	plugins/check_http.c
	plugins/check_ide_smart.c
	plugins/check_ldap.c
	plugins/check_load.c
	plugins/check_mrtg.c
	plugins/check_mrtgtraf.c
	plugins/check_mysql.c
	plugins/check_mysql_query.c
	plugins/check_nagios.c
	plugins/check_nt.c
	plugins/check_ntp.c
	plugins/check_ntp_peer.c
	plugins/check_ntp_time.c
	plugins/check_nwstat.c
	plugins/check_overcr.c
	plugins/check_pgsql.c
	plugins/check_ping.c
	plugins/check_procs.c
	plugins/check_radius.c
	plugins/check_real.c
	plugins/check_smtp.c
	plugins/check_snmp.c
	plugins/check_ssh.c
	plugins/check_swap.c
	plugins/check_tcp.c
	plugins/check_time.c
	plugins/check_ups.c
	plugins/check_users.c
	plugins/negate.c
	plugins/urlize.c
	plugins/utils.h
	po/Makevars
	po/de.po
	po/fr.po
	po/monitoring-plugins.pot
2014-01-21 16:07:38 +01:00
Thomas Guyot-Sionnest
11cf54ca78 Merge branch 'rename' 2014-01-21 07:59:07 -05:00
Spenser Reinhardt
80e506a2f7 plugins/utils.h: Addition of plugin timeout msg.
Addition of timeout message for non-network plugins(UT_PLUG_TIMEOUT), and alteration of UT_TIMEOUT to UT_CONN_TIMEOUT for networked checks. Alteration of pull request #1209 tracker by user awiddersheim.
2014-01-21 11:34:33 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Holger Weiss
3c90a370ea Update URLs and mailing list addresses
Now that we moved our infrastructure away from SourceForge, update the
URLs and mailing list addresses accordingly.
2013-10-28 23:58:36 +01:00
Holger Weiss
ef35403c26 Update web site URLs
The Nagios Plugin Development Guidelines and the Extra-Opts
documentation were moved to our new project server.
2013-10-08 16:09:42 +02:00
Holger Weiss
5b0e00782d Move global variables from .h to .c files
Simplify things by moving the definition of global variables into .c
files, where they belong.
2013-09-10 22:45:45 +02:00
Anders Kaseorg
028d50d6f9 Die when asprintf fails
Fixes many instances of
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-06-29 13:39:11 +02:00
Thomas Guyot-Sionnest
a4bab0bb46 Update extra-opts help text based on ML agreement 2010-04-28 06:03:57 -04:00
Thomas Guyot-Sionnest
884aee0667 Standardize the extra-opts notes 2010-04-21 23:29:18 -04:00
Thomas Guyot-Sionnest
25d1ee331d Fix translations when extra-opts aren't enabled
Bug #2832884 reported problem with translations outputting pot file
headers. This is caused by "" matching the header of the translation
files.

This patch moves gettext macros inside utils macros and update some
french translations.
2010-04-14 08:33:06 -04:00
Thomas Guyot-Sionnest
c459ca0770 Make alarm handler customisable 2009-03-20 02:19:42 -04:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
Thomas Guyot-Sionnest
44f8455b2c Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07 10:02:42 +00:00
Thomas Guyot-Sionnest
ed62784a0b --help output cleanup (plus removal of spaces on blank lines)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1984 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-27 14:35:26 +00:00
Thomas Guyot-Sionnest
caca7a50fd Add a max_state_alt function that put UNKNOWN and DEPENDENT ahead of OK.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1829 f882894a-f735-0410-b71e-b25c423dba1c
2007-11-23 04:18:16 +00:00
Holger Weiss
fd329a1e91 Don't try to print `optarg' (which will be a NULL pointer) if an unknown
command line option was used, as this leads to a segfault on some
systems.  The unknown option will be printed by getopt(3) anyway.  So,
simply call print_usage() and exit UNKNOWN via the new usage5() instead.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1590 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28 21:46:41 +00:00
M. Sean Finney
8efd2d1d90 - explicitly include utils_base.h from utils.h
- put utils.h inside of an #ifndef/#endif


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1474 f882894a-f735-0410-b71e-b25c423dba1c
2006-09-02 20:41:18 +00:00
Ton Voon
548083b2ea Move new util_* functions to lib/
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1451 f882894a-f735-0410-b71e-b25c423dba1c
2006-07-13 12:50:23 +00:00
Ton Voon
6b9cc76d0a Using coreutils' base_name function because of portability issues with
Tru64


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1450 f882894a-f735-0410-b71e-b25c423dba1c
2006-07-13 08:54:57 +00:00
Ton Voon
34cb16d283 Internal version of basename if one not found in system
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1383 f882894a-f735-0410-b71e-b25c423dba1c
2006-04-27 13:25:10 +00:00
Ton Voon
f5c1cf6dd4 New function to for escaped strings from command line for send/quit.
Adapted from Sebastian Wiesinger's patch (1292404)


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1365 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-29 16:33:36 +00:00
Ton Voon
864544b29e Adding check_mysql_query, using new ranges and threshold checking
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1309 f882894a-f735-0410-b71e-b25c423dba1c
2006-01-31 14:52:49 +00:00
Ton Voon
e0688a6911 Clearly defined thresholds & ranges in docs. Added get_status routine. Added
set_thresholds routine. Tests enhanced to check new routines


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1304 f882894a-f735-0410-b71e-b25c423dba1c
2006-01-30 22:24:31 +00:00
Ton Voon
795100ae51 Added libtap tests for utils.c library functions. Removed redundant
test files


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1303 f882894a-f735-0410-b71e-b25c423dba1c
2006-01-30 16:10:50 +00:00
M. Sean Finney
16cd0c8151 - added code to allow check_tcp (via np_net_connect) work with local
unix sockets.  some testing would be welcome.  based on idea from
  Alex Samorukov.
- also introduced a check_clamd behavior in check_tcp.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1261 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-25 10:38:02 +00:00
M. Sean Finney
ceebd58040 initial merging of ae's np_runcmd code into selected plugins.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1260 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-24 11:10:29 +00:00
Benoit Mortier
2ab4d8fc27 fix patch 998291
fix patch 1078934 expect check_ssh fix and check_nt perfdata should stay
on one word like in nagios


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1004 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-05 00:54:09 +00:00
Benoit Mortier
694194dd8a some minor fixes
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@992 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-03 17:48:53 +00:00
Benoit Mortier
d19edd4043 standardize localization string
standardize unknow arguments


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-01 23:54:51 +00:00
Karl DeBisschop
7ba54264fb add perfdata function for floats to complement ints, also spell fix "received"
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@817 f882894a-f735-0410-b71e-b25c423dba1c
2004-02-20 05:21:21 +00:00
Ton Voon
48ecd294da - typo fixes
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@759 f882894a-f735-0410-b71e-b25c423dba1c
2003-11-10 11:15:23 +00:00
Karl DeBisschop
a2c0d2b629 add min() macro to complement max()
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@699 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-28 03:20:25 +00:00
Karl DeBisschop
68e8cc5f4d function to make perfdata output
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@696 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-26 10:44:14 +00:00
Karl DeBisschop
a228492c4b more pedantic compiler warns
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@672 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09 06:01:03 +00:00
Karl DeBisschop
eb47d0870a add function for elapsed tim ein microseconds
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@670 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09 04:12:14 +00:00
Karl DeBisschop
41158497e8 more pedantic compiler warnings
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@668 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09 00:41:06 +00:00
Karl DeBisschop
a9f992033f fix a variety of compiler warnings about qualifier discards and other pedantic stuff
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@663 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-08 05:09:40 +00:00
Karl DeBisschop
65ca899d2c fix a variety of compiler warnings about qualifier discards and other pedantic stuff
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@662 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-08 04:33:21 +00:00
Karl DeBisschop
9e17dab6c3 replace "terminate" with "die" for shorter name and better readability
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@656 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-07 11:51:12 +00:00
Karl DeBisschop
561da286a1 markupf for translation
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@634 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-02 22:06:06 +00:00