maxenglander
maxenglander

Reputation: 4041

How do I test a manual check in check_mk / Nagios

My organization is using Nagios with the check_mk plugin to monitor our nodes. My question is: is it possible run a manual check from the command line? It is important, process-wise, to be able to test a configuration change before deploying it.

For example, I've prepared a configuration change which uses the ps.perf check type to check the number of httpd processes on our web servers. The check looks like this:

checks = [
  ( ["web"], ALL_HOSTS, "ps.perf", "Number of httpd processes", ( "/usr/sbin/httpd", 1, 2, 80, 100 ) )
]

I would like to test this configuration change before committing and deploying it.

Is it possible to run this check via the command line, without first adding it to main.mk? I'm envisioning something like:

useful_program -H my.web.node -c ps.perf -A /usr/sbin/httpd,1,2,80,100

I don't see any way to do something like this in the check_mk documentation, but am hoping there is a way to achieve something like this.

Thanks!

Upvotes: 3

Views: 10515

Answers (2)

Bastian Kuhn
Bastian Kuhn

Reputation: 21

that is easy to check.

Just make your config changes and then run: cmk -nv HOSTNAME.

That (-n) will try run everything and return (-v) the output.

So can see the same results like later in the GUI.

Upvotes: 2

MangeshBiradar
MangeshBiradar

Reputation: 3938

List the check

$check_mk -L | grep ps.perf

if it listing ps.perf then run following command,

$check_mk --checks=ps.perf -I Hostname

Upvotes: 1

Related Questions