Primary & last 10 users Linux/Unix

Is there any analysis/relevance which can help in getting name of primary user & last 10 users name from Linux/Unix machines.

“names of local users” returns the list of all users as they are in the /etc/passwd file. What do you mean by getting the first and the last 10? In what order?

Looking of the list of last 10 users who recently logged on that linux box and primary user must be who logged on most recently.

How would you determine this on the command line?

ahhh yeah that will be my second approach if I fail to get it through any relevance code directly from client.

I believe our Unix team must have something to pull out such info using command line & putting them into any file but we want to avoid that.

Any suggestion please related to relevance query.

In order to implement something like this in BigFix, you first have to determine how you would do it manually/normally, such as from a command line. This is what Jason was asking above. Once you have that script or set of commands, then you can proceed to implement it in the Action tab of a Task. There are many examples of executing a Linux script on this board.

You will probably have to stash the results of the command execution in a file, which will be read by an Analysis, so you can get that list of users back to the BigFix Console.

If you post the script here, others on the board can be of more assistance to you.

1 Like

Yeah ! thats my second approach, creating task to generate output & than reading it using analysis.

But what I am actually looking if there is any pre-defined relevance query in BIGFIX which just generate the results (like we have current user or logged in user) directly without running any task 1st in background.

I am unaware of any Analysis or relevance provided with BigFix that will satisfy your requirements.

To discover what the BigFix client does know about users, run the following query in the Fixlet Debugger tool:

properties of type "user"

note the quotes around the term user.

Thanks :slight_smile: