PDA

View Full Version : Logging an IP address over the network, how?



desmogod
8th May 2007, 04:39 PM
Right, I have this script, http://forums.mactalk.com.au/showthread.php?p=286226#post286226
and with a few mods it works really well.
Now, being new to OS X/BSD/Unix, my grasp of the commands and scripting are rather limited to say the least. I know what I want to achieve, but how to achieve it is another matter.
What I need to be able to do, is write a script to notify another machine on the network of the hosts IP address.
1. grep IP of remote machine.
2. Send it over the network to a "listener"
3. Listener machine injects the IP into an IP database, or even a plain text file, not too bothered.
4. ???
5. Profit

Whats the best way of achieving this? I've tried scp, but thats not gonna do what I need it to.

Cheers
Jim

arkenstone
8th May 2007, 04:47 PM
I must ask: Why?

Surely a static IP (or statically assigned via DHCP dependant on MAC (no pun intended) address) would be a fair simpler method?

desmogod
8th May 2007, 04:53 PM
Ok, all these machines have static IP's, but the Mac admin here on Campus has been really really poor to say the least. We don't even know how many we have or where they are :/
I'll give this script to field support and get them to run it on every mac they see. What I am hoping to achieve is to turn on ARD, then report the IP back to another machine so I can add the info to the ARD database on my computer. Ideally, it would send the IP back as soon as the script is run and inject it straight into the ARD SQL database. But I'm not that smart. Unless someone knows of a way to scan for OS X only clients on the network. That would be easier :P

Linux_insidev2
8th May 2007, 05:09 PM
Ok, all these machines have static IP's, but the Mac admin here on Campus has been really really poor to say the least. We don't even know how many we have or where they are :/
I'll give this script to field support and get them to run it on every mac they see. What I am hoping to achieve is to turn on ARD, then report the IP back to another machine so I can add the info to the ARD database on my computer. Ideally, it would send the IP back as soon as the script is run and inject it straight into the ARD SQL database. But I'm not that smart. Unless someone knows of a way to scan for OS X only clients on the network. That would be easier :P

I thought apples ARD client had a network scanner and you could sort by the server type?

desmogod
8th May 2007, 05:10 PM
It does, but scanning the network every day seems like a bit of a waste to add 1 computer to the list when I know there are tools available to notify me.