Using arguments in Alias commands NSClient++
-
cfgriffith
- Posts: 83
- Joined: Tue Jan 15, 2013 4:22 pm
Re: Using arguments in Alias commands NSClient++
Ah thats probably the issue, I will get back to you tomorrow after testing.
Re: Using arguments in Alias commands NSClient++
Great. Let us know.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
cfgriffith
- Posts: 83
- Joined: Tue Jan 15, 2013 4:22 pm
Re: Using arguments in Alias commands NSClient++
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?
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?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Using arguments in Alias commands NSClient++
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$
-
cfgriffith
- Posts: 83
- Joined: Tue Jan 15, 2013 4:22 pm
Re: Using arguments in Alias commands NSClient++
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
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++
You don't have to many args - you can have only $ARG1$ in the NSC.ini file, and run a check like so: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$
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client_IP> -c alias_service -a "exclude=<service1> exclude=<service2> exclude=<service3> ..."Be sure to check out our Knowledgebase for helpful articles and solutions!
-
cfgriffith
- Posts: 83
- Joined: Tue Jan 15, 2013 4:22 pm
Re: Using arguments in Alias commands NSClient++
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?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Using arguments in Alias commands NSClient++
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!
-
cfgriffith
- Posts: 83
- Joined: Tue Jan 15, 2013 4:22 pm
Re: Using arguments in Alias commands NSClient++
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.
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.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Using arguments in Alias commands NSClient++
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?