-
Notifications
You must be signed in to change notification settings - Fork 1.4k
SW inventory for MacOS #45533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 31 commits into
main
from
hongshi/mac_sw_inventory
Mar 4, 2026
Merged
SW inventory for MacOS #45533
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a4415c5
SW inventory for MacOS
guohdd 0291f92
fix CI failures
guohdd 2a05318
fix CI failures #2
guohdd 7b47710
remove release notes
guohdd a4c884a
enable sw inventory for macos
guohdd fe8b555
use command_notwin.go for cleaner solution
guohdd 6fb15f4
fix sw inventory filter
guohdd f1b955f
refine the acope of SW inventory
guohdd 38f6fa8
ordered output and consistent installation time
guohdd 04475d7
text template fix and system app addition
guohdd b6e04b2
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd 3f22692
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd a95bf2a
changes per code review: bounded parallel processing; removed codesig…
guohdd 703da49
added test for private fields
guohdd bc14af8
removed unused function
guohdd 0f681cb
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd 24aa527
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd fb47576
lint issue
guohdd 4618114
hide private fields to align with Windows implementation
guohdd dc9291f
InstallSource for system apps
guohdd 5d70a35
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd 572f701
avoid reading plist twice
guohdd 293015d
new wire type for agent–system-probe comminucation of sw inventory
guohdd d56a499
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd b19d5a4
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd 0ae9eed
changes per code review
guohdd 75a8826
code format
guohdd 68744b9
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd 4b2343a
changes #2 per code review
guohdd 0407b64
get data from top-level dict in parsePlistToMap()
guohdd 8085495
Merge branch 'main' into hongshi/mac_sw_inventory
guohdd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
comp/softwareinventory/impl/status_templates/inventory.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| {{- $swMap := index . "software_inventory_metadata" }} | ||
| {{- if index $swMap "error" }} | ||
| Error refreshing software inventory: {{ index $swMap "error" }} | ||
| {{- else }} | ||
| {{- $count := 0 }} | ||
| {{- range $productCode, $meta := $swMap }} | ||
| {{- $count = add $count 1 }} | ||
| {{- $total := index . "software_inventory_total" }} | ||
| {{- $stats := index . "software_inventory_stats" }} | ||
| {{- $broken := index . "software_inventory_broken" }} | ||
| Detected {{ $total }} installed software entries{{- if $broken }} ({{ $broken }} broken){{- end }}. | ||
|
|
||
| By type: | ||
| {{- range $type, $count := $stats }} | ||
| {{ $type }}: {{ $count }} | ||
| {{- end }} | ||
| Detected {{ $count }} installed software entries. | ||
|
|
||
| The full list is not displayed in this status output, but is available in a flare, the Agent status page in the GUI, or in the Datadog Application. | ||
| {{- end }} |
76 changes: 51 additions & 25 deletions
76
comp/softwareinventory/impl/status_templates/inventoryHTML.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,57 @@ | ||
| <div class="stat"> | ||
| <span class="stat_title">Software Inventory Metadata</span> | ||
| <div class="stat_data inventory-scrollbox" style="max-height: 400px; overflow-y: auto;"> | ||
| {{- $swMap := index . "software_inventory_metadata" }} | ||
| {{- if index $swMap "error" }} | ||
| <div>Error refreshing software inventory: {{ index $swMap "error" }}</div> | ||
| {{- else }} | ||
| {{- range $productCode, $meta := $swMap }} | ||
| <details> | ||
| <summary> | ||
| {{- if $meta.DisplayName }}{{ $meta.DisplayName }}{{ if $meta.Version }} {{ $meta.Version }}{{ end }}{{- else }}{{ $meta.ProductCode }}{{- end }} | ||
| {{- if contains $meta.Status "broken" }} | ||
| <span class="source-bubble broken">broken</span> | ||
| {{- end }} | ||
| </summary> | ||
| <ul style="margin:1em 0; padding-left:2em;"> | ||
| {{- if $meta.DisplayName }}<li><strong>Display Name:</strong> {{ $meta.DisplayName }}</li>{{- end }} | ||
| {{- if $meta.Version }}<li><strong>Version:</strong> {{ $meta.Version }}</li>{{- end }} | ||
| {{- if $meta.InstallDate }}<li><strong>Install Date:</strong> {{ $meta.InstallDate }}</li>{{- end }} | ||
| {{- if $meta.Publisher }}<li><strong>Publisher:</strong> {{ $meta.Publisher }}</li>{{- end }} | ||
| {{- if $meta.ProductCode }}<li><strong>Product code:</strong> {{ $meta.ProductCode }}</li>{{- end }} | ||
| {{- if $meta.Source }}<li><strong>Source:</strong> {{ $meta.Source }}</li>{{- end }} | ||
| {{- if $meta.Status }}<li><strong>Status:</strong> {{ $meta.Status }}</li>{{- end }} | ||
| {{- if $meta.UserSID }}<li><strong>User SID:</strong> {{ $meta.UserSID }}</li>{{- end }} | ||
| <li><strong>64-bit:</strong> {{ $meta.Is64Bit }}</li> | ||
| </ul> | ||
| </details> | ||
| {{- $swSlice := .software_inventory_metadata }} | ||
| {{- $total := .software_inventory_total }} | ||
| {{- $stats := .software_inventory_stats }} | ||
| {{- $broken := .software_inventory_broken }} | ||
| {{- if .error }} | ||
| <div>Error refreshing software inventory: {{ .error }}</div> | ||
| {{- else }} | ||
| <div style="margin-bottom: 1em; padding: 0.5em; background: #f5f5f5; border-radius: 4px;"> | ||
| <strong>Summary:</strong> {{ $total }} entries{{- if $broken }} (<span style="color: #d00;">{{ $broken }} broken</span>){{- end }} | ||
| <br/> | ||
| <strong>By type:</strong> | ||
| <ul style="margin: 0.5em 0; padding-left: 2em; list-style: none;"> | ||
| {{- range $type, $count := $stats }} | ||
| <li>{{ $type }}: {{ $count }}</li> | ||
| {{- end }} | ||
| </ul> | ||
| </div> | ||
| <div style="margin-bottom: 1em;"> | ||
| <label for="sw-type-filter"><strong>Filter by type:</strong></label> | ||
| <select id="sw-type-filter" style="margin-left: 0.5em; padding: 0.25em 0.5em; border-radius: 4px; border: 1px solid #ccc;"> | ||
| <option value="">All ({{ $total }})</option> | ||
| {{- range $type, $count := $stats }} | ||
| <option value="{{ $type }}">{{ $type }} ({{ $count }})</option> | ||
| {{- end }} | ||
| </select> | ||
| <span id="sw-filter-count" style="margin-left: 1em; color: #666;"></span> | ||
| </div> | ||
| <div id="sw-entries-container" class="stat_data inventory-scrollbox" style="max-height: 400px; overflow-y: auto;"> | ||
| {{- range $meta := $swSlice }} | ||
| <details class="sw-entry" data-sw-type="{{ $meta.Source }}"> | ||
| <summary> | ||
| {{- if $meta.DisplayName }}{{ $meta.DisplayName }}{{ if $meta.Version }} {{ $meta.Version }}{{ end }}{{- else }}{{ $meta.ProductCode }}{{- end }} | ||
| {{- if contains $meta.Status "broken" }} | ||
| <span class="source-bubble broken">broken</span> | ||
| {{- end }} | ||
| </summary> | ||
| <ul style="margin:1em 0; padding-left:2em;"> | ||
| {{- if $meta.DisplayName }}<li><strong>Display Name:</strong> {{ $meta.DisplayName }}</li>{{- end }} | ||
| {{- if $meta.Version }}<li><strong>Version:</strong> {{ $meta.Version }}</li>{{- end }} | ||
| {{- if $meta.InstallDate }}<li><strong>Install Date:</strong> {{ $meta.InstallDate }}</li>{{- end }} | ||
| {{- if $meta.Publisher }}<li><strong>Publisher:</strong> {{ $meta.Publisher }}</li>{{- end }} | ||
| {{- if $meta.ProductCode }}<li><strong>Product code:</strong> {{ $meta.ProductCode }}</li>{{- end }} | ||
| {{- if $meta.Source }}<li><strong>Source:</strong> {{ $meta.Source }}</li>{{- end }} | ||
| {{- if $meta.Status }}<li><strong>Status:</strong> {{ $meta.Status }}</li>{{- end }} | ||
| {{- if $meta.BrokenReason }}<li><strong>Broken Reason:</strong> <span style="color: #d00;">{{ $meta.BrokenReason }}</span></li>{{- end }} | ||
| {{- if $meta.UserSID }}<li><strong>User SID:</strong> {{ $meta.UserSID }}</li>{{- end }} | ||
| {{- if $meta.InstallPath }}<li><strong>Install Path:</strong> {{ $meta.InstallPath }}</li>{{- end }} | ||
| {{- if $meta.InstallPaths }}<li><strong>Install Paths:</strong><ul style="margin: 0.25em 0; padding-left: 1.5em;">{{- range $meta.InstallPaths }}<li>{{ . }}</li>{{- end }}</ul></li>{{- end }} | ||
| <li><strong>64-bit:</strong> {{ $meta.Is64Bit }}</li> | ||
| </ul> | ||
| </details> | ||
| {{- end }} | ||
| </div> | ||
| {{- end }} | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.