Servicegroup macro as argument in command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
proquibas
Posts: 18
Joined: Mon Jul 22, 2013 7:52 am

Servicegroup macro as argument in command

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Servicegroup macro as argument in command

Post 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.
Former Nagios employee
proquibas
Posts: 18
Joined: Mon Jul 22, 2013 7:52 am

Re: Servicegroup macro as argument in command

Post 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! :D
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Servicegroup macro as argument in command

Post by tmcdonald »

Try adding the service to the group from the service page and it should work.
Former Nagios employee
proquibas
Posts: 18
Joined: Mon Jul 22, 2013 7:52 am

Re: Servicegroup macro as argument in command

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Servicegroup macro as argument in command

Post 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.
Former Nagios employee
proquibas
Posts: 18
Joined: Mon Jul 22, 2013 7:52 am

Re: Servicegroup macro as argument in command

Post by proquibas »

Thanks!

If I change the last ARG from $SERVICEGROUPNAME$ to $ARG3$ it works fine, but not with servicegroup macro.
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Servicegroup macro as argument in command

Post 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.
Former Nagios employee
proquibas
Posts: 18
Joined: Mon Jul 22, 2013 7:52 am

Re: Servicegroup macro as argument in command

Post by proquibas »

yea! You are right!! In performance data appear the correct ServiceGroupname!!


Thanks a lot!! :D :D
Locked