summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-21add sperfdata function which can handle threshold rangesGerhard Lausser1-0/+40
2014-01-19Project rename initial commit.Monitoring Plugins Development Team1-1/+1
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-09-10Move global variables from .h to .c filesHolger Weiss1-2/+5
Simplify things by moving the definition of global variables into .c files, where they belong.
2012-06-29Die when asprintf failsAnders Kaseorg1-20/+47
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>
2009-03-20Make alarm handler customisableThomas Guyot-Sionnest1-3/+3
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningThomas Guyot-Sionnest1-18/+3
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-01-31Bump plugins/ to GPLv3 (non-plugind files)Thomas Guyot-Sionnest1-12/+26
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1918 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/+27
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1829 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-07Changed output order of print_revisionMatthias Eble1-6/+5
print_revision now uses clean_revstring git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1752 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28Don't try to print `optarg' (which will be a NULL pointer) if an unknownHolger Weiss1-0/+7
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-07-13Move new util_* functions to lib/Ton Voon1-190/+1
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-27/+0
Tru64 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1450 f882894a-f735-0410-b71e-b25c423dba1c
2006-06-18updating help and usage and licenseBenoit Mortier1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1434 f882894a-f735-0410-b71e-b25c423dba1c
2006-04-27Internal version of basename if one not found in systemTon Voon1-0/+27
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1383 f882894a-f735-0410-b71e-b25c423dba1c
2006-04-06Stop coredump on Solaris if arg not specified (Jason Kau - 1465288)Ton Voon1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1370 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-29New function to for escaped strings from command line for send/quit.Ton Voon1-0/+30
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-30Clearly defined thresholds & ranges in docs. Added get_status routine. AddedTon Voon1-20/+113
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/+55
test files git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1303 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-24initial merging of ae's np_runcmd code into selected plugins.M. Sean Finney1-0/+11
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1260 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-25various fixes for localizationBenoit Mortier1-4/+4
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1061 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-03removing support fonctionBenoit Mortier1-15/+0
removing warranty from print_revision git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@993 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-02More internationalization workBenoit Mortier1-0/+7
new usage4 function to permit localisation of think like check_ssh: xxxxx git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@979 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-01standardize localization stringBenoit Mortier1-12/+0
standardize unknow arguments git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c
2004-03-03begin writing some perfdata as floatKarl DeBisschop1-11/+16
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@841 f882894a-f735-0410-b71e-b25c423dba1c
2004-02-20add perfdata function for floats to complement ints, also spell fix "received"Karl DeBisschop1-0/+39
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@817 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-28use single quotes per guideline, also quote when SPC or = are foundKarl DeBisschop1-2/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@702 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-28suppress quotes in perf data when not needed (some plugins need the space to ↵Karl DeBisschop1-1/+4
keep below line length limit git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@700 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-26function to make perfdata outputKarl DeBisschop1-0/+44
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@696 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-10config.h is redundant (common.h includes it)Karl DeBisschop1-1/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@680 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/+10
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-36/+2
pedantic stuff git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@663 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-07replace "terminate" with "die" for shorter name and better readabilityKarl DeBisschop1-13/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@656 f882894a-f735-0410-b71e-b25c423dba1c
2003-08-02ifdef so utils.h can be header for utils.cKarl DeBisschop1-36/+4
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@633 f882894a-f735-0410-b71e-b25c423dba1c
2003-07-29clean up warnings about ill-formed comment and string concatenationKarl DeBisschop1-10/+11
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@617 f882894a-f735-0410-b71e-b25c423dba1c
2003-07-26checkins for internationalizationKarl DeBisschop1-2/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@598 f882894a-f735-0410-b71e-b25c423dba1c
2003-07-03remove LABELLENKarl DeBisschop1-1/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@582 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-22declaration must precede printfKarl DeBisschop1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@446 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-19make state_text a functionKarl DeBisschop1-1/+31
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@440 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-15Spent the day working on backwards compatability using getaddrinfo()Jeremy T. Bouse1-81/+0
Moved getaddrinfo.? and gethostbyname.? from lib/ to plugins/ due to problems with compiling into the libnagiosplug.a as it required linking against socket libraries which are unneeded except for network based plugins. This code should hopefully happily work for all systems and has been tested prior to commit on Debian GNU/Linux, SPARC Solaris 7 and SPARC Solaris 9. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@424 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-13Updated cvs ignore files to reflect changesJeremy T. Bouse1-1/+0
Moved header files from being ran through configure to standard Removed auto-tools scripts that get added by automake git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@417 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-12Added autogen.sh script that rebuilds using autotools and runs configureJeremy T. Bouse1-0/+12
Modified configure.in to include some debug build option info at the end of the scripts execution. Can be removed by release time. Modified configure.in to include a --with-ipv6 option Default build is without IPv6 support now to enable you need to use the --with-ipv6 command line option to configure. Modified plugins/utils.* to use USE_IPV6 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@410 f882894a-f735-0410-b71e-b25c423dba1c
2003-03-08AF indepedent routines introduced.Jeremy T. Bouse1-30/+42
Modifed process_request() & my_connect() parameters to make 'proto' type 'int' rather than 'char *' and use IPPROTO_* POSIX values. Removed is_dotted_quad() & my_inet_aton() functions Added is_addr(), is_inet_addr(), is_inet6_addr() and resolve_host_or_addr() functions to check whether it is a valid IP address Modified is_host() to call is_addr() and is_hostname() git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@384 f882894a-f735-0410-b71e-b25c423dba1c
2003-01-16restore max() macroKarl DeBisschop1-0/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@243 f882894a-f735-0410-b71e-b25c423dba1c
2003-01-13convert PROGANE from a define to a const charKarl DeBisschop1-13/+24
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@238 f882894a-f735-0410-b71e-b25c423dba1c
2003-01-03protect against some null strings, make formats more uniformKarl DeBisschop1-32/+52
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@234 f882894a-f735-0410-b71e-b25c423dba1c
2002-11-18more readable max_state() codeKarl DeBisschop1-27/+14
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@207 f882894a-f735-0410-b71e-b25c423dba1c
2002-11-14fix bug with gettimeofday test, improve version/release handling, update rpm ↵Karl DeBisschop1-1/+1
spec git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@200 f882894a-f735-0410-b71e-b25c423dba1c
2002-11-14remove call_getopt and ssprintfKarl DeBisschop1-2/+2
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@191 f882894a-f735-0410-b71e-b25c423dba1c