Ping avec heure

Résolu/Fermé
lejohnn Messages postés 37 Date d'inscription jeudi 15 avril 2004 Statut Membre Dernière intervention 30 septembre 2006 - 13 avril 2005 à 11:46
brupala Messages postés 109406 Date d'inscription lundi 16 juillet 2001 Statut Membre Dernière intervention 18 avril 2024 - 16 avril 2005 à 00:10
Bonjour,

je cherche a faire un fichier de log avec l'etat du ping vers un dns.
Mais j'aimerai avoir l'heure (hh:mm:ss) avec.

Es-ce que vous avez des idées ?

Sinon, j'ai l'option -s de ping qui me semble interessante pour cela, mais je ne trouve pas d'info plus complete sur cette option...

Merci du coup de main :)

6 réponses

brupala Messages postés 109406 Date d'inscription lundi 16 juillet 2001 Statut Membre Dernière intervention 18 avril 2024 13 617
13 avril 2005 à 15:42
salut,
j'ai effectué quelques tests avec cette option -s nbsauts (sous windows)
en fait cela rajoute un champ option dans l'entête ip:
l'option time stamp définie dans la rfc791:
                                                          September 1981
Internet Protocol
Specification



      Internet Timestamp

        +--------+--------+--------+--------+
        |01000100| length | pointer|oflw|flg|
        +--------+--------+--------+--------+
        |         internet address          |
        +--------+--------+--------+--------+
        |             timestamp             |
        +--------+--------+--------+--------+
        |                 .                 |
                          .
                          .
        Type = 68

        The Option Length is the number of octets in the option counting
        the type, length, pointer, and overflow/flag octets (maximum
        length 40).

        The Pointer is the number of octets from the beginning of this
        option to the end of timestamps plus one (i.e., it points to the
        octet beginning the space for next timestamp).  The smallest
        legal value is 5.  The timestamp area is full when the pointer
        is greater than the length.

        The Overflow (oflw) [4 bits] is the number of IP modules that
        cannot register timestamps due to lack of space.

        The Flag (flg) [4 bits] values are

          0 -- time stamps only, stored in consecutive 32-bit words,

          1 -- each timestamp is preceded with internet address of the
               registering entity,

          3 -- the internet address fields are prespecified.  An IP
               module only registers its timestamp if it matches its own
               address with the next specified internet address.

        The Timestamp is a right-justified, 32-bit timestamp in
        milliseconds since midnight UT.  If the time is not available in
        milliseconds or cannot be provided with respect to midnight UT
        then any time may be inserted as a timestamp provided the high
        order bit of the timestamp field is set to one to indicate the
        use of a non-standard value.

        The originating host must compose this option with a large
        enough timestamp data area to hold all the timestamp information
        expected.  The size of the option does not change due to adding


[Page 22]                                                               

donc cela indique un nombre de millisecondes sur 32 bits depuis minuit TU.
le problème est qu'il faut faire confiance au routeur qui donne l'information (il met aussi son adresse).
aussi,
:-<
il doit y avoir un bug dans ma version windows de ping (2KPRO) car il semble afficher un temps incohérent (sur ping -t)
(je fais une capture ethereal en même temps et je vois que le temps dans le paquet ip semble correct.
02 d9 7a 3a cela fait 47807034 pour ethereal (correct).
et le ping windows m'affiche 981129474 , l'andouille.
sacré windows ;-)
1
un simlple scrip suffit..mais cela dépend de votre systeme d'exploitation que vous avez remplacé par un coup de sifflet...
Ghost
0
lejohnn Messages postés 37 Date d'inscription jeudi 15 avril 2004 Statut Membre Dernière intervention 30 septembre 2006 2
13 avril 2005 à 20:36
Oups :| je suis sous XP pro sp2

Pour brupala, merci pour la doc :)
Roo, je pensais que l'on allait trouver qqchose de plus simple!

c'est quand meme terrible que time /t ne me donne pas les secondes!
0
brupala Messages postés 109406 Date d'inscription lundi 16 juillet 2001 Statut Membre Dernière intervention 18 avril 2024 13 617
14 avril 2005 à 10:07
et ...
echo %time%
echo nous sommes actuellement le %date% à %time% >> test.txt
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
lejohnn Messages postés 37 Date d'inscription jeudi 15 avril 2004 Statut Membre Dernière intervention 30 septembre 2006 2
14 avril 2005 à 21:18
Parfait !!
j'avais essayé TIME /T >>jo.txt mais je n'avais pas les secondes !

Merci !
0
brupala Messages postés 109406 Date d'inscription lundi 16 juillet 2001 Statut Membre Dernière intervention 18 avril 2024 13 617
16 avril 2005 à 00:10
:-))
vive ccm
0