apply Service "lico_cpu" {
 check_command = "lico_cpu"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_cpu"
 vars.get_cpu_load = 1
 vars.get_cpu_util = 1
 vars.get_cpu_core = 1
 vars.get_cpu_hypervisor = 1
}

apply Service "lico_disk" {
 check_command = "lico_disk"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_disk"
 vars.get_disk_total = 1
 vars.get_disk_used = 1
}

apply Service "lico_memory" {
 check_command = "lico_memory"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_memory"
 vars.get_memory_total = 1
 vars.get_memory_used = 1
}

apply Service "lico_health" {
 if (host.vars.bmc.address && host.vars.bmc.user && host.vars.bmc.password) {
  check_command = "lico_health_redfish"
 } else {
  check_command = "lico_health_ipmi"
  vars.get_node_health = 1
 }

 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_health"
}

apply Service "lico_power" {
 if (host.vars.bmc.address && host.vars.bmc.user && host.vars.bmc.password) {
  check_command = "lico_power_redfish"
 } else {
  check_command = "lico_power_ipmi"
  vars.get_node_power = 1
 }

 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_power"
}

apply Service "lico_eth" {
 check_command = "lico_eth"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_eth"
 vars.get_eth_send = 1
 vars.get_eth_recv = 1
}

apply Service "lico_ib" {
 check_command = "lico_ib"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_ib"
 vars.get_ib_send = 1
 vars.get_ib_recv = 1
}

apply Service "lico_temperature" {
 if (host.vars.bmc.address && host.vars.bmc.user && host.vars.bmc.password) {
  check_command = "lico_temperature_redfish"
 } else {
  check_command = "lico_temperature_ipmi"
  vars.get_node_temperature = 1
 }

 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_temperature"
}

apply Service "lico_scheduler" {
 check_command = "lico_scheduler"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_scheduler"
 vars.get_node_job_info = 1
}

apply Service "lico_gpu_output" {
 if (host.vars.gpu.vendor == "intel"){
     check_command = "lico_intel_xpu"

         vars.measurement = "lico_intel_xpu"
         vars.get_xpu_static = 1
 }else{
     check_command = "lico_nvidia_gpu"

         vars.measurement = "lico_nvidia_gpu"
         vars.get_gpu_uuid = 1
         vars.get_gpu_product = 1
         vars.get_gpu_driver = 1
         vars.get_gpu_pcie = 1
         vars.get_mig_profile = 1
 }
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint
}

apply Service "lico_gpu_perf" {
 if (host.vars.gpu.vendor == "intel"){
     check_command = "lico_intel_xpu"

     vars.measurement = "lico_intel_xpu"
         vars.get_xpu_dynamic = 1
         vars.get_xpu_tile = 1
 }else{
     check_command = "lico_nvidia_gpu"

     vars.measurement = "lico_nvidia_gpu"
         vars.get_gpu_util = 1
         vars.get_gpu_temperature = 1
         vars.get_gpu_used_memory = 1
         vars.get_gpu_total_memory = 1
         vars.get_gpu_proc_number = 1
         vars.get_gpu_util_memory = 1
         vars.get_mig_sm_count = 1
         vars.get_mig_used_memory = 1
         vars.get_mig_total_memory = 1
         vars.get_mig_proc_number = 1
         vars.get_mig_mode = 1
 }
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint
}

apply Service "lico_vnc" {
 check_command = "lico_vnc"
 max_check_attempts = 5
 check_interval = 30s
 retry_interval = 30s
 assign where host.vars.agent_endpoint
 command_endpoint = host.vars.agent_endpoint

 vars.measurement = "lico_vnc"
 vars.get_node_vnc_info = 1
}