Logic
The program attempts to ping the requested device 5 times, and if it responds, report it up. Otherwise, report it down.
It saves this information to the console as well as an outputed file, pingResults.csv
.
Program flow
The program does the following
- The program attempts to read in from the file to a vector containing the device name and associated ip
- The program sets up the output file, ensuring that it exsists and writes header information
- The program iterates through each device and creates a runner job for each device
- The program creates a logging thread that handles writing to the console and appending to the file
- The program begins to execute the threads and writes the information out
- The program closes the execuation stack and the logging thread
- The program writes to the file and exits
Status information
The program attempts to ping each device 5 times, if more then 50% of the pings make it through, it reports the device as up.
The pinging thread waits 5000ms or 5s before it considers a no-response.