diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index dd132795..91d8b699 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -10,11 +10,88 @@ Compatibility: Examples: - $ ping | jc --ping -p - [] + $ ping -c 3 -p ff cnn.com | jc --ping -p + { + "destination_ip": "151.101.1.67", + "data_bytes": 56, + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": 3, + "packets_received": 3, + "packet_loss_percent": 0.0, + "round_trip_ms_min": 28.015, + "round_trip_ms_avg": 32.848, + "round_trip_ms_max": 39.376, + "round_trip_ms_stddev": 4.79, + "responses": [ + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 0, + "ttl": 59, + "time_ms": 28.015 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 1, + "ttl": 59, + "time_ms": 39.376 + }, + { + "type": "reply", + "bytes": 64, + "response_ip": "151.101.1.67", + "icmp_seq": 2, + "ttl": 59, + "time_ms": 31.153 + } + ] + } - $ ping | jc --ping -p -r - [] + + $ ping -c 3 -p ff cnn.com | jc --ping -p -r + { + "destination_ip": "151.101.129.67", + "data_bytes": "56", + "pattern": "0xff", + "destination": "cnn.com", + "packets_transmitted": "3", + "packets_received": "3", + "packet_loss_percent": "0.0", + "round_trip_ms_min": "25.078", + "round_trip_ms_avg": "29.543", + "round_trip_ms_max": "32.553", + "round_trip_ms_stddev": "3.221", + "responses": [ + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "0", + "ttl": "59", + "time_ms": "25.078" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "1", + "ttl": "59", + "time_ms": "30.999" + }, + { + "type": "reply", + "bytes": "64", + "response_ip": "151.101.129.67", + "icmp_seq": "2", + "ttl": "59", + "time_ms": "32.553" + } + ] + } """ import string import jc.utils