Page 1 of 2

Actions component - unexpected behaviour

Posted: Fri Feb 06, 2015 8:56 am
by mon-team
Hi team

I have configured the action component to get Schelude downtime, actions_url, notes_url, and notes accessible under "Quick Actions".
[img]actions_config.PNG[/img]

When the istruction "... {$showlink=false;}" is applied, all the actions declared after this one don't appear under "Quick Actions" while the expected result is to hide only the action which the code referes to.

It seems that the "$showlink=false;" is applied to the related action and to any other actions defined after it.

Best Regards

Re: Actions component - unexpected behaviour

Posted: Fri Feb 06, 2015 10:26 am
by tmcdonald
Try putting "$showlink=true;" at the top of the next one that needs to show links and see if that helps. This might somewhat be a bug, I just want to confirm whether this is the case.

Re: Actions component - unexpected behaviour

Posted: Fri Feb 06, 2015 10:59 am
by mon-team
Try putting "$showlink=true;" at the top of the next one that needs to show links and see if that helps
doesn't resolve the issue.

Re: Actions component - unexpected behaviour

Posted: Fri Feb 06, 2015 1:58 pm
by lmiltchev
I was able to recreate the issue and just filed an internal bug report (TASK ID 4958).

Update: Try this "patched" component - download the file below:
actions.zip
Don't unzip it. Install it as you would install any other component:

Admin->Manage Components->Browse->actions.zip->Upload Component

Let us know if this fixed your problem.

Re: Actions component - unexpected behaviour

Posted: Fri Feb 27, 2015 10:56 am
by mon-team
It works fine now! Thank you.
Let me ask you another question about action component. It is possible to get macros %servicegroupname% and %hostgroupname% available for this component?

Best Regards

Re: Actions component - unexpected behaviour

Posted: Fri Feb 27, 2015 11:03 am
by abrist
mon-team wrote:t is possible to get macros %servicegroupname% and %hostgroupname% available for this component?
Not currently, but I opened a feature request on our internal tracker:

Code: Select all

TASK ID 5078 - Nagios XI Feature Request: XI: Add servicegroupname and hostgroupname macros to the actions component

Re: Actions component - unexpected behaviour

Posted: Fri Feb 27, 2015 11:24 am
by mon-team
I would like to get these information querying the database "nagios".
I can get all servicegroup_object_id associated to a specific service but not the related servicegroup_name.

Could you give me the query to execute?

Thanks
BR

Re: Actions component - unexpected behaviour

Posted: Fri Feb 27, 2015 1:17 pm
by abrist
Can you post the current query you are using?

Re: Actions component - unexpected behaviour

Posted: Mon Mar 02, 2015 4:04 am
by mon-team
abrist wrote:Can you post the current query you are using?

Code: Select all

SELECT servicegroup_object_id FROM nagios_servicegroups f JOIN (SELECT g.servicegroup_id,s.service_object_id FROM nagios_servicegroup_members g JOIN (SELECT display_name,service_object_id FROM nagios_services WHERE display_name LIKE '" . $_GET["service"] . "' AND host_object_id=(SELECT host_object_id FROM nagios_hosts WHERE display_name LIKE '" . $_GET["host"] . "')) s ON s.service_object_id=g.service_object_id)  q ON q.servicegroup_id=f.servicegroup_id
How can i find out the association servicegroup_object_id - servicegroup_name?

Code: Select all

mysql> desc nagios_servicegroups;
+------------------------+--------------+------+-----+---------+----------------+
| Field                  | Type         | Null | Key | Default | Extra          |
+------------------------+--------------+------+-----+---------+----------------+
| servicegroup_id        | int(11)      | NO   | PRI | NULL    | auto_increment |
| instance_id            | smallint(6)  | NO   | MUL | 0       |                |
| config_type            | smallint(6)  | NO   |     | 0       |                |
| servicegroup_object_id | int(11)      | NO   |     | 0       |                |
| alias                  | varchar(255) | NO   |     |         |                |
+------------------------+--------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

mysql> desc nagios_servicegroup_members;
+------------------------+-------------+------+-----+---------+----------------+
| Field                  | Type        | Null | Key | Default | Extra          |
+------------------------+-------------+------+-----+---------+----------------+
| servicegroup_member_id | int(11)     | NO   | PRI | NULL    | auto_increment |
| instance_id            | smallint(6) | NO   |     | 0       |                |
| servicegroup_id        | int(11)     | NO   | MUL | 0       |                |
| service_object_id      | int(11)     | NO   |     | 0       |                |
+------------------------+-------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

Re: Actions component - unexpected behaviour

Posted: Mon Mar 02, 2015 11:41 am
by abrist
You need to join the nagios.servicegroups.service_object_id with the nagios.nagios_objects.object_id field - select name1 from nagios_objects.
Does that make sense?