Holger Weiss
ff8b447e14
Convert plugins to use the new output functions
...
*** THIS COMMIT WILL BE MODIFIED IN THE FUTURE! ****
Convert some of the C plugins to use the new "configurable output
functions".
2009-04-22 00:47:47 +02:00
Holger Weiss
92bb86c484
Make C plugin output format configurable
...
*** THIS COMMIT WILL BE MODIFIED IN THE FUTURE! ***
The development guidelines¹ currently state that the plugin output
should be in the format "SERVICE STATUS: Information text".
However, when a plugin is called via Nagios in order to perform a
service check, adding SERVICE and STATUS to the output is redundant.
And when a plugin is called on the command line for testing, there is no
use in printing out the SERVICE string, either. However, for debugging,
it does make sense to print out the STATUS so that the user won't have
to check and interpret the exit code manually. But it should suffice to
print such debug output only when called with "--verbose", not in
production.
Space for plugin output is sometimes scarce, so that we should try to
keep the output "short and to the point" (as the guide states) and not
waste space with redundant information. Therefore, we decided² to make
the ("normal" and "verbose") plugin output configurable at compile time.
¹ http://nagiosplug.sf.net/developer-guidelines.html
² http://thread.gmane.org/gmane.network.nagios.plugins.devel/5155
2009-04-22 00:47:29 +02:00
Holger Weiss
05a980ba4b
Properly handle SMTP server responses which are split into multiple
...
packets (noted by Chris Adams on nagiosplug-help@). TODO: The new
recvline()/recvlines() functions should buffer received data instead of
reading one byte at a time and they should be moved to netutils.c so
that other plugins can use them, too.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1780 f882894a-f735-0410-b71e-b25c423dba1c
2007-09-15 14:25:56 +00:00
Holger Weiss
c11f63ff7e
Correct all instances of misaligned memory access. This fixes bus erros
...
on platforms which require alignment (such as SPARC and MIPS).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1779 f882894a-f735-0410-b71e-b25c423dba1c
2007-09-15 11:55:12 +00:00
Holger Weiss
e91e92e163
Remove "-Wtraditional" from our development GCC flags. We use ANSI C.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1778 f882894a-f735-0410-b71e-b25c423dba1c
2007-09-15 11:34:48 +00:00
Ton Voon
0708e6fa81
Adding in optional Nagios::Plugin perl module (and
...
dependencies) compilation and installation
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1777 f882894a-f735-0410-b71e-b25c423dba1c
2007-09-13 11:36:57 +00:00
Thomas Guyot-Sionnest
29d5acb7c8
These plugins assumed the "use lib util.pm;" would be substituted like standard Perl plugins (in plugins-scripts) which isn't the case in contrib. I changed the "use lib" line to use the default path. People using custom paths will have to change it manually.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1771 f882894a-f735-0410-b71e-b25c423dba1c
2007-08-28 03:19:45 +00:00
Holger Weiss
da6aa00a83
Don't use C++ style comments (noted by Johannes Kingma on
...
nagiosplug-help@)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1770 f882894a-f735-0410-b71e-b25c423dba1c
2007-08-09 12:32:28 +00:00
Holger Weiss
0616123167
Read the response to an SMTP QUIT command before closing the socket
...
(noted by Dieter Hendricks on nagiosplug-help@)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1769 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-31 14:47:04 +00:00
Holger Weiss
d18b8f5d94
Don't use C++ style comments.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1768 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-29 12:42:05 +00:00
Holger Weiss
ff8bf04d3a
If the TMPDIR environment variable is set, use that instead of "/tmp" as
...
the installation directory.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1767 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-27 15:49:01 +00:00
Holger Weiss
0a02314e8d
The "--serverip" and "--requestedip" options now accept host names, too.
...
This doesn't quite fit the option names and so far I haven't changed the
"--help" output which currently only talks about IP addresses. However,
I don't see why resolving host names should not be supported.
Also note that for the moment, I added a quick'n'dirty resolve_host()
function which should really go into netutils.c. I just wanted to think
about its interface a bit more before providing such a function globally.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1766 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 17:32:37 +00:00
Holger Weiss
ee33124028
New "-m, --mac" option which allows for specifying the MAC address to
...
use in the DHCP request.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1765 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 12:38:53 +00:00
Holger Weiss
6f60c0ac81
Make sure strncpy(3)d buffers are nul-terminated.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1764 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 00:46:42 +00:00
Holger Weiss
bd84273628
A few minor fixes/improvements which were included with (but unrelated
...
to) the "--unicast" patch (Andreas Ericsson and Heiti Ernits - 1218235)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1763 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 00:07:19 +00:00
Holger Weiss
c6498986b7
New "-u, --unicast" option which gives check_dhcp the ability to mimic a
...
DHCP relay server in order to check remote subnets (Heiti Ernits and
Andreas Ericsson - 1218235)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1762 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-26 00:02:28 +00:00
Ton Voon
37287823f0
Removing all .cvsignore files
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1761 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-24 00:35:42 +00:00
Ton Voon
ff50baf6de
Updated to use svn instead of cvs
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1760 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-24 00:35:16 +00:00
Holger Weiss
475ee7b55a
Add "Connection: close" to the HTTP request header, which tells HTTP/1.1
...
servers to close the connection after completion of the response. This
should be compatible with HTTP/1.0, as HTTP/1.0 allows for custom header
fields which should be ignored if not recognized by the server. With
some server configurations, the server would keep the connection alive
without this header line (despite the plugin requesting HTTP/1.0),
resulting in the plugin running into either the server's or it's own
timeout (reported by Roman Schliessmeyer and Jesse Morgan via IRC).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1759 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-21 16:29:01 +00:00
Matthias Eble
d77b785d23
Make ps column count in zombie detection less restrictive. Thanks to Andrew Elwell ( #1280470 )
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1758 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-15 15:21:51 +00:00
Matthias Eble
c134205981
Fixed segfault in argument processing. Thanks to Christoph Schell ( #1742066 )
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1757 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-14 19:36:48 +00:00
Matthias Eble
06372d2d91
check_ntp: Fixed typo in typo in argument sanity check. Thanks to Aurelien Bompard ( #1753506 )
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1756 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-14 18:30:21 +00:00
Matthias Eble
aca23c4640
Added examples for new features to check_disk
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1755 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-10 20:45:48 +00:00
Matthias Eble
5e633124e4
Check_disk now calls stat() for all filesystems to check.
...
Check_disk prints an strerror() message if the call of stat() fails.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1754 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-10 20:18:55 +00:00
Matthias Eble
5d11612ecb
Added -v/--verbose argument to call ldap_perror() for detailed messages on failure.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1753 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-07 22:20:40 +00:00
Matthias Eble
ea6f0f5a6e
Changed output order of print_revision
...
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-07-07 12:02:45 +00:00
Matthias Eble
2208c1b7f3
Changed print_revision output order in utils.pm
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1751 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-07 11:55:48 +00:00
Matthias Eble
603de749ba
substituted $ID$ through $Revision$ in print_revision call
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1750 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-07 11:54:29 +00:00
Matthias Eble
a10569f139
Changed order in -V/--version output
...
Fixed -V output for check_log and check_oracle
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1749 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-07 11:40:29 +00:00
Matthias Eble
370561d594
Added hint to avoid using the boolean type in C as discussed on the devel list
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1748 f882894a-f735-0410-b71e-b25c423dba1c
2007-07-06 23:03:39 +00:00
Matthias Eble
f39f01e498
Fixed default behaviour of check_ldaps
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1747 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-20 11:09:47 +00:00
Matthias Eble
596002687a
Clarified check_ldaps behaviour. New arguments to explicitly select secure connect behaviour (--starttls/--ssl).
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1746 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-20 11:00:20 +00:00
Matthias Eble
a82c2b4c3e
added -V/--version to check_cluster
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1745 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-20 09:01:07 +00:00
Matthias Eble
1aa0194086
Make Linux specific plugin check_ide_smart build if appropriate headers are found
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1744 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-18 20:20:56 +00:00
Holger Weiss
79b2218286
Minor fixes.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1743 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-17 19:34:55 +00:00
Holger Weiss
02033903c0
Fix buffer overflow vulnerabilities when parsing HTTP redirect
...
'Location:' strings using sscanf(3) (Nobuhiro Ban - 1687867)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1742 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-17 19:22:51 +00:00
Holger Weiss
ba3112f4c9
When following redirects, the plugin supported 'Location:' header fields
...
which spanned multiple lines. However, it was not checked whether extra
lines are preceeded with white space, which could lead to the following
header field name being interpreted as the value of the 'Location:'
field if the latter was empty for some reason.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1741 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-15 18:37:13 +00:00
Holger Weiss
0dc4801791
`host_name' is a NULL pointer if the "-I" flag is used instead of "-H",
...
so use `server_address' instead. Fixes a possible segfault when
following redirects to relative URLs (reported by Ingo Lantschner).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1740 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-15 18:31:37 +00:00
Matthias Eble
7c8db659a4
Fixed some syntax errors to make check_ide_smart build
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1739 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-13 09:43:28 +00:00
Holger Weiss
884bd1c822
Add "-v" to help/usage output.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1738 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-12 23:18:13 +00:00
Matthias Eble
15255ec599
Removed debug line
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1737 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-12 07:13:02 +00:00
Matthias Eble
a25b98d939
Fixed problem with popen.c not parsing --longopt='foo bar' correctly (Daniel Bimschas #1291987 )
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1736 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-11 20:54:07 +00:00
Ton Voon
b5886d1c5d
Removed duplicate names
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1735 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-04 09:07:52 +00:00
Ton Voon
80fbd442aa
For 1.4.9 release
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1733 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-04 08:58:13 +00:00
Matthias Eble
9480b4ad3e
Minor corrections to test_tcp.c
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1732 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03 15:58:22 +00:00
Matthias Eble
fdd2312171
Makefile.am changes for test_tcp.c
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1731 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03 15:14:15 +00:00
Matthias Eble
0ad5dc6189
Added test cases for utils_tcp
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1730 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03 15:00:34 +00:00
Matthias Eble
d059eeb294
Moved check_tcp's expect string testing into utils_tcp for testing purposes.
...
Added -A/--all flag to test for every expect string passed.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1729 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-03 14:40:13 +00:00
Holger Weiss
0a73efe7ca
Fix possible check_http segfaults when following HTTP redirects.
...
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1728 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-01 23:11:46 +00:00
Holger Weiss
61e0cbb7f4
Fix an off-by-one error where a realloc(3) call doesn't allocate space
...
for nul-termination (Aravind Gottipati - 1729692)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1727 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-01 23:08:24 +00:00