Perl Script to change IPs to DNS Names

K

K.J. 44

Hi,

I am very new to Perl. I have worked through the Llama.

I have a free Syslog server that saves the syslog messages to a text
file. What I would like to do is have a perl script that runs say,
every hour or 1/2 hour that goes through the text file, looks at the
syslog message, checks to see if there is an IP address, then queries
the DNS to find the computer name for that IP and adds that to the
message. I would also like to be able to add who was currently logged
into the PC to the message.

How would I go about querying DNS and finding out who is logged in? I
am in a Windows 2k3 environment with all XP SP2 machines. I do not
have the ability to run ISA as a proxy to accomplish this type of thing
so I was hoping I could write a Perl Script.

Thanks.
 
K

K.J. 44

Great thanks! Also thanks to tkunau for his suggestions at the
implementation of gethostbyaddr.

Is there also a way to query for the username of the person logged into
that computer? Like the VBScript

Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName

Thanks!
 
K

K.J. 44

BUt of course this would be run on the computerName that is acheived by
the gethostbyaddr....

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top