HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ping + date
Operating System - Linux
1827288
Members
3681
Online
109717
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 11:47 PM
11-08-2006 11:47 PM
Hi Gurus !!!
is it possibe in linux to take the continues ping output in below format
ping + date
64 bytes from 192.168.x.x: icmp_seq=5 ttl=255 time=0.229 ms Thu Nov 9 18:15:04 IST 2006
is it possibe in linux to take the continues ping output in below format
ping + date
64 bytes from 192.168.x.x: icmp_seq=5 ttl=255 time=0.229 ms Thu Nov 9 18:15:04 IST 2006
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 11:59 PM
11-08-2006 11:59 PM
Re: ping + date
Hi,
ping does not have option to show the date. You can use a script instead of it.
while [ 1 ]; do ping -c 1 "hostname or IP"; date; sleep 1;done
:)
Warm Regards
Silju
ping does not have option to show the date. You can use a script instead of it.
while [ 1 ]; do ping -c 1 "hostname or IP"; date; sleep 1;done
:)
Warm Regards
Silju
Technology to empower all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 12:58 AM
11-09-2006 12:58 AM
Solution
Use the following perl code, create a file called tstamp.pl:
open(LOGFILE,">&STDOUT") ;
if ( $ARGV[0] ) {
close(LOGFILE) ;
open(LOGFILE,">> $ARGV[0]") or die "Cannot open file $ARGV[0]\n" ;
select(LOGFILE) ; # If commented out, nothing
$| = 1 ; # is printed to $ARGV[0] later on
}
while ( ) {
( $sec, $min, $hour, $day, $month, $year ) = localtime() ;
$month += 1 ;
$year += 1900 ;
printf LOGFILE ("%02d.%02d.%04d %02d:%02d:%02d: %s", $day, $month,
$year,
$hour, $min, $sec, $_) ;
}
For example:
ping localhost | tstamp.pl
09.11.2006 10:57:21: PING localhost (127.0.0.1): 56 data bytes
09.11.2006 10:57:21: 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=1 ms
09.11.2006 10:57:22: 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0 ms
open(LOGFILE,">&STDOUT") ;
if ( $ARGV[0] ) {
close(LOGFILE) ;
open(LOGFILE,">> $ARGV[0]") or die "Cannot open file $ARGV[0]\n" ;
select(LOGFILE) ; # If commented out, nothing
$| = 1 ; # is printed to $ARGV[0] later on
}
while (
( $sec, $min, $hour, $day, $month, $year ) = localtime() ;
$month += 1 ;
$year += 1900 ;
printf LOGFILE ("%02d.%02d.%04d %02d:%02d:%02d: %s", $day, $month,
$year,
$hour, $min, $sec, $_) ;
}
For example:
ping localhost | tstamp.pl
09.11.2006 10:57:21: PING localhost (127.0.0.1): 56 data bytes
09.11.2006 10:57:21: 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=1 ms
09.11.2006 10:57:22: 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0 ms
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 02:32 PM
11-09-2006 02:32 PM
Re: ping + date
Silju Ivan Ferreira
Thanx a lot for ur quick Support ,
Ivan, this is what i want !! . Thank u
Thanx a lot for ur quick Support ,
Ivan, this is what i want !! . Thank u
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP