JamfReports 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +92 -8
- data/images/listAllInstalledApps.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 +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 936b1cd3e821dc76f8187a62bb03c0e339fd0d678aa31a212472d774465276eb
|
4
|
+
data.tar.gz: 65406438b5d02ddf0d96c77f9eada5f1ed265e51ab2a292ce9677d10f2e4a904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68d279972dd6b10c469b6938bd4d40551f33ba09769c40125b658e8fe6a25b0b1bc61f199a49b53bdb2476d7668fc711393b185235a0584a8e272be168f08321
|
7
|
+
data.tar.gz: a0d2a54ac9b62b844666dbc9e9d9580d9bfeda7c3b2648e17d2a7ba753458d76027e27ff952c3bb32c6e9acf6e816832414f247558c8e752925e3e0d335fa55b
|
data/CHANGELOG.md
CHANGED
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,101 @@ 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
|
+
![listAllInstalledApps](images/listAllInstalledApps.png)
|
88
|
+
|
89
|
+
Returns a sorted list of all apps installed across your fleet of computers in Jamf. Sorted from most installed app, to least.
|
26
90
|
|
27
|
-
|
91
|
+
#### webBrowserReport
|
92
|
+
![webBrowserReport](images/webBrowserReport.png)
|
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
|
28
109
|
|
29
|
-
|
110
|
+
#### totalNumberOfOneInstalledApps
|
111
|
+
![totalNumberOfOneInstalledApps](images/totalNumberOfOneInstalledApps.png)
|
112
|
+
Returns a single metric to show the number of "One-off" or single installed apps across your fleet.
|
30
113
|
|
31
|
-
|
114
|
+
#### listofOneInstallApps
|
115
|
+
![listofOneInstallApps](images/listofOneInstallApps.png)
|
32
116
|
|
33
|
-
|
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.
|
34
118
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/JamfReports.
|
36
119
|
|
120
|
+
---
|
37
121
|
## License
|
38
122
|
|
39
123
|
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
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: JamfReports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nic scott
|
@@ -53,6 +53,10 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- bin/console
|
55
55
|
- bin/setup
|
56
|
+
- images/listAllInstalledApps.png
|
57
|
+
- images/listofOneInstallApps.png
|
58
|
+
- images/totalNumberOfOneInstalledApps.png
|
59
|
+
- images/webBrowserReport.png
|
56
60
|
- lib/JamfReports.rb
|
57
61
|
- lib/JamfReports/version.rb
|
58
62
|
homepage: https://github.com/nlscott/marshmallow
|