IP Log

Is there a file in unix that contains all IP's connected. If not, what command can I use to make one?

Michael Stevens

I'm not sure what exactly you mean by "connected". The who command will show all users connected and the IP that they are connected from. If you are talking about a web server, you will have to look in the log files generated by the web server.

I need to get IP's of printers.

/etc/hosts is where local "known hosts" are stored. If you are using nis (yp) or nisplus you will have to use somehting like;
ypcat hosts
or
niscat hosts

Getting network information on the network location (IP, MAC address) of printers is based on how the printers are configured. If they are configured for SNMP, then you can used an SNMP discovery tool to find them.

In a nutshell, discovery of a device on a network depends on the services that the device is running (SNMP, etc.) and the discovery tool used by the server doing the discovery process (HP OpenView, etc.)

You must understand the nature of both and formulate a plan for discovery. You must insure your network routers and other intermediate systems are configured to allow protocols that facility discovery. This requires intermediate knowledge of network management and network management software. SNMP is the place to start for TCP/IP based systems.