JamfReports 0.1.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -3
- data/JamfReports.gemspec +1 -1
- data/README.md +100 -8
- data/images/listAllInstalledApps.png +0 -0
- data/images/listAllInstalledApps_exporttocsv.png +0 -0
- data/images/listofOneInstallApps.png +0 -0
- data/images/totalNumberOfOneInstalledApps.png +0 -0
- data/images/webBrowserReport.png +0 -0
- data/lib/JamfReports/version.rb +1 -1
- data/lib/JamfReports.rb +13 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36bfc7c47df15153e367ff9f91e65fde6e597c9a75bf493a9d8934369d2242dd
|
4
|
+
data.tar.gz: 6dac11a44c6825c79202c044b19d8d745a7427c0ddcdde9d51b349dae14f384d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7374ba89f88a305014d16a8709064e3a60e9865e47a200931331d933a6557ae67c58039d843ea3cdfe27780473afc60e0b17c2ef0128304a442aeb432106ea02
|
7
|
+
data.tar.gz: 344c87ab2ca1469792ac9f991944c2ef32fbb62156c71e637ae20859f47937bfdc5ffa0af21560cd7703054dcf808c86de9fc1e7b0bd54e2b9f72768f3b20585
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
## 0.2.2
|
2
|
+
- Fixed: Documentation updates
|
1
3
|
|
2
|
-
## 0.1.1 (2023.06.28)
|
3
|
-
- Update: update module syntax
|
4
4
|
|
5
|
-
## 0.1
|
5
|
+
## 0.2.1
|
6
|
+
- Fixed: Issue with getting current user
|
7
|
+
|
8
|
+
|
9
|
+
## 0.2.0
|
10
|
+
- Add: Option for `listAllInstalledApps_exporttocsv` that exports the results to the users desktop as a csv file named `Installed Applications Report.csv`
|
11
|
+
|
12
|
+
## 0.1.1
|
13
|
+
- Update: Update module syntax
|
14
|
+
|
15
|
+
## 0.1.0
|
6
16
|
- Initial Build
|
data/JamfReports.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["nls.inbox@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{A gem that uses the Jamf Pro API to generate reports for hosted Jamf Pro instance}
|
13
|
-
spec.homepage = "https://github.com/nlscott/
|
13
|
+
spec.homepage = "https://github.com/nlscott/JamfReports"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
# Specify which files should be added to the gem when it is released.
|
data/README.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
# JamfReports
|
2
2
|
|
3
|
-
|
3
|
+
## Summary
|
4
4
|
|
5
|
-
|
5
|
+
JamfReports is a ruby gem that uses the Jamf Pro API for hosted instances. Currently, it only reports on Applications. Pulling from the `/api/v1/computers-inventory?section=APPLICATIONS` endpoint.
|
6
6
|
|
7
|
+
Future reports may be added.
|
8
|
+
|
9
|
+
---
|
7
10
|
## Installation
|
8
11
|
|
9
12
|
Add this line to your application's Gemfile:
|
@@ -20,20 +23,109 @@ Or install it yourself as:
|
|
20
23
|
|
21
24
|
$ gem install JamfReports
|
22
25
|
|
26
|
+
---
|
23
27
|
## Usage
|
24
28
|
|
25
|
-
|
29
|
+
In order to run JamfReports, you are required to add these two lines to the top of your file, under the require `JamfReports` line
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
#!/usr/bin/ruby
|
33
|
+
require "JamfReports"
|
34
|
+
|
35
|
+
## UPDATE THESE VARIABLES ------------------------------------------------------
|
36
|
+
$jamfpro_url = "https://company.jamfcloud.com"
|
37
|
+
$api_pw = "Your API KEY HERE"
|
38
|
+
```
|
39
|
+
|
40
|
+
If you don't have your api key for the `$api_pw` variable, run this command to create it and paste it into the variable.
|
41
|
+
|
42
|
+
```bash
|
43
|
+
printf "jamfUserName:JamfPassword" | iconv -t ISO-8859-1 | base64 -i -
|
44
|
+
```
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
And these 3 lines to generate the api token and pull the data from Jamf so you can run the report commands.
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
JamfReports.getToken
|
52
|
+
JamfReports.checkTokenExpiration
|
53
|
+
JamfReports.getAllApplicationInventory
|
54
|
+
```
|
55
|
+
|
56
|
+
A full working file might look like this.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
#!/usr/bin/ruby
|
60
|
+
require "JamfReports"
|
61
|
+
|
62
|
+
## UPDATE THESE VARIABLES ------------------------------------------------------
|
63
|
+
$jamfpro_url = "https://company.jamfcloud.com"
|
64
|
+
$api_pw = "Your API KEY HERE"
|
65
|
+
|
66
|
+
## COMMANDS --------------------------------------------------------------------
|
67
|
+
JamfReports.getToken
|
68
|
+
JamfReports.checkTokenExpiration
|
69
|
+
JamfReports.getAllApplicationInventory
|
70
|
+
|
71
|
+
## REPORTS --------------------------------------------------------------------
|
72
|
+
JamfReports.listAllInstalledApps
|
73
|
+
# JamfReports.webBrowserReport
|
74
|
+
# JamfReports.totalNumberOfOneInstalledApps
|
75
|
+
# JamfReports.listofOneInstallApps
|
76
|
+
|
77
|
+
## After reporting, revoke current token
|
78
|
+
JamfReports.invalidateToken
|
79
|
+
```
|
80
|
+
|
81
|
+
|
82
|
+
---
|
83
|
+
## Examples
|
84
|
+
|
85
|
+
#### listAllInstalledApps
|
86
|
+
|
87
|
+

|
88
|
+
|
89
|
+
Returns a sorted list of all apps installed across your fleet of computers in Jamf. Sorted from most installed app, to least.
|
90
|
+
|
91
|
+
#### webBrowserReport
|
92
|
+

|
93
|
+
Returns a list of installed web browsers. Current browsers searched are:
|
94
|
+
- Google Chrome.app
|
95
|
+
- Google Chrome Canary.app
|
96
|
+
- Firefox.app
|
97
|
+
- Firefox Developer Edition.app
|
98
|
+
- Safari.app
|
99
|
+
- Safari Technology Preview.app
|
100
|
+
- Microsoft Edge.app
|
101
|
+
- Brave Browser.app
|
102
|
+
- Arc.app
|
103
|
+
- Opera.app
|
104
|
+
- LinCastor Browser.app
|
105
|
+
- LockDown Browser.app
|
106
|
+
- Tor Browser.app
|
107
|
+
- Vivaldi.app
|
108
|
+
- DuckDuckGo.app
|
109
|
+
|
110
|
+
#### totalNumberOfOneInstalledApps
|
111
|
+

|
112
|
+
Returns a single metric to show the number of "One-off" or single installed apps across your fleet.
|
113
|
+
|
114
|
+
#### listofOneInstallApps
|
115
|
+

|
116
|
+
|
117
|
+
Returns a list of all the "One-off" or single installed apps across your fleet. This can be helpful in scoping in Jamf uninstall policies.
|
118
|
+
|
26
119
|
|
27
|
-
|
120
|
+
#### listAllInstalledApps_exporttocsv
|
121
|
+

|
122
|
+
Using `JamfReports.listAllInstalledApps_exporttocsv` exports the results to the users desktop as a csv file named `Installed Applications Report.csv`
|
28
123
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
124
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
125
|
|
33
|
-
## Contributing
|
34
126
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/JamfReports.
|
36
127
|
|
128
|
+
---
|
37
129
|
## License
|
38
130
|
|
39
131
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/JamfReports/version.rb
CHANGED
data/lib/JamfReports.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "JamfReports/version"
|
2
2
|
require "uri"
|
3
|
+
require 'etc'
|
3
4
|
require "json"
|
4
5
|
require "time"
|
5
6
|
require "net/http"
|
@@ -149,5 +150,17 @@ module JamfReports
|
|
149
150
|
end
|
150
151
|
end
|
151
152
|
end
|
153
|
+
|
154
|
+
def self.listAllInstalledApps_exporttocsv
|
155
|
+
$currentUser=Etc.getlogin
|
156
|
+
reportName="Installed Applications Report"
|
157
|
+
$reportPath="/Users/#{$currentUser}/Desktop/#{reportName}.csv"
|
158
|
+
File.write("#{$reportPath}", "name,count\n")
|
159
|
+
|
160
|
+
$applicationHash.sort_by {|_key, value| value}.reverse.each do |k,v|
|
161
|
+
open("#{$reportPath}", "a") { |f| f << "#{k},#{v}\n" }
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
152
165
|
|
153
166
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: JamfReports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nic scott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,9 +53,14 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- bin/console
|
55
55
|
- bin/setup
|
56
|
+
- images/listAllInstalledApps.png
|
57
|
+
- images/listAllInstalledApps_exporttocsv.png
|
58
|
+
- images/listofOneInstallApps.png
|
59
|
+
- images/totalNumberOfOneInstalledApps.png
|
60
|
+
- images/webBrowserReport.png
|
56
61
|
- lib/JamfReports.rb
|
57
62
|
- lib/JamfReports/version.rb
|
58
|
-
homepage: https://github.com/nlscott/
|
63
|
+
homepage: https://github.com/nlscott/JamfReports
|
59
64
|
licenses:
|
60
65
|
- MIT
|
61
66
|
metadata: {}
|