Execute Service check command in commandline

Hello

Is it possible to execute the Service check command displayed in the service check details to troubleshoot checks? In this case I would like to troubleshoot a http check.

thanks!

Use cmk on the commandline with following options:

  --check Execute all checks on the given HOST. Optionally you can specify a
    second argument, the IPADDRESS. If you don't set this, the configured IP
    address of the HOST is used.

    By default the check results are sent to the core. If you provide the option
    '-n', the results will not be sent to the core and the counters of the check
    will not be stored.

    You can use '-v' to see the results of the checks. Add '-p' to also see the
    performance data of the checks.Can be restricted to certain check types.
    Write '--checks df -I' if you just want to look for new filesystems. Use
    'check_mk -L' for a list of all check types. Use 'tcp' for all TCP based
    checks and 'snmp' for all SNMP based checks.

    Additional options:

     -n, --no-submit     Do not submit results to core, do not save counters
     -p, --perfdata      Also show performance data (use with -v)
     --checks C          Restrict discovery to certain check types
     --keepalive         Execute in keepalive mode (CEE only)
     --keepalive-fd I    File descriptor to send output to

Additional with

   -v, --verbose       Enable verbose output (Use twice for more)
   --debug             Let most Python exceptions raise through

For more information read the manual of cmk on the commandline.

1 Like

–check will execute all checks on a given host. I would like to test some http parameters.

for example:

check_mk_active-http -H www.example.com -u β€˜/status?depth=0’ -s β€œ1”

is it possible to directly execute this with cmk in the commandline? Or do I have to use check_http with the parameters above?

Is it possible to get the RAW command which will be executed in the commandline? This was possible in nagios and icinga.

thanks

Because of the construction of the cmk it’s not possible to call the checks without the surrounding cmk framework. If you use the --debug and -v or -vv option you also get the output and debug information from the check directly.

hi,

sorry I am a little bit confused. What would be the right synthax if I want to execute a http check?

For Example:

Server Name: dummyHost

HTTP Service Check command:
check_mk_active-http -H www.example.com -u β€˜/status?depth=0’ -s β€œ1”

active nagios check plugins are located on lib/nagios/plugins/

so try

lib/nagios/plugins/check_http -H www.example.com -u β€œ/status?depth=0” -s β€œ1”