Giter Site home page Giter Site logo

cacher1013teams's Introduction

Cacher - High Sierra Edition

Updated Cacher to support High Sierra. This version will not support the old version of Caching Service using the Server app. Cacher is a python script that will parse the OS X Caching Server debug logs and present you (to the best of its abilities) serving statistics.

High Sierra Apple Caching Log reporting

Some of the things Cacher can display:

  • Total bandwidth served to clients
  • Total bandwidth requested from Apple
  • Total bandwidth requested from other Caching servers
  • Total IP Addresses
  • Total Unique IP Addresses.
  • Total iOS download requests including model type
  • Total OS download requests specified by type (iOS and macOS)
  • Total applications downloaded from Apple Configurator 2 devices
  • Total downloaded files
  • Total eBook (.epub) files
  • Total personal iCloud files
  • Total package (.pkg) files
  • Total iOS application (.ipad) files
  • Total Zip (.zip) files
  • Total unique downloaded files
  • Total unique eBook (.epub) files
  • Total unique personal iCloud files
  • Total unique package (.pkg) files
  • Total unique iOS application (.ipad) files
  • Total unique Zip (.zip) files

Only for Unified Logging (ie. 10.13 and higher)

Cacher currently supports 10.13

Usage

Usage: cacher.py [options]

Options:
  -h, --help            show this help message and exit
  --targetdate=TARGETDATE
                        Optional: Date to parse. Example: 2017-01-15.
  --deviceids           Optional: Use Device IDs (Ex: iPhone7,2). Defaults to:
                        False
  --nostdout            Optional: Do not print to standard out
  --slackalert          Optional: Use Slack
  --slackwebhook=SLACKWEBHOOK
                        Optional: Slack Webhook URL. Requires Slack Option.
  --slackusername=SLACKUSERNAME
                        Optional: Slack username. Defaults to Cacher. Requires
                        Slack Option.
  --slackchannel=SLACKCHANNEL
                        Optional: Slack channel. Can be username or channel
                        Ex. #channel or @username. Requires Slack Option.
  --proxy=HTTP_PROXY    Optional: Allows you to specify a proxy server if needed
			to push the notifications.
  --teamsalert		Optional: Use Microsft Teams. Need to also specify a webhook
  --teamswebhook=TEAMSWEBHOOK
			Optional: Allows you to push to Microsft Teams webhook.

Optional features

The following are optional features:

Configure Caching service for logging

sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist Verbose -bool True
sudo -u _assetcache defaults write /Library/Preferences/com.apple.AssetCache.plist LogClientIdentity -bool True
AssetCacheManagerUtil reloadSettings
AssetCacheManagerUtil deactivate
AssetCacheManagerUtil activate

Target date

By default, Cacher will use look for logs from the previous date. To target logs from a custom date, use the --targetdate option.

cacher.py --targetdate "2016-11-28"

Log path (High Sierra)

In this version of Cacher logs are collected by running the log command.

log show  --predicate 'subsystem == "com.apple.AssetCache"' --debug --info

DeviceIDs

By default, Cacher will use the "Friendly Names" for iOS devices. To use the model Device ID, use the --deviceids option.

cacher.py --deviceids

Device IDs Example:

A total of 3513 iOS downloads were requested from the Caching Server yesterday consisting of:
 A total of 4 Apple TV downloads
 A total of 417 iPad downloads
 A total of 3075 iPhone downloads
 A total of 17 iPod downloads
  4 AppleTV5,3
  4 iPad2,1
  7 iPad2,2
  2 iPad2,3
  5 iPad2,4

Friendly Names Example:

A total of 3513 iOS downloads were requested from the Caching Server yesterday consisting of:
 A total of 4 Apple TV downloads
 A total of 417 iPad downloads
 A total of 3075 iPhone downloads
 A total of 17 iPod downloads
  4 5th Generation Apple TVs
  5 iPad 2nd Generation [M2012 Wifi Revision]
  2 iPad 2nd Generation [Wifi + CDMA]
  7 iPad 2nd Generation [Wifi + GSM]
  4 iPad 2nd Generation [Wifi]

No Standard output

By default, Cacher will print the results to standard out. To skip this use the --nostdout option.

cacher.py --nostdout

Slack alert

By default, Cacher will not send a server alert. To send a server alert, use the --slackalert option.

The slack alert requires two other options to be passed:

  • --slackchannel
  • --slackwebhook

Username or Channel

You can pass both an username or channel via the --slackchannel option: Examples:

  • @erik
  • #cacher

Slack webhook

A slack webhook must be created. To create a webhook, please go here

cacher.py --slackalert \
--slackchannel "@egomez" \
--slackwebhook "https://hooks.slack.com/services/YOURURL"``

Microsoft Teams webhook.

A Microsoft Teams webhook must be created. To create, go to the three dots, Manage Team, add the Webhook from the store, and then copy the URL given.

Proxy support

This adds proxy support to Cacher. This just passes an option to the -x option in Curl, so this will support anything Curl supports.

cacher.py --proxy http://10.0.0.2:8080/

It should also support authentication via

cacher.py --proxy http://username:[email protected]:8080/

Screenshots

Slack Small

Cacher Slack Example Small

Slack Large

Cacher Slack Example Large

Original Server Alert

Cacher Server Alert Example

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.