Skip to main content

Hello,

we have several host groups per host. We would like to export them via OpenTicket into EasyVista. We have tried parameters such as: {$host.host_group}, {$host.group}, {$service.host_group}, {$host_selected[0].host_group}, {$service_selected[0].host_group} to make them appear in the description on the EasyVista side, but none of them work. Is there a solution to retrieve the host groups of the machines?

 

We also have the option to use lists in OpenTicket. Knowing that only one of the host groups is relevant for ticket entry, we would like to know if filters can allow displaying only the host groups related to the host of the selected service.

 

Best regards.

Hello, 

To answer your second question, unfortunately it won't be possible to use the filters to display only the host groups linked to the host. 

However, the hostgroup names could be displayed in the ticket description by modifying ‘Body list definition’ and adding the following block inside the block corresponding to the opening of a ticket for a service or host: 

{host_get_hostgroups host_id=$host.host_id}
hostgroups: 
{foreach from=host_get_hostgroups_result item=hg}
{$hg}
{/foreach}

For example, this could give :

{$user.alias} open ticket at {$smarty.now|date_format:"%d/%m/%y %H:%M:%S"}

{$custom_message}

{include file="file:$centreon_open_tickets_path/providers/Abstract/templates/display_selected_lists.ihtml" separator=""}

{if $host_selected|@count gt 0}
{foreach from=$host_selected item=host}
Host: {$host.name}
State: {$host.state_str}
Duration: {$host.last_hard_state_change_duration}
Output: {$host.output|substr:0:1024}
{host_get_hostgroups host_id=$host.host_id}
hostgroups: 
{foreach from=$host_get_hostgroups_result item=hg}
{$hg}
{/foreach}


{/foreach}
{/if}

{if $service_selected|@count gt 0}
{foreach from=$service_selected item=service}
Host: {$service.host_name}
Service: {$service.description}
State: {$service.state_str}
Duration: {$service.last_hard_state_change_duration}
Output: {$service.output|substr:0:1024}
{host_get_hostgroups host_id=$service.host_id}
hostgroups: 
{foreach from=$host_get_hostgroups_result item=hg}
{$hg}
{/foreach}
{/foreach}
{/if}

 

Hope it helps ! 


Reply