Script to record last IP address and when it changed?

jhuls
Contributor III

Sometimes it's handy to know when an IP address changed on a workstation from dhcp and what the previous IP address was. Does anyone have a script to use as an extension attribute that might satisfy this need? Thought I would ask before trying to reinvent the wheel.

2 REPLIES 2

cbrewer
Valued Contributor II

I use this script by Elliot but instead of using it as an extension attribute I run it with my daily inventory update. That way every inventory update log has a record of the public and private IP's at that time.

tlarkin
Honored Contributor

So jamf records the IP of the client at every check in, and also the jamf log command will also log the IP address. If your check in frequency is faster than your IP lease time, you will likely escrow the IP to jamf in a timely enough manner you don't need to do anything extra. The only advantage I see to that script, is if you have multiple adapters connected with multiple IPs it would grab them, however that is an EA and only runs at recon. Whereas a check in will record it, or if you invoke jamf log