Page 2 of 3
Re: Using arguments in Alias commands NSClient++
Posted: Tue Jun 04, 2013 4:23 pm
by cfgriffith
Ah thats probably the issue, I will get back to you tomorrow after testing.
Re: Using arguments in Alias commands NSClient++
Posted: Tue Jun 04, 2013 4:28 pm
by abrist
Great. Let us know.
Re: Using arguments in Alias commands NSClient++
Posted: Thu Jun 06, 2013 8:27 am
by cfgriffith
So I got it working now with the allow arguments command
On the config:
alias_service = checkServiceState CheckAll "exclude=ShellHWDetection" "exclude=clr_optimization_v4.0.30319_32" "exclude=clr_optimization_v4.0.30319_64" "exclude=clr_optimization_v2.0.50727_32" "exclude=clr_optimization_v4.0.30319_32" "exclude=SysmonLog" "exclude=VMUpgradeHelper" "exclude=HealthService" "exclude=0193831367257817mcinstcleanup" "exclude=iphlpsvc" "exclude=stisvc" "exclude=SplunkForwarder" "exlude=TSM Client Scheduler" "exclude=Contego_Spop" exclude=$ARG1$ exclude=$ARG2$ exclude=$ARG3$
Apparently it works without the quotes on the exclude statements.
On Nagios XI:
check_nrpe!/usr/local/nagios/libexec/check_nrpe -H tsmreport.stkate.pvt -c alias_service -a "IBMWAS70Service - Tivoli Integrated Portal - TIPProfile_Port_16310"
However, I want to know how to utilize the $ARG2$ and $ARG3$ if I have to exclude multiple services, to do that would I just do this?
On Nagios XI:
check_nrpe!/usr/local/nagios/libexec/check_nrpe -H tsmreport.stkate.pvt -c alias_service -a "IBMWAS70Service - Tivoli Integrated Portal - TIPProfile_Port_16310" "Blah1" "Blah2"
or is there additional commands I need to run?
Re: Using arguments in Alias commands NSClient++
Posted: Thu Jun 06, 2013 9:34 am
by slansing
Those additional $ARGs$ can be used in whatever way you like, to add more services "If you want to use the other $ARGs$ instead of the first one in one string, simply add the services there how you have them previously defined. One thing to note, if you really do have all of your services in one double quotation, this may not work.. which means you would have to resort back to just using $ARG1$
Re: Using arguments in Alias commands NSClient++
Posted: Fri Jun 07, 2013 11:56 am
by cfgriffith
So it would only work if I did it this way? "exclude=$ARG1$" "exclude=$ARG2$" "exclude=$ARG3$" and not this way? exclude=$ARG1$ exclude=$ARG2$ exclude=$ARG3$
For more than one service exclusion: which is currently work, just its not currently at quotes and at the end of the command like this: exclude=$ARG1$
And what would the command I use to call that up look like? Like this: check_nrpe!/usr/local/nagios/libexec/check_nrpe -H tsmreport.stkate.pvt -c alias_service -a "IBMWAS70Service - Tivoli Integrated Portal - TIPProfile_Port_16310" "Blah1" "Blah2"
to exclude the additional service Blah1 and Blah2
Re: Using arguments in Alias commands NSClient++
Posted: Fri Jun 07, 2013 12:52 pm
by lmiltchev
So it would only work if I did it this way? "exclude=$ARG1$" "exclude=$ARG2$" "exclude=$ARG3$" and not this way? exclude=$ARG1$ exclude=$ARG2$ exclude=$ARG3$
For more than one service exclusion: which is currently work, just its not currently at quotes and at the end of the command like this: exclude=$ARG1$
You don't have to many args - you can have only $ARG1$ in the NSC.ini file, and run a check like so:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client_IP> -c alias_service -a "exclude=<service1> exclude=<service2> exclude=<service3> ..."
It's entirely up to you to decide how to set this up.
Re: Using arguments in Alias commands NSClient++
Posted: Tue Jun 11, 2013 1:27 pm
by cfgriffith
Sorry but please clarify, so your saying the example I gave in the post above yours wouldn't work? If it doesn't I should use the example you just provided?
Re: Using arguments in Alias commands NSClient++
Posted: Tue Jun 11, 2013 1:31 pm
by slansing
Yes, he was explaining the reasoning behind using only $ARG1$ in the nsclient++ config files. I would suggest using ludmil's suggestion as it would be the fastest way to get this configured. Don't forget to restart the nsclient++ service after saving the config file!
Re: Using arguments in Alias commands NSClient++
Posted: Thu Jun 13, 2013 9:08 am
by cfgriffith
So, this:
On the config:
alias_service = checkServiceState CheckAll "exclude=ShellHWDetection" "exclude=clr_optimization_v4.0.30319_32" "exclude=clr_optimization_v4.0.30319_64" "exclude=clr_optimization_v2.0.50727_32" "exclude=clr_optimization_v4.0.30319_32" "exclude=SysmonLog" "exclude=VMUpgradeHelper" "exclude=HealthService" "exclude=0193831367257817mcinstcleanup" "exclude=iphlpsvc" "exclude=stisvc" "exclude=SplunkForwarder" "exlude=TSM Client Scheduler" "exclude=Contego_Spop" $ARG1$
Would be fine, even though the ARG is not in quotes, to do this?:
/usr/local/nagios/libexec/check_nrpe -H <client_IP> -c alias_service -a "exclude=<service1> exclude=<service2> exclude=<service3> ..."
If so that's great, although I was under the impression each exclude statement had to be in quotations to work, I.e: "exclude=<service1>" "exclude=<service2>" "exclude=<service3>" If thats not true, than what your suggesting should work.
Let me know if that's what you mean and I'll give it a shot.
Re: Using arguments in Alias commands NSClient++
Posted: Thu Jun 13, 2013 9:13 am
by slansing
They may need to be in quotes themselves, in which case you may need to hard code it in the NSC.ini file. Are you adding an additional group of services in $ARG1$ that you do not have listed already in that big alias_service list? When you manually run a check from the Nagios CLI what does it return?