I'm building a litle program to audit my samba network, by i don't know how can get a machine name from ip. Can anybady help me? Thanks
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>I'm building a litle program to audit my samba network, by i don't >know how can get a machine name from ip. Can anybady help me? >ThanksIt depends on your setup and how you want to aquire the ip. Assuming you want to do it from a shell. If your clients are on DHCP and you are updating a DNS server with the clients ips. A simple nslookup ip.add.re.ss would do the job. Or if you want to do it whils someone is logged on. You can use smbstatus -S. This will show you user,machine name and ip addy stats. Cheers - ------------- Kristyan Osborne - IT Technician Longhill High School 01273 391672 / 304086 - ------ Computers are like airconditioners: They stop working properly if you open windows. Win95: A 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFBPJXiqrr+KdRYU5gRAvxGAJ9TH2Dze5ur6vGzL+N83DhKOaCAoQCfRCfv IPxtTnEJhD6jyB/Yak1PMz0=bCrT -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>Kristyan, sorry, i must be explain the situation. >I have squid and samba in the some server. With squid log, i have the >list of machines contected to the server. With this ip, i want to do a >lookup to give the machine name. I build my program in C++, with him i >audit the squid log to make the ip, but i don't have idea about the >samba api and libsmbclient api to give the samba name from ip. >Thank's again.My best suggestion would be to use the /etc/hosts file. This file (if you have added the entries) will list IPs against hostnames. This will allow you to use programs like ping from the command line using hostnames, and you can use it to cross refernce your squid logs. If you don't fancy setting up a hosts file, you could set samba up as a WINS server. Then you can cross reference the wins data against the squid logs. Cheers - ------------- Kristyan Osborne - IT Technician Longhill High School 01273 391672 / 304086 - ------ Computers are like airconditioners: They stop working properly if you open windows. Win95: A 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFBPNPvqrr+KdRYU5gRAn3eAKCJqRnwFsmSZWj+DEahvn+h0Ut7/wCgmxMW NjA/eikxpHCrNoy8sleIXUM=Iy8f -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>Kristyan, sorry, i must be explain the situation. >I have squid and samba in the some server. With squid log, i have the >list of machines contected to the server. With this ip, i want to do a >lookup to give the machine name. I build my program in C++, with him i >audit the squid log to make the ip, but i don't have idea about the >samba api and libsmbclient api to give the samba name from ip. >Thank's again.I forgot to mention if you want to do the lookup when the client is on you can use: smbstatus -S | grep ipaddy Cheers - ------------- Kristyan Osborne - IT Technician Longhill High School 01273 391672 / 304086 - ------ Computers are like airconditioners: They stop working properly if you open windows. Win95: A 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFBPNWLqrr+KdRYU5gRAgqYAJ0TEW53x0JWtyruTWVgXeu5dGhgjwCgunNU c2gqBcrCphKpscqtfOWEIcQ=CZop -----END PGP SIGNATURE-----
Hi Sergio. (I understand is not really a samba answer, but may help solve your problem.) There's a option in squid.conf to log the machine name instead of the IP. # TAG: log_fqdn on|off # Turn this on if you wish to log fully qualified domain names # in the access.log. To do this Squid does a DNS lookup of all # IP's connecting to it. This can (in some situations) increase # latency, which makes your cache seem slower for interactive # browsing. # #Default: # log_fqdn off Bruno Guerreiro -----Original Message----- From: Kristyan Osborne [mailto:kris@longhill.brighton-hove.sch.uk] Sent: Monday, September 06, 2004 10:24 PM To: pirulo_gomez_2004@yahoo.com.ar; samba@lists.samba.org Subject: RE: [Samba] Re: Network LookUp -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>Kristyan, sorry, i must be explain the situation. >I have squid and samba in the some server. With squid log, i have the >list of machines contected to the server. With this ip, i want to do a >lookup to give the machine name. I build my program in C++, with him i >audit the squid log to make the ip, but i don't have idea about the >samba api and libsmbclient api to give the samba name from ip. >Thank's again.I forgot to mention if you want to do the lookup when the client is on you can use: smbstatus -S | grep ipaddy Cheers - ------------- Kristyan Osborne - IT Technician Longhill High School 01273 391672 / 304086 - ------ Computers are like airconditioners: They stop working properly if you open windows. Win95: A 32-bit patch for a 16-bit GUI shell running on top of an 8-bit operating system written for a 4-bit processor by a 2-bit company who cannot stand 1 bit of competition. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFBPNWLqrr+KdRYU5gRAgqYAJ0TEW53x0JWtyruTWVgXeu5dGhgjwCgunNU c2gqBcrCphKpscqtfOWEIcQ=CZop -----END PGP SIGNATURE----- -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba