Script to poll local 'host' file.
Hi,
I need to create a script that would allow me to poll the local 'host' file as I have a number of machines with populated host files, but I'm about to change the IP scheme and would like to prepare a list of machines that need extra attention.
Thank you
=)
I need to create a script that would allow me to poll the local 'host' file as I have a number of machines with populated host files, but I'm about to change the IP scheme and would like to prepare a list of machines that need extra attention.
Thank you
=)
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
rlinhartpdx
12 years ago
I think a little more info might yield a solution. The key phrase "poll the local 'host' file" is a bit vague. I suspect you're just looking for the existence of a hosts file. The location of the file is dependent on the version of operating system installed. You shouldn't have any trouble googling for sample code to detect OS version and check for file exists. Will you run the code on each individual computer or poll them over the network? How will you record the results? There is plenty of sample code out there for writing a log file which would be preferable to console output. Running the code on the computers could present problems if two computers attempt to write to a common log file at the same time. Polling computers over the network is a slightly higher level of complexity but again, there is lots of sample code out there, just a "google" away.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.