"command type" for imported commands

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tyrant2424
Posts: 7
Joined: Mon Jul 17, 2017 2:41 pm

"command type" for imported commands

Post by tyrant2424 »

When importing commands using the CCM "Import Config Files" tool, we find that the "command type" of the commands ends up being "misc command" type. And thus cannot be picked from the "Check command" drop-down list in services.

Is there a way to import commands with the type set to "check command"?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: "command type" for imported commands

Post by lmiltchev »

We haven't been able to recreate the issue in house. Our imported commands are always set as "check commands", not "misc". Can you show us the config that you are trying to import?

Note: Usually perfdata commands, and event handlers are set as "misc" commands.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: "command type" for imported commands

Post by rexconsulting »

I've figured out how to duplicate this and how to work around it.

This is duplicable by setting up a command like this:

define command {
command_name "mycheck_nrpeversion"
command_line $USER5$/check_nrpe -A /etc/ssl/mycert.pem -D -O -H $HOSTADDRESS
}

To work around this problem, you can add a dummy ARG, like this:

define command {
command_name "mycheck_nrpeversion"
command_line $USER5$/check_nrpe -A /etc/ssl/mycert.pem -D -O -H $HOSTADDRESS $ARG1$
}
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: "command type" for imported commands

Post by lmiltchev »

This actually makes sense. We were not able to recreate the issue as we always used args in our commands... The only way nagios can "know" this is a check command is when it has args. Not all commands have args, but most of them do anyway. So, if nagios "doesn't know" what the command is, it sets it as "misc" command. I can confirm that adding an argument, e.g. $ARG1$, fixes the issue.
Probably, this is why the example of a check command (in the GUI) is shown with args.
Example: $USER1$/check_example -H $HOSTADDRESS$ -P $ARG1$ $ARG2$
I am glad that we got to the bottom of this. :) Thanks for reporting the issue and for the feedback!

Is it all right if we locked this topic now since you have a workaround in place?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: "command type" for imported commands

Post by rexconsulting »

Thanks && yes you can lock this one. The workaround is fine.

CP
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
Locked