erikng / Cacher

A python script for extracting macOS Caching Server data
Apache License 2.0
134 stars 40 forks source link

macOS High Sierra support #47

Open nstrauss opened 6 years ago

nstrauss commented 6 years ago

Since the caching service was removed from Server in 10.13 log location has moved as well, breaking Cacher. Any plans to update Cacher for 10.13? Thanks!

erikng commented 6 years ago

Ah yes that is right. It will probably take a decent amount of work, and at the moment I don’t have any time to commit.

I welcome any help if possible.

grahamr commented 6 years ago

I have not upgraded any servers to HS - Does it still use the SQLLite DB for data storage and reporting? or is it a straight up log change?

erikng commented 6 years ago

I don’t use cacher right now so I would suggest testing on a machine before upgrading and report about how it works.

grahamr commented 6 years ago

digging into the code a bit i see lots of little hooks that will cause issues, server.app is no longer needed being the big one. I will be doing a HS test server this week, so ill see if the log file is at least the same format - that could make it a bit easier... thought not a cake walk

grahamr commented 6 years ago

I'm actually stumped on this one - I can't find any debug logs or even the metrics DB the old server used.

Best guidance I can find is this: log show --predicate 'subsystem == "com.apple.AssetCache"'

Which is parsing out of the whole system log - I reached out to our enterprise support at apple to see what they had to say, maybe there is still hope, but it's not looking like it.

darkmind-io commented 6 years ago

To get debug and info logs you need to add the --debug and --info to the end of the log command log show --predicate 'subsystem == "com.apple.AssetCache"' --debug --info

You can also stream the logs similar to the tail -f command log stream --predicate 'subsystem == "com.apple.AssetCache"' --debug --info

darkmind-io commented 6 years ago

I added support for High Sierra here (https://github.com/darkmind-io/Cacher). I did not take anytime to make it compatible with the old versions of apple caching or the setup the configuration option. But it appears to be working for me. If you update your app to support Unified Logging I would be happy to remove mine. 99% of the code is still yours.

erikng commented 6 years ago

Joseph,

Send me a PR. I honestly have no care about breaking support for older operating systems given that users can use the prior version.

What I can do is issue a version for the current commits and then issue a new version with your PR and just put it in the release notes.

Thanks, Erik Gomez


From: Joseph Clark notifications@github.com Sent: Thursday, November 16, 2017 4:31:20 PM To: erikng/Cacher Cc: Erik Gomez; Comment Subject: Re: [erikng/Cacher] macOS High Sierra support (#47)

I added support for High Sierra here (https://github.com/darkmind-io/Cacher). I did not take anytime to make it compatible with the old versions of apple caching or the setup the configuration option. But it appears to be working for me. If you update your app to support Unified Logging I would be happy to remove mine. 99% of the code is still yours.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/issues/47#issuecomment-345084156, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GPD4Xpd-HgRpPBDX9FLPdf_Rzs7-ks5s3Le3gaJpZM4PbY9c.

jefzo commented 6 years ago

Hi @erikng @darkmind-io ,

You have done a great job !! The only point is missing regarding in my opinion is a data summary since the server started not the service... I have tried, to play with the Metrique.sql database but it keep reseting and fake the result !

Exemple information I need in my case :

Cacher has retrieved the following stats since Production Run: Total Download From Apple To Client : 459.9 MB Total Download From Cache To Client : 22.9 MB

Caching Server Data: 2017-12-11 Cacher has retrieved the following stats for 2017-12-11:

192.4 MB of bandwith served to client devices. 186.0 MB of bandwith requested from Apple 0.0 bytes of bandwith requested from other Caching Servers

5 IP Addresses hit the Caching Server yesterday consisting of: 5 Unique IP Addresses.

A total of 5 iOS downloads were requested from the Caching Server yesterday consisting of: A total of 5 iPhone downloads 1 iPhone 6 2 iPhone 6S 2 iPhone 7 [GSM]

A total of 5 OS downloads were requested from the Caching Server yesterday consisting of: 5 iOS downloads: 1 iOS 10.3.2 1 iOS 10.3.3 3 iOS 11.1.2

A total of 5 files were downloaded from the Caching Server yesterday consisting of: 3 .ipa files 2 .zip files

A total of 5 unique files were downloaded from the Caching Server yesterday consisting of: 3 .ipa files 2 .zip files

Cacher ver sion: 3. 0.4 Uptime: 12 days

Cacher has retrieved the following stats since Production Run: Total Download From Apple To Client : 459.9 MB Total Download From Cache To Client : 22.9 MB

Many thanks in advance for your help

Jeff