Skip to main content

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 nameDescriptionExample of contents
$custom_messageInserts into the ticket the message entered by the user in the ticket opening popup
$user.nameInserts into the ticket the name of the user that opens the tickett.rex
$user.aliasInserts into the ticket the alias (login) of the user that opens the tickettrex
$user.emailInserts into the ticket the email address of the user that opens the tickett.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 nameDescription
$host.host_id17
$host.name"Api-Host"
$host.instance_id1
$host.acknowledged0
$host.acknowledgement_type0
$host.action_url""
$host.active_checks1
$host.address"127.0.0.1"
$host.alias"Api-Host"
$host.check_attempt1
$host.check_command"base_host_alive"
$host.check_freshness0
$host.check_interval5
$host.check_period"24x7"
$host.check_type0
$host.checked1
$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_checks1
$host.default_event_handler_enabled1
$host.default_failure_predictionnull
$host.default_flap_detection1
$host.default_notify1
$host.default_passive_checks0
$host.default_process_perfdatanull
$host.display_name"Api-Host"
$host.enabled1
$host.event_handler""
$host.event_handler_enabled1
$host.execution_time0.093993
$host.failure_predictionnull
$host.first_notification_delay0
$host.flap_detection1
$host.flap_detection_on_down1
$host.flap_detection_on_unreachable1
$host.flap_detection_on_up1
$host.flapping0
$host.freshness_threshold0
$host.high_flap_threshold0
$host.icon_image"ppm/operatingsystems-linux-snmp-linux-128.png"
$host.icon_image_alt""
$host.last_check1738599249
$host.last_hard_state0
$host.last_hard_state_change1731601141
$host.last_notificationnull
$host.last_state_change1731601141
$host.last_time_downnull
$host.last_time_unreachablenull
$host.last_time_up1738599251
$host.last_update1735050379
$host.latency0.362
$host.low_flap_threshold0
$host.max_check_attempts3
$host.modified_attributesnull
$host.next_check1738599549
$host.next_host_notificationnull
$host.no_more_notifications0
$host.notes""
$host.notes_url""
$host.notification_interval0
$host.notification_number0
$host.notification_period""
$host.notify1
$host.notify_on_down1
$host.notify_on_downtime1
$host.notify_on_flapping1
$host.notify_on_recovery1
$host.notify_on_unreachable1
$host.obsess_over_host1
$host.output"OK - 127.0.0.1 rta 0,077ms lost 0%\n"
$host.passive_checks0
$host.percent_state_change0
$host.perfdata"rta=0,077ms;3000,000;5000,000;0; pl=0%;80;100;0;100 rtmax=0,077ms;;;; rtmin=0..."
$host.process_perfdatanull
$host.retain_nonstatus_information1
$host.retain_status_information1
$host.retry_interval1
$host.scheduled_downtime_depth0
$host.should_be_scheduled1
$host.stalk_on_down0
$host.stalk_on_unreachable0
$host.stalk_on_up0
$host.state0
$host.state_type1
$host.statusmap_image""
$host.timezone""
$host.real_statenull
$host.host_state0
$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 nameDescription
$service.host_id17
$service.description"Cpu"
$service.service_id124
$service.acknowledged0
$service.acknowledgement_type0
$service.action_url""
$service.active_checks1
$service.check_attempt3
$service.check_command"OS-Linux-SNMP-Cpu"
$service.check_freshness0
$service.check_interval5
$service.check_period"24x7"
$service.check_type0
$service.checked1
$service.command_line"/usr/lib/centreon/plugins//centreon_linux_snmp.pl --plugin=os::linux::snmp::p..."
$service.default_active_checks1
$service.default_event_handler_enabled1
$service.default_failure_predictionnull
$service.default_flap_detection1
$service.default_notify1
$service.default_passive_checks0
$service.default_process_perfdatanull
$service.display_name"Cpu"
$service.enabled1
$service.event_handler""
$service.event_handler_enabled1
$service.execution_time6.185488
$service.failure_predictionnull
$service.failure_prediction_optionsnull
$service.first_notification_delay0
$service.flap_detection1
$service.flap_detection_on_critical1
$service.flap_detection_on_ok1
$service.flap_detection_on_unknown1
$service.flap_detection_on_warning1
$service.flapping0
$service.freshness_threshold0
$service.high_flap_threshold0
$service.icon_image""
$service.icon_image_alt""
$service.last_check1738662813
$service.last_hard_state3
$service.last_hard_state_change1731601229
$service.last_notificationnull
$service.last_state_change1731601229
$service.last_time_criticalnull
$service.last_time_oknull
$service.last_time_unknown1738662813
$service.last_time_warningnull
$service.last_update1738662213
$service.latency0.238
$service.low_flap_threshold0
$service.max_check_attempts3
$service.modified_attributesnull
$service.next_check1738663113
$service.next_notificationnull
$service.no_more_notifications0
$service.notes""
$service.notes_url""
$service.notification_interval0
$service.notification_number17723
$service.notification_period""
$service.notify1
$service.notify_on_critical1
$service.notify_on_downtime1
$service.notify_on_flapping1
$service.notify_on_recovery1
$service.notify_on_unknown1
$service.notify_on_warning1
$service.obsess_over_service1
$service.output"UNKNOWN: SNMP Table Request: Timeout\n"
$service.passive_checks0
$service.percent_state_change0
$service.perfdata""
$service.process_perfdatanull
$service.retain_nonstatus_information1
$service.retain_status_information1
$service.retry_interval1
$service.scheduled_downtime_depth0
$service.should_be_scheduled1
$service.stalk_on_critical0
$service.stalk_on_ok0
$service.stalk_on_unknown0
$service.stalk_on_warning0
$service.state3
$service.state_type1
$service.volatile0
$service.real_statenull
$service.address"127.0.0.1"
$service.host_state0
$service.host_name"Api-Host"
$service.instance_id1
$service.service_state3
$service.state_str"UNKNOWN"
$service.last_state_change_duration"2M 2w"
$service.last_hard_state_change_duration"2M 2w"
$service.num_metrics0