Commit graph

26 commits

Author SHA1 Message Date
Lorenz Kästle
7bfb16e0da Implement replacement functions for executing commands
This commit implements replacement functions for the previous
exec functions.
The replacements are implemented in a more "pure" style, the do no
longer receive pointer arguments which they will write to, but create
the pointers themselves and should therefore be easier to use,
since it is more obvious what goes in and what comes out.

Also a essentialy unused variable was removed with this.
2025-11-16 14:26:41 +01:00
Lorenz Kästle
802e46f8ea Run clang-format again 2025-09-15 12:59:37 +02:00
Lorenz Kästle
0645c9fc2c Implement new output functionality 2025-02-18 21:58:34 +01:00
Lorenz Kästle
6eb5be9e30 Fix argument order of calloc on several occasions 2024-11-09 10:49:21 +01:00
Lorenz Kästle
4ca5696a19 runcmd.c: update copyright 2024-10-31 14:29:13 +01:00
Lorenz Kästle
629571aac3 runcmd.c: clang-format 2024-10-31 14:28:36 +01:00
RincewindsHat
c1c9abbfca Change iritating NULL assignment 2023-12-29 00:45:14 +01:00
RincewindsHat
07f9c438f3 Fixes for -Wsign-compare 2023-10-19 12:10:55 +02:00
RincewindsHat
09923e8a0f Fix missing include in plugins/runcmd.c 2023-10-07 23:31:59 +02:00
RincewindsHat
4295decfbf open_max is a library function now, it should be mp_open_max 2023-09-23 10:33:06 +02:00
RincewindsHat
7fd0e6f36d Rework maxfd/open_max to avoid unused variables 2023-09-22 15:22:57 +02:00
waja
4f4dd3a7a3
Merge branch 'master' into compiler_warning_part_5 2023-06-28 16:38:43 +02:00
RincewindsHat
a00c412e7b Fixes for -Wnonnull-compare 2023-04-18 00:35:09 +02:00
RincewindsHat
1568940b3e Implicit function declarations 2023-04-18 00:12:15 +02:00
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00: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
Holger Weiss
b63974c2cb plugins/runcmd.c: Remove superfluous newline
The puts(3) function already appends a newline character to the string.
2014-06-18 18:40:23 +02: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
Diego Elio Petten
332c6ef2c7 plugins: rename runcmd's signal handler.
The previous name would collide with popen's. Even if the two are
never used together, it's still a good idea not to have the same
symbol in multiple object files.
2013-05-12 14:15:13 +02: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
184ce9f6a3 Bump plugins/ to GPLv3 (non-plugind files)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1918 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31 11:27:22 +00:00
Benoit Mortier
f9394308c9 updating help and usage and license
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1434 f882894a-f735-0410-b71e-b25c423dba1c
2006-06-18 19:36:48 +00:00
M. Sean Finney
e667553b97 - check_ntp:
- now roughly feature-complete.
  - various bugfixes, esp. offset calculation.
  - enhanced the asynchronous offset polling to set requests that
    haven't recieved a response in >= 1 second to stale and retransmit them,
    which results in much better performance on unreliable networks.
  - we only spend timeout/2 seconds polling offsets, and if we don't get
    everything by that point we work with what we have and set status to
    warning/critical depending on how much data we have.
  - set the same defaults as the perl script.
- commit changes to configure.in to support automatic building of check_apt
  (if apt-get is installed and regex libraries available) and check_ntp
  (unconditionally), now defaulting to check_ntp.c instead of the perl script.
  if this is an issue we can back out the commit of course.  an eye
  should be kept on check_ntp building and running correctly in different
  environments, esp. 64-bit and big-endian platforms, and those with more
  "esoteric" API's (do any of the platforms not have poll()?).
- similar changes to Makefile.am's.
- common.h: add statement to include sys/poll.h
- runcmd.c: exit STATE_UNKNOWN if execve() fails.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1386 f882894a-f735-0410-b71e-b25c423dba1c
2006-05-01 21:52:42 +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
M. Sean Finney
290c9b1077 initial versions of the runcmd framework by andreas
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1197 f882894a-f735-0410-b71e-b25c423dba1c
2005-06-29 04:11:29 +00:00