macadmins/sashay

Doesn't handle low amount of data cached/stored

Closed this issue · 2 comments

If the amount of data cached or stored is low enough to be listed as bytes in the log instead of KB/MB/GB, it results in this error:

This will be a very spare/boring report if you don't run this command:
                  sudo serveradmin settings caching:LogClientIdentity = 1
['2017-06-20', '09:27:13.810', '#ASDOW8CvyaXH', 'Served', 'all', '530', 'of', '530', 'bytes;', '0', 'from', 'cache,', '530', 'stored', 'from', 'Internet,', '0', 'from', 'peers']
Traceback (most recent call last):
  File "/usr/local/bin/sashay.py", line 378, in <module>
    main()
  File "/usr/local/bin/sashay.py", line 320, in main
    (daily_total_from_cache, daily_total_from_apple, peer_amount) = parse_bandwidth(bandwidth_lines_list, server_vers)
  File "/usr/local/bin/sashay.py", line 176, in parse_bandwidth
    this_loops_fromapple = float(each[14]) / 1024
ValueError: could not convert string to float: from

Will do. It has the same issue, so I'll file a ticket there.