Hey guys
Is there somewhere a best practise or general tutorial how to use the consol labs plugin into checkmk?
Greetz
Ovrld
Hey guys
Is there somewhere a best practise or general tutorial how to use the consol labs plugin into checkmk?
Greetz
Ovrld
Hi @Overlord
As far as I know consol labs creates Nagios/Icinga plugins. As such, they would be used as any other classic Nagios/Icinga check in CMK, i.e. either as âclassicâ active or passive check or via MRPE.
HTH,
Thomas
Since I have installed the check via MRPE I have an issue with the agent output and CheckMK canât recognize the apache Plugin anymore:
<<< mrpe>>>
(check_mysql_health) MySQL_IndexUsage 2 CRITICAL - index usage 5.76% | index_usage=5.76%;12:;10: index_usage_now=0.00%
<<< mrpe>>>
() 0
<<local:sep(0)>>
0 Nextcloud_Version - No update available (installed version: 20.0.8.1)
cached(1617707950,45000) 0 âAPT Repositoryâ Repositories=4: Repository Health Fine
<<<apache_status:sep(124)>>>
[::1]|80||::1
[::1]|80||ServerVersion: Apache/2.4.38 (Debian)
[::1]|80||ServerMPM: prefork
[::1]|80||Server Built: 2020-08-25T20:08:29
[::1]|80||CurrentTime: Tuesday, 06-Apr-2021 13:59:38 CEST
[::1]|80||RestartTime: Friday, 02-Apr-2021 20:36:36 CEST
[::1]|80||ParentServerConfigGeneration: 5
[::1]|80||ParentServerMPMGeneration: 4
[::1]|80||ServerUptimeSeconds: 321781
[::1]|80||ServerUptime: 3 days 17 hours 23 minutes 1 second
[::1]|80||Load1: 0.22
[::1]|80||Load5: 0.11
[::1]|80||Load15: 0.03
[::1]|80||Total Accesses: 6048
[::1]|80||Total kBytes: 8084
[::1]|80||Total Duration: 6028
[::1]|80||CPUUser: 4.16
[::1]|80||CPUSystem: 8.24
[::1]|80||CPUChildrenUser: 2.56
[::1]|80||CPUChildrenSystem: 1.25
[::1]|80||CPULoad: .00503759
[::1]|80||Uptime: 321781
[::1]|80||ReqPerSec: .0187954
[::1]|80||BytesPerSec: 25.7256
[::1]|80||BytesPerReq: 1368.72
[::1]|80||DurationPerReq: .996693
[::1]|80||BusyWorkers: 1
[::1]|80||IdleWorkers: 5
[::1]|80||Scoreboard: W___âŚ
Please select a mode
Copyright (c) 2009 Gerhard LausserCheck various parameters of MySQL databases
Usage:
check_mysql_health [-v] [-t ] [[âhostname ]
[âport | --socket ]
âusername --password ] --mode
[âmethod mysql]
check_mysql_health [-h | --help]
check_mysql_health [-V | --version]Options:
âhostname
the database serverâs hostname
âport
the databaseâs port. (default: 3306)
âsocket
the databaseâs unix socket.
âusername
the mysql db user
âpassword
the mysql db userâs password
âdatabase
the databaseâs name. (default: information_schema)
âreplication-user
the databaseâs replication user name (default: replication)
âwarning
the warning range
âcritical
the critical range
âmode
the mode of the plugin. select one of the following keywords:
connection-time (Time to connect to the server)
uptime (Time the server is running)
threads-connected (Number of currently open connections)
threadcache-hitrate (Hit rate of the thread-cache)
threads-created (Number of threads created per sec)
threads-running (Number of currently running threads)
threads-cached (Number of currently cached threads)
connects-aborted (Number of aborted connections per sec)
clients-aborted (Number of aborted connections (because the client died) per sec)
slave-lag (Seconds behind master)
slave-io-running (Slave io running: Yes)
slave-sql-running (Slave sql running: Yes)
qcache-hitrate (Query cache hitrate)
qcache-lowmem-prunes (Query cache entries pruned because of low memory)
keycache-hitrate (MyISAM key cache hitrate)
bufferpool-hitrate (InnoDB buffer pool hitrate)
bufferpool-wait-free (InnoDB buffer pool waits for clean page available)
log-waits (InnoDB log waits because of a too small log buffer)
tablecache-hitrate (Table cache hitrate)
table-lock-contention (Table lock contention)
index-usage (Usage of indices)
tmp-disk-tables (Percent of temp tables created on disk)
table-fragmentation (Show tables which should be optimized)
open-files (Percent of opened files)
slow-queries (Slow queries)
long-running-procs (long running processes)
cluster-ndbd-running (ndnd nodes are up and running)
sql (any sql command returning a single number)--name the name of something that needs to be further specified, currently only used for sql statements --name2 if name is a sql statement, this statement would appear in the output and the performance data. This can be ugly, so name2 can be used to appear instead. --regexp if this parameter is used, name will be interpreted as a regular expression. --units one of %, KB, MB, GB. This is used for a better output of mode=sql and for specifying thresholds for mode=tablespace-free --labelformat one of pnp4nagios (which is the default) or groundwork. It is used to shorten performance data labels to 19 characters.
In mode sql you can url-encode the statement so you will not have to mess
around with special characters in your Nagios service definitions.
Instead of
âname=âselect count(*) from v$session where status = âACTIVEââ
you can say
âname=select%20count%28%2A%29%20from%20v%24session%20where%20status%20%3D%20%27ACTIVE%27
For your convenience you can call check_mysql_health with the --mode encode
option and it will encode the standard input.You can find the full documentation at
check_mysql_health - ConSol LabsSend email to gerhard.lausser@consol.de if you have questions
regarding use of this software.
Please include version information with all correspondence (when possible,
use output from the --version option of the plugin itself).
If i perform the script on the shell, I get the normal output without the last stuff from the script:
CRITICAL - index usage 5.76% | index_usage=5.76%;12:;10: index_usage_now=5.69%
Any Ideas?
The output looks like a wrong configured MRPE call.
Can you show the MRPE configuration please.
MySQL%20IndexUsage /usr/lib/check_mk_agent/plugins/check_mysql_health --hostname 127.0.0.1 --username user --password âpasswordâ --mode index-usage --warning 12: --critical 10:
Hey @Overlord
Try the following:
*.sh
file /usr/lib/check_mk_agent/plugins/check_mysql_health --hostname 127.0.0.1 --username user --password âpasswordâ --mode index-usage --warning 12: --critical 10:
Does it yield the expected result?
Thomas
Argh - got it! I copied the script in the same directory to itâs pulled twice. Omg
The agentâs plugins
directory is only for checkmk agent plugins. Classical Nagios plugins have to be installed outside of /usr/lib/check_mk_agent
and can be called via /etc/check_mk/mrpe.cfg
.
See section 4 of The agent for Linux in detail
Thank you for your reply - a short last question:
Is there a difference between MRPE and âIntegrate Nagios pluginsâ" (Setup â Services â Other Services â Integrate Nagios plugins"?
MRPE = running on the monitored client machine
Integrate Nagios plugins = Running on the Monitoring server and bind the checks to the client machines?
Like âcheck if IP/DNS xy is on a spamlistâ, running on the monitoring server and bind this check to the client server with that DNS/IP?
Yes, that is exactly correct.