Menu

Manual Polling fails

Help
2005-02-01
2013-03-22
  • Nobody/Anonymous

    Warning: socket_create() Unable to create  socket[1]: Operation not permitted in /usr/local/node-runner/include/query_icmp.php on line 20.

    And this error causes errors on lines 21 and 85 due to the socket not being created.  Did I miss something during the install?

     
    • Nobody/Anonymous

      Your php does not have socket support. You need to add that in to php. That should fix your problem.

      Sh0t0

       
    • Nobody/Anonymous

      phpinfo() says socket support is enabled.

      Thanks for the reply
      Chris

       
      • Brad Fears

        Brad Fears - 2005-02-04

        But remember that you have two different php binaries on your system.  One is compiled as a module to your web server, and one is used for command line support.  Each is compiled separately, so make sure that the command line binary has socket support as well.  phpinfo() will only tell you about the web module, not the command line module.

        To test the command line binary, you'll have to create a sample script.  This link has an example of how to use fsockopen that should do the trick.

        http://us3.php.net/manual/en/function.fsockopen.php

        --Brad Fears

         
    • Nobody/Anonymous

      I didn't realize that.  I went to the link and created a file with the fsockopen example in it and ran it as such;

      php fsockopen and it returned the following.  Which would
      lead me to believe that it worked also.  Are there any rights that may be needed to make this work?

      [root@nocmansrv root]# php fsockopen
      Content-type: text/html
      X-Powered-By: PHP/4.3.2

      HTTP/1.1 200 OK
      Date: Mon, 07 Feb 2005 01:09:15 GMT
      Server: Apache/1.3.27 (Unix)  (Red-Hat/Linux)
      Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
      ETag: "3f80f-1b6-3e1cb03b"
      Accept-Ranges: bytes
      Content-Length: 438
      Connection: close
      Content-Type: text/html

      <HTML>
      <HEAD>
        <TITLE>Example Web Page</TITLE>
      </HEAD>
      <body>
      <p>You have reached this web page by typing &quot;example.com&quot;,
      &quot;example.net&quot;,
        or &quot;example.org&quot; into your web browser.</p>
      <p>These domain names are reserved for use in documentation and are not available
        for registration. See <a href="http://www.rfc-editor.org/rfc/rfc2606.txt">RFC
        2606</a>, Section 3.</p>
      </BODY>
      </HTML>

       
      • Brad Fears

        Brad Fears - 2005-02-07

        You're right, fsockopen is apparently working.  Something else to try would be changing the configuration of that node from ICMP to TCP (pick any open port).  Let me know if it still generates that error message.

        --Brad Fears

         
    • Nobody/Anonymous

      Sorry for the wait, been busy.  But I changed a device to TCP and picked a port that I knew was not in use.  The system then showed as down at the next poll.  I then tried to do a manual ping and go two errors this time but there were not socket_create() errors.  There were actual errors trying to talk to the device when the device wasn't listening.  So it does appear to have something specifically to do with ICMP.

      Thoughts?

      Thanks
      Chris

       
      • Brad Fears

        Brad Fears - 2005-02-14

        When you say "manual ping", do you mean from the console/command line?  If so, you wouldn't get socket_create() errors, as those errors are specific to php.  However, if you get an error pinging from the command line, that would explain the error in php, as they use the same devices for communcation.

        --Brad Fears

         
    • Nobody/Anonymous

      By manual polling I mean;

      I am at the Node Runner Network Dash Board and a system becomes unavailable.  Node Runner then gives me the ability to poll the device manually.  When I click the link to poll the device manually, this is when the errors occur.

      Thanks
      Chris

       
      • Brad Fears

        Brad Fears - 2005-02-16

        That means that the php binary running through your web server, (probably mod_php4), was not compiled with socket support.  See the "System Requirements" from the documentation for more details.

        Here is a copy:

        http://nr.mtsdev.com/demo6/help.php?contents=1&tid=sysdoc_sysreqs

        --Brad Fears

         
    • Nobody/Anonymous

      This is what is reported.  According to this, socket support
      was enabled.

      ./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode'

      '--enable-sockets'

      '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2filter=/usr/sbin/apxs'

       
      • Brad Fears

        Brad Fears - 2005-02-17

        Okay, try creating a test page to run through your browser with the following content.

        <?php
        $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
        if (!$fp) {
           echo "$errstr ($errno)<br />\n";
        } else {
           $out = "GET / HTTP/1.1\r\n";
           $out .= "Host: www.example.com\r\n";
           $out .= "Connection: Close\r\n\r\n";

           fwrite($fp, $out);
           while (!feof($fp)) {
               echo fgets($fp, 128);
           }
           fclose($fp);
        }
        ?>

        NOTE: This example is from http://us3.php.net/manual/en/function.fsockopen.php.

        Run it to see if you get the same error.  If you do, you must have an issue with socket support in your php configuration.  If not, we'll continue with some more troubleshooting steps.

        --Brad Fears

         
    • Nobody/Anonymous

      This is the response I get.  I ran this test earlier in this thread, but from the command line.

      Thanks
      Chris
       
      HTTP/1.1 400 Bad Request Date: Thu, 17 Feb 2005 02:10:32 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 144
      Bad Request
      Your browser sent a request that this server could not understand.

      Client sent malformed Host header

      Apache/1.3.27 Server at www.example.com Port 80
      0

       
      • Brad Fears

        Brad Fears - 2005-02-17

        Check out this other thread:

        http://sourceforge.net/forum/forum.php?thread_id=1231046&forum_id=89576

        I wonder if your problem is related to ICMP as well.  Trying pinging something from the command line, and try switching any configured nodes over to a different protocol, such as TCP if possible.

        --Brad Fears

         
    • Nobody/Anonymous

      Ok, I looked at the other thread and it leads me to believe that it is a possible issue with the OS.  I can say that I am using CentOS linux and I have had issues with certain aspects of Inportect under PHP that appear to be related to PHP.  CentOS was compiled from Red Hat 3.x src rpms so I wonder if it could be something to do with the way Red Hat does it's thing with PHP?

      Thanks
      Chris

       
      • Brad Fears

        Brad Fears - 2005-02-21

        Did you ever trying pinging something (without php, just using the "ping" command) from the console of your operating system?  Does that work okay?

        --Brad Fears

         
    • Nobody/Anonymous

      Oh yes, that works just fine.

      Thanks
      Chris

       

Log in to post a comment.

Auth0 Logo