Along with the original Caching Server, Caching Server 2 has a whole host of options to check the health of the service via the command line. Here’s a few commands you can use the ensure Caching Server 2 is alive and happy!
sudo serveradmin fullstatus caching | grep "Active"
This will return no if the service is in “STARTING” mode, and will not return anything if the service is in “STOPPED” mode.
sudo serveradmin fullstatus caching | grep "StartupStatus"
This should return “OK” if the service is running OK (d’uh, that’s obvious). If the service is in “STARTING” mode, this will return “PENDING”.
sudo serveradmin fullstatus caching | grep "CacheStatus"
This should return “OK” if the cache status is healthy. I’ve tried to break this to get it to return something other than OK but I haven’t been successful. Even deleting the entire
/Library/Server/Caching directory doesn’t cause this to fail.
sudo serveradmin fullstatus caching | grep "CacheFree"
Theoretically Caching Server 2 should never let this dip down to anywhere near zero, but doesn’t mean you can’t monitor it.
sudo serveradmin fullstatus caching | grep "RegistrationStatus"
Typically this only equals 0 when Caching Server 2 has been started for the first time. While 0 (zero), the caching server is talking to Apple to get a GUID and register itself. This process generally takes no longer than two minutes, and will change to a 1 (one) once it has completed registration.
defaults read /Library/Server/Caching/Config/Config.plist LastRegOrFlush
This will tell you the last time Caching Server 2 checked in with Apple and retrieved an updated list of peers (and their status).
Finally, there’s a great debug log that is really verbose in what is happening during any stage of Caching Server’s life. The location of the log is
tail -f it when you’re playing around to see what it does.