Open Tickets Smarty Variables
Here is the list of variables you can use to customize the body of the ticket - via the Body list definition field on the Configuration > Notifications > Open Tickets > Rules page. You can insert information about the resource concerned by the ticket, or about the user creating the ticket. This information comes from Centreon.
Common variables
Common variables can be used to open all types of tickets (i.e. tickets on hosts or services). Use the variable directly in the Body list definition field.
| Variable name | Description | Example of contents |
|---|---|---|
| $custom_message | Inserts into the ticket the message entered by the user in the ticket opening popup | |
| $user.name | Inserts into the ticket the name of the user that opens the ticket | t.rex |
| $user.alias | Inserts into the ticket the alias (login) of the user that opens the ticket | trex |
| $user.email | Inserts into the ticket the email address of the user that opens the ticket | t.rex@jurassic.park |
Tickets on hosts
Opening a ticket on a host generates a table of values. This means you need to use a Smarty foreach loop to access the values (like in the default ticket body). Wrap the variables you want in the following loop:
{foreach from=$host_selected item=host}
{/foreach}
| Variable name | Description |
|---|---|
| $host.host_id | 17 |
| $host.name | "Api-Host" |
| $host.instance_id | 1 |
| $host.acknowledged | 0 |
| $host.acknowledgement_type | 0 |
| $host.action_url | "" |
| $host.active_checks | 1 |
| $host.address | "127.0.0.1" |
| $host.alias | "Api-Host" |
| $host.check_attempt | 1 |
| $host.check_command | "base_host_alive" |
| $host.check_freshness | 0 |
| $host.check_interval | 5 |
| $host.check_period | "24x7" |
| $host.check_type | 0 |
| $host.checked | 1 |
| $host.command_line | "/usr/lib64/nagios/plugins/check_icmp -H 127.0.0.1 -w 3000.0,80% -c 5000.0,100..." |
| $host.default_active_checks | 1 |
| $host.default_event_handler_enabled | 1 |
| $host.default_failure_prediction | null |
| $host.default_flap_detection | 1 |
| $host.default_notify | 1 |
| $host.default_passive_checks | 0 |
| $host.default_process_perfdata | null |
| $host.display_name | "Api-Host" |
| $host.enabled | 1 |
| $host.event_handler | "" |
| $host.event_handler_enabled | 1 |
| $host.execution_time | 0.093993 |
| $host.failure_prediction | null |
| $host.first_notification_delay | 0 |
| $host.flap_detection | 1 |
| $host.flap_detection_on_down | 1 |
| $host.flap_detection_on_unreachable | 1 |
| $host.flap_detection_on_up | 1 |
| $host.flapping | 0 |
| $host.freshness_threshold | 0 |
| $host.high_flap_threshold | 0 |
| $host.icon_image | "ppm/operatingsystems-linux-snmp-linux-128.png" |
| $host.icon_image_alt | "" |
| $host.last_check | 1738599249 |
| $host.last_hard_state | 0 |
| $host.last_hard_state_change | 1731601141 |
| $host.last_notification | null |
| $host.last_state_change | 1731601141 |
| $host.last_time_down | null |
| $host.last_time_unreachable | null |
| $host.last_time_up | 1738599251 |
| $host.last_update | 1735050379 |
| $host.latency | 0.362 |
| $host.low_flap_threshold | 0 |
| $host.max_check_attempts | 3 |
| $host.modified_attributes | null |
| $host.next_check | 1738599549 |
| $host.next_host_notification | null |
| $host.no_more_notifications | 0 |
| $host.notes | "" |
| $host.notes_url | "" |
| $host.notification_interval | 0 |
| $host.notification_number | 0 |
| $host.notification_period | "" |
| $host.notify | 1 |
| $host.notify_on_down | 1 |
| $host.notify_on_downtime | 1 |
| $host.notify_on_flapping | 1 |
| $host.notify_on_recovery | 1 |
| $host.notify_on_unreachable | 1 |
| $host.obsess_over_host | 1 |
| $host.output | "OK - 127.0.0.1 rta 0,077ms lost 0%\n" |
| $host.passive_checks | 0 |
| $host.percent_state_change | 0 |
| $host.perfdata | "rta=0,077ms;3000,000;5000,000;0; pl=0%;80;100;0;100 rtmax=0,077ms;;;; rtmin=0..." |
| $host.process_perfdata | null |
| $host.retain_nonstatus_information | 1 |
| $host.retain_status_information | 1 |
| $host.retry_interval | 1 |
| $host.scheduled_downtime_depth | 0 |
| $host.should_be_scheduled | 1 |
| $host.stalk_on_down | 0 |
| $host.stalk_on_unreachable | 0 |
| $host.stalk_on_up | 0 |
| $host.state | 0 |
| $host.state_type | 1 |
| $host.statusmap_image | "" |
| $host.timezone | "" |
| $host.real_state | null |
| $host.host_state | 0 |
| $host.state_str | "UP" |
| $host.last_state_change_duration | "2M 2w" |
| $host.last_hard_state_change_duration | "2M 2w" |
Tickets on services
Opening a ticket on a service generates a table of values. This means you need to use a Smarty foreach loop to access the values (like in the default ticket body). Wrap the variables you want in the following loop:
{foreach from=$service_selected item=service}
{/foreach}
| Variable name | Description |
|---|---|
| $service.host_id | 17 |
| $service.description | "Cpu" |
| $service.service_id | 124 |
| $service.acknowledged | 0 |
| $service.acknowledgement_type | 0 |
| $service.action_url | "" |
| $service.active_checks | 1 |
| $service.check_attempt | 3 |
| $service.check_command | "OS-Linux-SNMP-Cpu" |
| $service.check_freshness | 0 |
| $service.check_interval | 5 |
| $service.check_period | "24x7" |
| $service.check_type | 0 |
| $service.checked | 1 |
| $service.command_line | "/usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::p..." |
| $service.default_active_checks | 1 |
| $service.default_event_handler_enabled | 1 |
| $service.default_failure_prediction | null |
| $service.default_flap_detection | 1 |
| $service.default_notify | 1 |
| $service.default_passive_checks | 0 |
| $service.default_process_perfdata | null |
| $service.display_name | "Cpu" |
| $service.enabled | 1 |
| $service.event_handler | "" |
| $service.event_handler_enabled | 1 |
| $service.execution_time | 6.185488 |
| $service.failure_prediction | null |
| $service.failure_prediction_options | null |
| $service.first_notification_delay | 0 |
| $service.flap_detection | 1 |
| $service.flap_detection_on_critical | 1 |
| $service.flap_detection_on_ok | 1 |
| $service.flap_detection_on_unknown | 1 |
| $service.flap_detection_on_warning | 1 |
| $service.flapping | 0 |
| $service.freshness_threshold | 0 |
| $service.high_flap_threshold | 0 |
| $service.icon_image | "" |
| $service.icon_image_alt | "" |
| $service.last_check | 1738662813 |
| $service.last_hard_state | 3 |
| $service.last_hard_state_change | 1731601229 |
| $service.last_notification | null |
| $service.last_state_change | 1731601229 |
| $service.last_time_critical | null |
| $service.last_time_ok | null |
| $service.last_time_unknown | 1738662813 |
| $service.last_time_warning | null |
| $service.last_update | 1738662213 |
| $service.latency | 0.238 |
| $service.low_flap_threshold | 0 |
| $service.max_check_attempts | 3 |
| $service.modified_attributes | null |
| $service.next_check | 1738663113 |
| $service.next_notification | null |
| $service.no_more_notifications | 0 |
| $service.notes | "" |
| $service.notes_url | "" |
| $service.notification_interval | 0 |
| $service.notification_number | 17723 |
| $service.notification_period | "" |
| $service.notify | 1 |
| $service.notify_on_critical | 1 |
| $service.notify_on_downtime | 1 |
| $service.notify_on_flapping | 1 |
| $service.notify_on_recovery | 1 |
| $service.notify_on_unknown | 1 |
| $service.notify_on_warning | 1 |
| $service.obsess_over_service | 1 |
| $service.output | "UNKNOWN: SNMP Table Request: Timeout\n" |
| $service.passive_checks | 0 |
| $service.percent_state_change | 0 |
| $service.perfdata | "" |
| $service.process_perfdata | null |
| $service.retain_nonstatus_information | 1 |
| $service.retain_status_information | 1 |
| $service.retry_interval | 1 |
| $service.scheduled_downtime_depth | 0 |
| $service.should_be_scheduled | 1 |
| $service.stalk_on_critical | 0 |
| $service.stalk_on_ok | 0 |
| $service.stalk_on_unknown | 0 |
| $service.stalk_on_warning | 0 |
| $service.state | 3 |
| $service.state_type | 1 |
| $service.volatile | 0 |
| $service.real_state | null |
| $service.address | "127.0.0.1" |
| $service.host_state | 0 |
| $service.host_name | "Api-Host" |
| $service.instance_id | 1 |
| $service.service_state | 3 |
| $service.state_str | "UNKNOWN" |
| $service.last_state_change_duration | "2M 2w" |
| $service.last_hard_state_change_duration | "2M 2w" |
| $service.num_metrics | 0 |