fleet/cmd/osquery-perf/ubuntu_22.04.tmpl
Victor Lyuboslavsky c8e80a7b6c
Updated agent to send Ubuntu patches and multiple kernels. (#34889)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #34500

osquery-perf changes only

- Updated Ubuntu template to add a patch version. This increases the
number of OS versions in line with customer environments.
- Updated Ubuntu template to send from a set of kernels per agent. This
closer replicates a customer environment with a lot of Linux hosts.
- Updated software versions to be deterministic. Once an agent selects a
software version, then it will use the same version for future checkins.

# Checklist for submitter

## Testing

- [x] QA'd all new/changed functionality manually


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
  * Added embedded Ubuntu 22.04 kernel dataset for agents
  * Implemented consistent software version selection across queries
  * Enhanced kernel data assignment for Ubuntu systems

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-03 13:07:25 -06:00

206 lines
4.6 KiB
Cheetah

{{ define "enroll" -}}
{
"enroll_secret": "{{ .EnrollSecret }}",
"host_details": {
"os_version": {
"arch": "x86_64",
"build": "",
"codename": "jammy",
"major": "22",
"minor": "4",
"name": "Ubuntu",
"patch": "{{ .OSPatchLevel }}",
"platform": "ubuntu",
"platform_like": "debian",
"version": "22.04.{{ .OSPatchLevel }} LTS"
},
"osquery_info": {
"build_distro": "centos7",
"build_platform": "linux",
"config_hash": "",
"config_valid": "0",
"extensions": "inactive",
"instance_id": "{{ .UUID }}",
"pid": "12947",
"platform_mask": "21",
"start_time": "1580931224",
"uuid": "{{ .UUID }}",
"version": "5.5.1",
"watcher": "-1"
},
"platform_info": {
},
"system_info": {
"computer_name": "{{ .CachedString "hostname" }}",
"cpu_brand": "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz",
"cpu_logical_cores": "8",
"cpu_physical_cores": "4",
"cpu_subtype": "Intel x86-64h Haswell",
"cpu_type": "x86_64h",
"hardware_model": "",
"hardware_serial": "{{ .SerialNumber }}",
"hardware_vendor": "",
"hardware_version": "",
"hostname": "{{ .CachedString "hostname" }}",
"local_hostname": "{{ .CachedString "hostname" }}",
"physical_memory": "17179869184",
"uuid": "{{ .UUID }}"
}
},
"host_identifier": "{{ .UUID }}",
"platform_type": "16"
}
{{- end }}
{{ define "fleet_detail_query_network_interface_unix" -}}
[
{
"address":"fe80::8cb:112d:ff51:1e5d%en0",
"mac":"f8:2d:88:93:56:5c"
}
]
{{- end }}
{{ define "fleet_detail_query_os_version" -}}
[
{
"arch": "x86_64",
"build": "",
"codename": "jammy",
"major": "22",
"minor": "4",
"name": "Ubuntu",
"patch": "{{ .OSPatchLevel }}",
"platform": "ubuntu",
"platform_like": "debian",
"version": "22.04.{{ .OSPatchLevel }} LTS"
}
]
{{- end }}
{{ define "fleet_detail_query_os_unix_like" -}}
[
{
"name":"Ubuntu",
"version":"22.04.{{ .OSPatchLevel }} LTS",
"major":"22",
"minor":"4",
"patch":"{{ .OSPatchLevel }}",
"build":"",
"platform":"ubuntu",
"arch":"x86_64",
"kernel_version":"5.10.76-linuxkit"
}
]
{{- end }}
{{ define "fleet_detail_query_osquery_flags" -}}
[
{
"name":"config_refresh",
"value":"{{ printf "%.0f" .ConfigInterval.Seconds }}"
},
{
"name":"distributed_interval",
"value":"{{ printf "%.0f" .QueryInterval.Seconds }}"
},
{
"name":"logger_tls_period",
"value":"99999"
}
]
{{- end }}
{{ define "fleet_detail_query_osquery_info" -}}
[
{
"pid":"11287",
"uuid":"{{ .UUID }}",
"instance_id":"{{ .UUID }}",
"version":"5.5.1",
"config_hash":"b01efbf375ac6767f259ae98751154fef727ce35",
"config_valid":"1",
"extensions":"inactive",
"build_platform":"linux",
"build_distro":"centos7",
"start_time":"1582857555",
"watcher":"-1",
"platform_mask":"9"
}
]
{{- end }}
{{ define "fleet_detail_query_system_info" -}}
[
{
"hostname":"{{ .CachedString "hostname" }}",
"uuid":"{{ .UUID }}",
"cpu_type":"x86_64h",
"cpu_subtype":"Intel x86-64h Haswell",
"cpu_brand":"Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz",
"cpu_physical_cores":"4",
"cpu_logical_cores":"8",
"cpu_microcode":"",
"physical_memory":"17179869184",
"hardware_vendor":"",
"hardware_model":"",
"hardware_version":"",
"hardware_serial":"{{ .SerialNumber }}",
"computer_name":"{{ .CachedString "hostname" }}",
"local_hostname":"{{ .CachedString "hostname" }}"
}
]
{{- end }}
{{ define "fleet_detail_query_uptime" -}}
[
{
"days":"0",
"hours":"4",
"minutes":"38",
"seconds":"11",
"total_seconds":"16691"
}
]
{{- end }}
{{/* all hosts */}}
{{ define "fleet_label_query_6" -}}
[
{
"1": "1"
}
]
{{- end }}
{{/* All macOS hosts */}}
{{ define "fleet_label_query_7" -}}
[]
{{- end }}
{{/* All Ubuntu hosts */}}
{{ define "fleet_label_query_8" -}}
[
{
"1": "1"
}
]
{{- end }}
{{/* All CentOS hosts */}}
{{ define "fleet_label_query_9" -}}
[]
{{- end }}
{{/* All Windows hosts */}}
{{ define "fleet_label_query_10" -}}
[]
{{- end }}
{{/* All Red Hat hosts */}}
{{ define "fleet_label_query_11" -}}
[]
{{- end }}
{{/* All Linux distributions */}}
{{ define "fleet_label_query_12" -}}
[
{
"1": "1"
}
]
{{- end }}