/build/static/layout/Breadcrumb_cap_w.png

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

=)

0 Comments   [ + ] Show comments

Answers (1)

Posted by: rlinhartpdx 12 years ago
Orange Belt
0
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.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ