Page 1 of 2

nsclient++ check_always_ok syntax

Posted: Sun Jan 25, 2015 6:42 pm
by td3201
I'm trying to ensure that a plugin check always returns OK. Here's what I'm trying to do:
[root@omaprodut01 objects]# /usr/lib/nagios/plugins/check_nrpe -H 10.20.37.7 -c check_always_ok -a "check_memory" "type=physical" "warn=free<2M" "crit=free<1M"
Invalid command line: unrecognised option 'check_memory'
help Show help screen (this screen)
help-pb Show help screen as a protocol buffer payload
help-short Show help screen (short format).


Clearly what I'm doing here isn't correct. What's the right way to do what I'm trying to do here?

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 10:48 am
by scottwilkerson
Can you post the nsclient++ command definition for check_always_ok

Thanks

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 11:08 am
by lgroschen
for -a:

Code: Select all

 [arglist]  = Optional arguments that should be passed to the command.  Multiple
              arguments should be separated by a space.  If provided, this must be
              the last option supplied on the command line.
so just send into -a "$ARG1$ $ARG2$ $ARG3$ $ARG4$"

So yours would look like:

Code: Select all

 /usr/lib/nagios/plugins/check_nrpe -H 10.20.37.7 -c check_always_ok -a "check_memory type=physical warn=free<2M crit=free<1M"
What matters here is how you have the arguments defined in check_always_true because you might need type to be type=physical OR just physical if in the command definition it is being passed as type=$ARG2$. Do this for each argument, then post the check_always_ok definition and the command that your run here.

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 11:26 am
by td3201
I appreciate your help. I'm not following what you're suggesting. check_always_ok is a builtin command within nsclient++ so it's not defined within the nsclient.ini explicity. The documentation for nsclient++ is miserable at best. Or I can't read it.

http://www.nsclient.org/trac/tmp/refere ... ys_ok.html

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 11:48 am
by slansing
Unfortunately, as NSClient++ is not maintained by us, nor does that help page show anything that is helpful when it comes to syntax, I have no idea. I'd recommend contacting their team on their support forum to get some information, I'll also try poking around to see what I can get it to do.

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 11:52 am
by lgroschen
Does this make more sense:
http://nsclient.org/nscp/wiki/CheckHelp ... _always_ok

An alias for that command is CheckAlwaysOK you could try running it using that.

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 2:33 pm
by td3201
I may just write a shell wrapper to do the same thing.

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 2:45 pm
by td3201
I should probably ask. I've been out of the Nagios loop for a couple of years. Is nsclient++ still one of the better agents for windows? Any others out there or agentless methods that I should be aware of?

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 4:07 pm
by abrist
There are a few big ones:
nsclient (I still prefer 0.3.9.x instead of 0.4.x.x)
ncpa (new, written by the wizard nscott in python and becoming more stable by the day)
wmi ("agentless" but requires configuring wmi on the windows server)
snmp (now deprecated by microsoft)

Re: nsclient++ check_always_ok syntax

Posted: Mon Jan 26, 2015 7:45 pm
by Box293
What version of NSClient++ are you using?