Check for console user every 5 min on Mac client

Total newcomer question but could not find with various google terms.

Want to run a command every 5 minutes on a Mac client to check whether someone is logged in on the console (don’t care about remote or Terminal).

Don’t need help with the command but need to know where to put it and what to surround it with. Telegraf.conf? Someone thought it would go in a file called 5.d since it would run every 5 minutes.

I think the most important bit of information missing from your question is
“what do you want to do with the result of this command?”

You say you do not need help with the command, so I’m assuming you know how to
do it. What do you want to do with the answer from it?


Whether the machines in the lab are being used

So basically the result will have a zero or one for each machine

@daroloson not a Mac user so I don’t know which command to use but basically you want the exec input plugin to execute your command and a suited data_format setting to extract the information from the text.
If you can provide a (redacted) output of the raw command I might be able to help with parsing…

1 Like