Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: Write a python script that collects ping latency. Script Command: python pinger.py Command Description: To launch the script file (pinger.py), we give the script

Objective:

Write a python script that collects ping latency.

Script Command:

python pinger.py

Command Description: To launch the script file (pinger.py), we give the script the 2 arguments, the address and the number of pings to collect:

address: A string of the address to ping.

pings_to_collect: An integer of how many pings we want the script to collect data for. Each ping is separated by one second.

Ex. Input:

To ping google 120 times: python pinger.py google.com 120

Script Output:

Format:

,

Clock_Time: The system's clock time. The format should be hour:minute:second

Ping_in_ms: The result of the ping, only in milliseconds (as an integer). If the ping fails, report the value as -1.

Ex. Output:

13:01:40,54

13:01:41,60

13:01:42,-1

13:01:43,61

Notes:

The ping call will fail sometimes. Do not assume a ping response will returned within a second. So in your ping loop, wait until a response is returned (either with a ping or timeout) before waiting a second to start the next loop iteration.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

What teacher supports and services are needed? (D2, D7, D8)

Answered: 1 week ago