8.2. Transmitter classes¶
- class pingparsing.PingTransmitter[source]¶
Transmitter class to send ICMP packets by using the OS built-in
ping
command.- count: Optional[int] = None¶
Number of sending ICMP packets. This attribute ignored if the value is
None
.
- interface: Optional[str] = None¶
Interface name or zone-id. The attribute required when
destination
is IPv6 link-local scope address.
- timestamp: bool = False¶
[Only for Linux environment] If
True
, add timestamp for each ping result. Defaults toFalse
.
- auto_codepage: bool = True¶
[Only for Windows environment] Automatically change code page if
True
. Defaults toTrue
.
- property deadline: Optional[Time]¶
Timeout before ping exits. You can specify either a number or a string (e.g.
"1sec"
). If only a number is specified and a unit not found, the unit will be considered as seconds.Unit
Available specifiers (str)
days
d
/day
/days
hours
h
/hour
/hours
minutes
m
/min
/mins
/minute
/minutes
seconds
s
/sec
/secs
/second
/seconds
milliseconds
ms
/msec
/msecs
/millisecond
/milliseconds
microseconds
us
/usec
/usecs
/microsecond
/microseconds
If both
deadline
andcount
areNone
,deadline
is automatically set to the default value (3 seconds
). Defaults toNone
.- Returns
deadline
- Return type
humanreadable.Time
- property destination_host: str¶
Alias to
destination
- ping() PingResult [source]¶
Sending ICMP packets.
- Returns
ping
command execution result.- Return type
- Raises
ValueError – If parameters not valid.
- property timeout: Optional[Time]¶
Time to wait for a response per packet. You can specify either a number or a string (e.g.
"1sec"
). If only a number is specified and a unit not found, the unit will be considered as seconds.Unit
Available specifiers (str)
days
d
/day
/days
hours
h
/hour
/hours
minutes
m
/min
/mins
/minute
/minutes
seconds
s
/sec
/secs
/second
/seconds
milliseconds
ms
/msec
/msecs
/millisecond
/milliseconds
microseconds
us
/usec
/usecs
/microsecond
/microseconds
Use system default timeout if the value is
None
. Defaults toNone
. If the system does not support timeout in milliseconds, round up as seconds.- Returns
timeout
- Return type
humanreadable.Time