summaryrefslogtreecommitdiffstats
path: root/plugins/utils.h
AgeCommit message (Collapse)AuthorFilesLines
2024-03-26check_disk: Fail on missing arguments for --warning and --critical and fix a ↵Lorenz Kästle1-0/+1
test case (#1935) * check_disk: Fail on missing arguments for --warning and --critical * Add new test function for percentage expressions and use it in check_disk * Add error abort in tests if they fail to parse output * Fix typo in test which probably broke the test since forever :-(
2023-10-18plugins/utils: Use C99 booleansRincewindsHat1-15/+17
2023-09-22Rework maxfd/open_max to avoid unused variablesRincewindsHat1-2/+0
2023-04-14Fix a lot of typos reported by codespellrefs/pull/1864/headJan Wagner1-1/+1
2021-10-02Revert to poor man's logicrefs/pull/1707/headRincewindsHat1-3/+2
2021-09-25Introduce new perfdata functions and stuff for using (u)int64_trincewind1-0/+10
2019-05-24fix maxfd being zeroSven Nierlein1-0/+2
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 7cafb0e84550035fe671662c293122be975065ca. Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-02-15check_by_ssh: fix child process leak on timeoutsrefs/pull/1583/headSven Nierlein1-9/+0
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>
2016-11-07check_users not correctly detecting thresholdsJohn C. Frickson1-23/+11
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.
2014-01-23Remove accidental tabs inserted in macroThomas Guyot-Sionnest1-1/+1
2014-01-22plugins/utils.h: avoiding warnings on empty printf statementsRicardo Maraschini1-1/+1
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-21Capitalize "Monitoring Plugins"Holger Weiss1-2/+2
"Monitoring Plugins" is a name.
2014-01-21Merge branch 'maint'Holger Weiss1-5/+6
* 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-21Merge branch 'rename'Thomas Guyot-Sionnest1-8/+9
2014-01-21plugins/utils.h: Addition of plugin timeout msg.Spenser Reinhardt1-1/+5
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-19Project rename initial commit.Monitoring Plugins Development Team1-8/+9
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.
2013-10-28Update URLs and mailing list addressesHolger Weiss1-3/+3
Now that we moved our infrastructure away from SourceForge, update the URLs and mailing list addresses accordingly.
2013-10-08Update web site URLsHolger Weiss1-2/+3
The Nagios Plugin Development Guidelines and the Extra-Opts documentation were moved to our new project server.
2013-09-10Move global variables from .h to .c filesHolger Weiss1-7/+2
Simplify things by moving the definition of global variables into .c files, where they belong.
2012-06-29Die when asprintf failsAnders Kaseorg1-0/+2
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>
2010-04-28Update extra-opts help text based on ML agreementThomas Guyot-Sionnest1-1/+2
2010-04-22Standardize the extra-opts notesThomas Guyot-Sionnest1-4/+1
2010-04-14Fix translations when extra-opts aren't enabledThomas Guyot-Sionnest1-26/+26
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.
2009-03-20Make alarm handler customisableThomas Guyot-Sionnest1-0/+2
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningThomas Guyot-Sionnest1-3/+0
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-05-07Added support for --extra-opts in all C plugins (disabled by default, see ↵Thomas Guyot-Sionnest1-0/+19
configure --help) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-27--help output cleanup (plus removal of spaces on blank lines)Thomas Guyot-Sionnest1-1/+6
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1984 f882894a-f735-0410-b71e-b25c423dba1c
2007-11-23Add a max_state_alt function that put UNKNOWN and DEPENDENT ahead of OK.Thomas Guyot-Sionnest1-0/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1829 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28Don't try to print `optarg' (which will be a NULL pointer) if an unknownHolger Weiss1-2/+3
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
2006-09-02- explicitly include utils_base.h from utils.hM. Sean Finney1-0/+3
- 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-07-13Move new util_* functions to lib/Ton Voon1-25/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1451 f882894a-f735-0410-b71e-b25c423dba1c
2006-07-13Using coreutils' base_name function because of portability issues withTon Voon1-3/+0
Tru64 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1450 f882894a-f735-0410-b71e-b25c423dba1c
2006-04-27Internal version of basename if one not found in systemTon Voon1-0/+3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1383 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-29New function to for escaped strings from command line for send/quit.Ton Voon1-0/+2
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-01-31Adding check_mysql_query, using new ranges and threshold checkingTon Voon1-0/+6
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1309 f882894a-f735-0410-b71e-b25c423dba1c
2006-01-30Clearly defined thresholds & ranges in docs. Added get_status routine. AddedTon Voon1-4/+13
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-30Added libtap tests for utils.c library functions. Removed redundantTon Voon1-0/+13
test files git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1303 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-25- added code to allow check_tcp (via np_net_connect) work with localM. Sean Finney1-1/+1
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-24initial merging of ae's np_runcmd code into selected plugins.M. Sean Finney1-0/+5
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1260 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-05fix patch 998291Benoit Mortier1-35/+36
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-03some minor fixesBenoit Mortier1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@992 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-01standardize localization stringBenoit Mortier1-0/+2
standardize unknow arguments git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c
2004-02-20add perfdata function for floats to complement ints, also spell fix "received"Karl DeBisschop1-0/+12
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@817 f882894a-f735-0410-b71e-b25c423dba1c
2003-11-10- typo fixesTon Voon1-5/+5
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@759 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-28add min() macro to complement max()Karl DeBisschop1-0/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@699 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-26function to make perfdata outputKarl DeBisschop1-0/+12
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@696 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09more pedantic compiler warnsKarl DeBisschop1-3/+3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@672 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09add function for elapsed tim ein microsecondsKarl DeBisschop1-0/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@670 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-09more pedantic compiler warningsKarl DeBisschop1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@668 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-08fix a variety of compiler warnings about qualifier discards and other ↵Karl DeBisschop1-6/+4
pedantic stuff git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@663 f882894a-f735-0410-b71e-b25c423dba1c