1

tl;dr: Is there a list of serveradmin command *:* commands ?

On mac servers, serveradmin can be quite useful; especially when sending commands to its services, such as serveradmin command smb:command = getConnectedUsers

Apple's outdated (but still useful) command line guide (pdf link) lists these, but a lot has changed since 10.5 ... notably, samba/afp. Some commands which worked up until Mavericks no longer work in Yosemite and beyond.

My search for a list returns a good deal of links up until Mavericks; but, that is not so useful.

Is there anywhere which has compiled the commands for newer versions of the OS?

4
  • No compilation here but check sudo serveradmin settings <service> > <service>.txt (with <service>= web, afp, smb, dns, wiki etc)
    – klanomath
    Commented Aug 18, 2017 at 1:16
  • Yeah, I know about that; but (at least for smb/afp), there's not much correlation between the settings listed and what the commands can (or, past-tense, could) do. Not holding my breath for Apple to update their server docs.
    – Kent
    Commented Aug 18, 2017 at 1:59
  • Are you asking to generate a list from a specific version or to find Apples documentation or to find if someone else has reverse engineered the list?
    – bmike
    Commented Aug 18, 2017 at 11:17
  • What I'm -really- after is if there's a replacement for the AFP/SMB getHistory command that shows throughput over time. But finding a list (official or reverse engineered) seemed like a more general question likely to get a hit somewhere.
    – Kent
    Commented Aug 18, 2017 at 12:04

1 Answer 1

1

Depending on how much spelunking you are willing to do you can look at the html command templates in the servermgrd bundles for a partial list of command names/formats. For example to get a list of commands that the afp plugin accepts you could look at:

/Applications/Server.app/Contents/ServerRoot/usr/share/servermgrd/html/servermgr_afp.html

and look at the javascript in the template.

Look at the selection == "command_name" for the names of the commands and the rest of the commandValue for the plist formatted command. Then you can use the serveradmin command format to send the command to the plugin.

A different (and more up to date) way to find out commands is to look at the Server activity log to see the plist formatted commands sent by Server.app to the servermgrd backend. Look in

~/Library/Logs/Server.log

for the commands and their replies. You may need to turn on the logging from one of the menus (I'm away from my server right now so I'm not sure how I enabled the logging).

If you want network throughput, open Server.app, go to the stats panel, select the network stats and then look at the Server.log to get the commands you need to use.

2
  • Thank you for this post, but could you also tell me where this HTML documents are used? is there a web management available for the Server App?
    – Daywalker
    Commented Oct 23, 2017 at 13:07
  • The HTML documents, afaik, were used for testing the various backend commands. They are a bit out of date. There have been efforts to create a web based management solution for Mac OS X Server, but nothing has come to fruition that I can recall. Commented Oct 24, 2017 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .