update IP adres of an client at every boot in de JSS?

A_A
New Contributor II

Hello,

At our school we have 8 ip ranges for every building one.

When i image an mac in our office it is registered in the JSS with that ip number.

When i bring the mac to an other building, it works on an other ip adres in a different range.

Casper remote then has an problem connecting to that mac, since its looking at the old ip adres.

I try to run SUDO JAMF RECON after i putt the mac in the other building, but thats not an fool proof solution.

Imaging in the building isn't working, since we install a mac here to replace one in the building that has problems.

So, i wonder is it possible to update the ip adres every boot in the JSS ?

Then we can always connect with Casper Remote.

4 REPLIES 4

thoule
Valued Contributor II

Recon should do it- though it won't be 100%. Perhaps create a LaunchAgent to run recon? That would be the best option.

Perhaps you could look into running CasperRemote a little less frequently? Are you relying on it too much? Is there another way to accomplish that same task?

BOBW
Contributor II

I use

#!/bin/sh
sudo jamf log

at a trigger of network state change, this updates the IP in the JSS everytime they move to a new building without having to do a restart. Even connecting through Wifi updates. This is much quicker than running a recon as well.

You can run this in a single policy with a Files and Processes "Execute Command"

edit. you dont need to add the #!/bin/sh line if using the execute command. Only use this in a script called with the policy.

A_A
New Contributor II

We made an policy in self service to update the jamf / ip info when needed.
We have 300 mac's so every boot an update gives a lot of data.
So now an policy too run you're self when needed.

Although triggerd with network state change is also a good idea.

Thank you

mike_paul
Contributor III
Contributor III

Just an FYI, client computers update their IP address in the JSS on any Check-In so you shouldn't need a policy or a recon to accomplish this.

Those check-ins could be caused by the recurring check-in (Setting->Computer Management->Check-in) or on Network State Change trigger that happens on changes to he /Library/Preferences/SystemConfiguration/preferences.plist file, and changing an IP would modify that file.

So technically every time your computer changes IP it will be attempting to tell the JSS its new IP address, as long as it can reach the JSS. Also for the OP, if you enable Setting->Computer Management->Check-in->Login/Logout Hooks->"Check for policies triggered by login or logout" it will be updating the IP address on login/logout as well, it should be regardless due to the previously mentioned check-ins that happen then too.

If you'd like to confirm you can set a computer to a manual IP address and monitor the jamf.log and watch for 'Checking for policies triggered by "networkStateChange" for user "username"..." which would kick off as soon as you apply the ip changes, and then check the computer record in the JSS and you should see the ip change reflected.