Inventory hourly to detect dhcp address changes

Kedgar
Contributor

Hello,

In our environment, we have some laptop users and others that may get a
different ip throughout the day. In order to keep the JSS somewhat up to
date I have done the following. Please let me know if you have a better way
of accomplishing this... really I only need the ip change and not all
inventory run.

  1. I copied the /Library/LaunchDaemons/com.jamfsoftware.task.1.plist to a new launch daemon
  2. Modified the trigger to every60 rather than every30
  3. Created a policy on the JSS to run with a custom trigger of every60
  4. Policy is set to run this command:
    1. jamf recon -skipApps -skipFonts -skipPlugins

Right now this is only being tested on my machine. Is anyone doing
something similar? Do you have a better way to do this?

Thanks,
Ken Edgar

6 REPLIES 6

Kedgar
Contributor

Thanks a bunch TomŠ I'm probably not upgrading to 8 for a while yet, but the
jamf log command may be just what I'm looking for.

tlarkin
Honored Contributor

Ken,

I just had to do this myself. First off, in version 8 every time a machine checks in for anything the IP is updated in the JSS. If you aren't running version 8 you can create a policy that runs the jamf command every 30 minutes, 60 minutes, or whatever that updates the IP address

bash-3.2$ jamf help | grep log log Log the IP Address as well as an action to the JSS bash-3.2$

the log command updates the IP address in the JSS that is all you need. No need to fuss with recon at all. So just create a policy and then add the run command

/usr/sbin/jafm log

That is it. If you are running version 8 it does this auto-magically.

-Tom

John_Wetter
Release Candidate Programs Tester

Fairly certain that actually changed in 7.31, not 8.

-John
---------------- Ken,
I just had to do this myself. First off, in version 8 every time a machine checks in for anything the IP is updated in the JSS. If you aren't running version 8 you can create a policy that runs the jamf command every 30 minutes, 60 minutes, or whatever that updates the IP address

bentoms
Release Candidate Programs Tester

Fyi.. The –skipApps recon commands have stopped working as of v7.. (not sure about v8).

Recon will grab all the info specified by your collection preferences in the JSS regardless of any switches you give it.

Regards,
Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883

Kedgar
Contributor

HmmmŠ I can't seem to figure out what is wrong with my launch daemon. It
seems to be running twice an hour within minutes of itself.

Here is my launch daemon. I didn't see any need for the calendar interval
piece that is in the every30 one. I have a policy setup for the every60
trigger on my JSS, and it is only set to run the command "jamf log".

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.jamfsoftware.hourly</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/jamf</string>
<string>policy</string>
<string>-action</string>
<string>every60</string>
<string>-randomDelaySeconds</string>
<string>300</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
<key>UserName</key>
<string>root</string>
</dict>
</plist>

Thank you all again!

![external image link](attachments/2bb1c39cdaa343c9add809504d9d79c6)

tlarkin
Honored Contributor

Why not just use the JSS to run command? Then have it run random every
60 minutes? Seems like a lot easier than pushing out a launchd item