Inventory collection, timing

dpertschi
Valued Contributor

Kind of a newbie here, should be a simple thing....

I have a policy for all managed clients to update inventory once a day. A few days ago I added an Extension Attribute to the Inventory Collection prefs to retrieve the last user, and it works.

But, not all the clients seem to be reporting, some are and some are not, even though they're checking in at the same time. Not everyone who checked in yesterday, reported this new info, though some did.

Any suggestions what to look for here, thanks a lot,

Darrin

5 REPLIES 5

paulaust
New Contributor

I created a special policy called quick inventory to help gather an up to
date inventory quickly. I have it set to every15, run once per machine and
scoped to call machines. All that is in the policy is to run recon. When I
need a quick inventory, I just flush the policy history for the policy.
This way if I make a change that I want to get a quick update for like
adding an extended attribute. Hope this helps.

Paul Austin

End User Computing, Platform Engineering

Wells Fargo | 1525 West W.T. Harris Blvd | Charlotte, NC 28262
MAC D1112-036
Tel 704 427-0903

paul.austin at wellsfargo.com

sean
Valued Contributor

Darrin,

How are you calling this information?

Need to see the script

Sean

dpertschi
Valued Contributor

Feel free to point out a better way, scripting is not my specialty...

#!/bin/sh
lastUser=/usr/bin/last -1 -t console | awk '{print $1}'
lastRealuser=dscl /CentrifyDC -read /Users/$lastUser | grep -A 1 RealName:
echo "<result>$lastRealuser</result>"

Again, it is bringing results, just slowly. I don't get why two machines that check in about the same time; one reports the new info and one does not.

thanks,
Darrin

sean
Valued Contributor

Darrin,

I was thinking it may have something to do with how you were obtaining this name, as there are a couple of ways to do this. When you say they aren't reporting, do you mean the attribute is blank or is an old value and should have been updated?

For example, if the name returned is say root, or some other local account, then if they don't exist in your Centrify users, then the answer will be blank and as such you wont have an extensions attribute. So:

lastUser returns root
lastRealuser returns nothing

Do you know that the machines that are incorrect had a user that was last logged in as a Centrify User?

If this is the case, then you'll probably need to query both the local and the Cenrtiry directories to get a result.

If you want to check what is happening, then you could echo both lastUser and lastRealuser into the attribute or maybe a temp file.

Sean

dpertschi
Valued Contributor

I see the light, thank you.

Yes, the attribute is blank, and that does not mean the script didn't run or that the client didn't report the result. I need logic in the script to alert me of conditions other than what I'm asking for.

appreciate it....