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   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


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.
Answered 03/01/2012 by: rlinhartpdx
Orange Belt

Please log in to comment