Page 1 of 1
Servicegroup macro as argument in command
Posted: Thu Jun 26, 2014 2:23 am
by proquibas
Hi all!
I want to output the SERVICEGROUP NAME assigned to a service trhough a service check command like an ARGx.
I tried: check_command -H $HOSTNAME$ -S $ARG1$ -C $ARG3$ -Y $SERVICEGROUPNAME$.
But when I execute the command it shows me the "$" simbol.
There's a way to output these information?
Re: Servicegroup macro as argument in command
Posted: Thu Jun 26, 2014 2:47 pm
by tmcdonald
How are you executing the command? The Test Check Command from the web UI has a lot of issues with it in terms of escaping and permissions, and if the service is assigned to a servicegroup from the service groups page (as opposed to through the service page) it will not have an entry for SERVICEGROUPNAME.
Re: Servicegroup macro as argument in command
Posted: Fri Jun 27, 2014 1:06 am
by proquibas
Hi,
Thanks for the reply.
I execute the command by the test check and no output for the $SERVICEGROUPNAME$ macro. The service is assigned from the service group page, may be I have to try to add through the service page? No other way exists to make it work?
Thanks a lot!

Re: Servicegroup macro as argument in command
Posted: Fri Jun 27, 2014 9:18 am
by tmcdonald
Try adding the service to the group from the service page and it should work.
Re: Servicegroup macro as argument in command
Posted: Tue Jul 01, 2014 4:52 am
by proquibas
Hi,
I tried to recreate all servicegroups and add the service to the groups from the service configuration page.
I launch then the check and it continues showing the $ simbol in the output

The macro is $SERVICEGROUPNAME$ ?
thanks.
Re: Servicegroup macro as argument in command
Posted: Tue Jul 01, 2014 9:27 am
by tmcdonald
That looks correct. Can you take two screenshots for me? One of the ARGs page where you have $SERVICEGROUPNAME$ entered and one of you testing the command like you normally would.
Re: Servicegroup macro as argument in command
Posted: Wed Jul 02, 2014 1:22 am
by proquibas
Thanks!
If I change the last ARG from $SERVICEGROUPNAME$ to $ARG3$ it works fine, but not with servicegroup macro.
Re: Servicegroup macro as argument in command
Posted: Wed Jul 02, 2014 12:56 pm
by tmcdonald
What happens when you view the service under Home->Service Details? Clicking the service name there should let you view the output. If the $ is still showing up there it could be a bug, but as I said before using the Test Check Command button does not always work.
Re: Servicegroup macro as argument in command
Posted: Fri Jul 04, 2014 4:39 am
by proquibas
yea! You are right!! In performance data appear the correct ServiceGroupname!!
Thanks a lot!!
