Port Ping?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sven Dzepina

    Port Ping?

    Hello people,

    I want to check with a php script if a port / serverservice is down.
    It would be great if I can check the ping time, too.

    But how I can realize that?

    Gretting from Germany.


  • Nikolai Chuvakhin

    #2
    Re: Port Ping?

    "Sven Dzepina" <mail@styleswit ch.de> wrote in message
    news:<3f96b5b4$ 0$19091$9b4e6d9 3@newsread2.arc or-online.net>...[color=blue]
    >
    > I want to check with a php script if a port / serverservice is down.
    > It would be great if I can check the ping time, too.[/color]

    if ($exit_code = system ('ping www.styleswitch .de', $output)) {
    // analyze the $output array
    } else {
    echo 'Ping failed. ';
    }

    Cheers,
    NC

    Comment

    • Dave Bell

      #3
      Re: Port Ping?

      That ping command will go on forever under Linux.
      You need to specify ping -cX where X equals the number of times you want
      to ping the remote host.

      Comment

      • Sven Dzepina

        #4
        Re: Port Ping?

        Hello,

        but how I can read out the data?
        I want to work with the results from the linux "ping"-command.
        Can I get only the average from the ping.

        Thanks!

        "Dave Bell" <drb8@kent.ac.u k> schrieb im Newsbeitrag
        news:bn80fv$5a$ 3@athena.ukc.ac .uk...[color=blue]
        > That ping command will go on forever under Linux.
        > You need to specify ping -cX where X equals the number of times you want
        > to ping the remote host.
        >[/color]


        Comment

        • Jon Kraft

          #5
          Re: Port Ping?

          Sven Dzepina <mail@styleswit ch.de> wrote:
          [color=blue]
          > but how I can read out the data?
          > I want to work with the results from the linux "ping"-command.
          > Can I get only the average from the ping.[/color]

          How about having a look in the manual?



          JOn

          Comment

          • William Maddler

            #6
            Re: Port Ping?

            Sven Dzepina wrote:
            [color=blue]
            > Hello people,
            >
            > I want to check with a php script if a port / serverservice is down.
            > It would be great if I can check the ping time, too.
            >
            > But how I can realize that?
            >
            > Gretting from Germany.[/color]

            try using hping2 with system()

            --
            WM
            (del #NOSPAM# to answer)

            Posted from X-Privat Free NNTP server - www.x-privat.org

            Comment

            • Sven Dzepina

              #7
              Re: Port Ping?

              Hi,

              yes! But I did not find anything right about ping command.
              exec("ping test.com:29"); This is not possible ??? =(
              "Jon Kraft" <jon@jonux.co.u k> schrieb im Newsbeitrag
              news:bn8lfn$up2 fo$1@ID-175424.news.uni-berlin.de...[color=blue]
              > Sven Dzepina <mail@styleswit ch.de> wrote:
              >[color=green]
              > > but how I can read out the data?
              > > I want to work with the results from the linux "ping"-command.
              > > Can I get only the average from the ping.[/color]
              >
              > How about having a look in the manual?
              >
              > http://uk.php.net/manual/en/ref.exec.php
              >
              > JOn[/color]


              Comment

              • Sven Dzepina

                #8
                Re: Port Ping?

                hping2 is not possible =(

                "William Maddler" <maddler#NOSPAM #@cryptorebels. net> schrieb im Newsbeitrag
                news:3f97e077@x-privat.org...[color=blue]
                > Sven Dzepina wrote:
                >[color=green]
                > > Hello people,
                > >
                > > I want to check with a php script if a port / serverservice is down.
                > > It would be great if I can check the ping time, too.
                > >
                > > But how I can realize that?
                > >
                > > Gretting from Germany.[/color]
                >
                > try using hping2 with system()
                >
                > --
                > WM
                > (del #NOSPAM# to answer)
                >
                > Posted from X-Privat Free NNTP server - www.x-privat.org[/color]


                Comment

                • Sven Dzepina

                  #9
                  Re: Port Ping?

                  Please,

                  I need further informations...


                  "Sven Dzepina" <mail@styleswit ch.de> schrieb im Newsbeitrag
                  news:3f96b5b4$0 $19091$9b4e6d93 @newsread2.arco r-online.net...[color=blue]
                  > Hello people,
                  >
                  > I want to check with a php script if a port / serverservice is down.
                  > It would be great if I can check the ping time, too.
                  >
                  > But how I can realize that?
                  >
                  > Gretting from Germany.
                  >
                  >[/color]


                  Comment

                  • Alan Little

                    #10
                    Re: Port Ping?

                    Carved in mystic runes upon the very living rock, the last words of Sven
                    Dzepina of comp.lang.php make plain:
                    [color=blue]
                    > "Sven Dzepina" <mail@styleswit ch.de> schrieb im Newsbeitrag
                    > news:3f96b5b4$0 $19091$9b4e6d93 @newsread2.arco r-online.net...[color=green]
                    >> Hello people,
                    >>
                    >> I want to check with a php script if a port / serverservice is down.
                    >> It would be great if I can check the ping time, too.
                    >>
                    >> But how I can realize that?[/color]
                    > Please,
                    >
                    > I need further informations...[/color]

                    First of all, don't top post.

                    Second, you not only have to read the manual, you have to understand it.
                    Of course it doesn't say anything about ping - it's the manual entry for
                    the exec() function, und es sagt:

                    "Ist der Parameter /array/ angegeben, wird dieses mit jeder Zeile des
                    Befehlsausgabe gefüllt."



                    Read it and understand it. That should get you going.

                    --
                    Alan Little
                    Phorm PHP Form Processor

                    Comment

                    Working...