File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 135135 " bundles inventory_unshadowed_users:main"
136136 ]
137137 },
138+ "inventory-windows-services" : {
139+ "description" : " Inventory running Windows services." ,
140+ "subdirectory" : " inventory" ,
141+ "steps" : [
142+ " copy inventory-windows-services.cf services/cfbs/inventory-windows-services/" ,
143+ " policy_files services/cfbs/inventory-windows-services/" ,
144+ " bundles inventory_windows_services_running"
145+ ]
146+ },
138147 "library-for-promise-types-in-bash" : {
139148 "description" : " Library enabling promise types implemented in bash." ,
140149 "subdirectory" : " libraries/bash" ,
Original file line number Diff line number Diff line change 1+ bundle agent inventory_windows_services_running
2+ # @brief Inventory Windows services that are running
3+ # @inventory Windows services running
4+ {
5+ vars:
6+ windows::
7+ "_cache" string => "$(sys.statedir)/windows-services-running.json";
8+
9+ "_data" data => readjson("$(_cache)");
10+ "_indices" slist => getindices(_data);
11+
12+ "i[$(_indices)]"
13+ string => "$(_data[$(_indices)][DisplayName])",
14+ meta => { "inventory", "attribute_name=Windows services running"};
15+
16+
17+ commands:
18+ windows::
19+ "Get-Service | Where-Object {$_.Status -eq 'Running'} | ConvertTo-Json | Set-Content -Path '${_cache}'"
20+ contain => powershell;
21+
22+ }
23+
24+ bundle agent __main__
25+ {
26+ methods:
27+ "inventory_windows_services_running";
28+ }
You can’t perform that action at this time.
0 commit comments