Commit graph

79 commits

Author SHA1 Message Date
Lorenz Kästle
458af51688 check_mysql: delare file local variables static 2024-11-08 12:32:45 +01:00
Lorenz Kästle
de5709bd7c check_mysql: update copyright 2024-10-31 14:45:24 +01:00
Lorenz Kästle
4f7ee05786 check_mysql: Label some booleans correctly 2024-08-28 19:20:31 +02:00
Lorenz Kästle
584cca3a96 check_mysql: remove unused global variables 2024-08-28 19:19:16 +02:00
RincewindsHat
0b389d636e check_mysql: Use C99 booleans 2023-10-18 16:40:51 +02:00
RincewindsHat
0e70e81133 Merge branch 'master' into mysql_detect_mysqldump 2023-09-18 22:59:46 +02:00
RincewindsHat
ce355c80cf Initialize slaveresult to 0 and use strncat instead of bsd strlcat 2023-09-18 22:58:34 +02:00
RincewindsHat
c405dbafcc Add mysql_close to avoid spamming the server logs 2023-09-18 19:18:35 +02:00
Platon Pronko
1086326532 check_mysql: handle ER_ACCESS_DENIED_NO_PASSWORD_ERROR if ignore_auth=1
In some situations MySQL might return ER_ACCESS_DENIED_NO_PASSWORD_ERROR
instead of ER_ACCESS_DENIED_ERROR. Semantically these errors are the same.
2023-05-30 15:35:39 +08:00
Lorenz Kästle
d10ee31d89 Typo in check_mysql 2023-04-28 16:51:39 +02:00
Gerardo Malazdrewicz
3929c5ac37
check_mysql.c: Detect running mysqldump
When checking a slave, if the IO Thread or the SQL Thread are stopped, check for running mysqldump threads, return STATE_OK if there is any.
Requires PROCESS privilege to work (else the mysqldump thread(s) would not be detected).

Enlarged SLAVERESULTSIZE to fit "Mysqldump: in progress" at the end of the string.
Got a NULL pointer in row[seconds_behind_field] instead of the "NULL" string when a mysqldump is running [mysql 5.7.34 + libmariadb3 10.3.31], so added a check for that.
2021-10-31 09:37:55 -03:00
Robin Sonefors
2bc4cc99d2 check_mysql: Allow sockets to be specified to -H
The help text says that -H accepts a "unix socket (must be an absolute
path)". Now that actually corresponds to reality.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
2019-03-21 13:54:19 +01:00
Sven Nierlein
edca257e20 use unknown exit code for help/version in plugins
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Jan Wagner
2e8d440e73 check_mysql: ignore authentication failure
This patch allows checking if MySQL server is running without providing valid
username and password. Similar to check_ssh plugin it returns MySQL server
version string and protocol number.

Example:
check_mysql -n -H aaa.bbb.ccc.ddd
MySQL OK - Version: 5.0.51a-24+lenny5 (protocol 10)

This is useful for monitoring servers where one does not have administrator
privileges or does not want to grant any privileges for the monitoring station.

To enable this functionality new option --ignore-auth (-n) is added to
check_mysql plugin.

Thanks to Julius Kriukas

Closes #1020
Closes #1178
2014-07-28 22:13:02 +02:00
awiddersheim
70314c62fc Fix check_mysql.c client options from file
If you don't specify a group or a file to read data from the plugin tries to read from several files that don't exist and no groups.
2014-04-03 23:41:37 +06:00
Holger Weiss
c3e756a855 Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +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
b5ac0d16b2 check_mysql: Don't accept new positional arguments
Do not also accept the new -f/--file and -g/--group options as
positional arguments (especially not prior to "db_pass" and "db", as
that would break backward compatibility).
2013-08-18 22:30:30 +02:00
Holger Weiss
779b91e48f check_mysql: Use xasprintf instead of asprintf 2013-08-18 22:29:31 +02:00
Holger Weiss
584555098d check_mysql: Fix copy'n'pasted comments 2013-08-18 22:28:18 +02:00
Holger Weiss
14bc7af323 Merge branch 'master' of https://github.com/jonmilby/nagios-plugins
* 'master' of https://github.com/jonmilby/nagios-plugins:
  Updated check_mysql.c to take client options file and group parameters

Conflicts:
	plugins/check_mysql.c
2013-08-18 22:25:08 +02:00
Tim Laszlo
b2568b85af check_mysql: Connections should have been defined as a counter 2013-08-18 18:38:10 +02:00
Tim Laszlo
7bbd155a72 Counter increments were incorrect; remove the leading space from perfdata 2013-08-18 18:38:10 +02:00
Tim Laszlo
c8d8b58447 check_mysql: add perfromance metrics for all checks 2013-08-18 18:38:10 +02:00
Tim Laszlo
1627cdb46a check_mysql: when checking slave thread add performance data for seconds behind master 2013-08-18 18:38:10 +02:00
Holger Weiss
36c2e50837 check_mysql: Cosmetic changes to SSL support
Use (slightly) more intuitive option names etc.
2013-08-18 01:47:32 +02:00
Juan Carlos Fernandez
8e66a58d41 Added ssl support to check_myslq 2013-08-18 01:28:13 +02:00
Daniël van Eeden
e396a54274 Apply my patch from:
http://sourceforge.net/tracker/index.php?func=detail&aid=3269273&group_id=29880&atid=397597
2013-01-24 08:56:19 +01:00
Jonathan Milby
5ed7194c7e Updated check_mysql.c to take client options file and group parameters 2012-12-28 12:40:23 -05: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
eaf3cb27f4 Add newline after "Usage:" in --help 2010-04-22 08:57:14 -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
917fcc7c30 Fix check_mysql* not using password set in my.cnf (#2531905 - Ben Timby) 2009-05-20 00:20:11 -04:00
Thomas Guyot-Sionnest
ab3ada9aac check_mysql: Fix segfault with old slaves (#2696823 - Oskar Ahner) 2009-03-24 02:01:48 -04:00
Ton Voon
5324544855 Typo fixes (Jan Wagner - SF 1878971) 2009-02-20 00:00:13 +00: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
caa8bd6423 Bulk EOL cleanup
$ git diff --ignore-space-change|diffstat
 0 files changed


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19 06:45:18 +00:00
Thomas Guyot-Sionnest
dfca15116c Fix assignment written as a comparison in validate_arguments() when db_pass is NULL (Patch from http://blog.barfoo.org/projects/rpms-for-sles10)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2034 f882894a-f735-0410-b71e-b25c423dba1c
2008-08-16 04:47:32 +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
aca1e6a6ce Add socket support to check_mysql*
Also clears the password from check_mysql command-line options


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1988 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-30 12:50:52 +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
fa4efcdf6d Bump plugins/ to GPLv3 (check_apt to check_nwstat)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1916 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-30 10:53:47 +00:00
Thomas Guyot-Sionnest
2af978187c Plenty of french translations (and a few fixes BTW)
- No more fuzzy french translations
 - Only (!) 355 strings to translate


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1859 f882894a-f735-0410-b71e-b25c423dba1c
2007-12-10 07:52:00 +00:00
Holger Weiss
b809d23c81 Fix argument processing (Felix Frank - 1690697)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1655 f882894a-f735-0410-b71e-b25c423dba1c
2007-03-29 17:58:28 +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
Benoit Mortier
082cfc29e3 first pass at cleaning localization for new release
first pass at making all the headre be the same licence, plugin, etc...


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1499 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-19 00:25:16 +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
Benoit Mortier
e5324624ca cleaning help and usage
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1432 f882894a-f735-0410-b71e-b25c423dba1c
2006-06-15 12:52:25 +00:00
Ton Voon
2db2f402a3 mysql detection cleanup: fixes runtime linking, autodetection of main
locations, detection of lib64 and different layouts


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1327 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-17 14:07:34 +00:00