Menu

#82 Ping functionality not working under Windows environment.

version 0.8
closed
nobody
WAMP Ping (1)
5
2016-08-16
2014-05-07
Anonymous
No

WAMP 2.5; Apache 2.4.9; PHP 5.5.12; MySQL 5.6.17
Windows Server 2008 R2 x64
PHPIPAM 1.0

Great application! Thank you!

I'm unable to get the ping check working. When clicking the Check Availability button on a single host, I get: Error: Invalid ping path (1000). If I try a ping scan on a subnet, I get: Cannot access php executable! Opening /functions/scripts/pingcheck.php in a browser results in "Warning: Threading is not supported!"

I've set $pathPing = "c:\windows\system32\PING.EXE" in config-scan.php.

Any suggestions to the ping scan functionality working in a Windows environment?

Discussion

  • Anonymous

    Anonymous - 2014-05-09

    A couple of updates...

    The ping path is now "C:/windows/system32/PING.exe" and checking the availability of a single host now returns "IP address 10.10.48.100 is not alive" even though the host in fact responding to pings.

    Executing /functions/scripts/pingcheck.php via CLI also results in "Warning: Threading is not supported!"

    If anyone has had success getting the subnet scan or host availability check working in Windows, I'd love to hear about it.

     
  • Anonymous

    Anonymous - 2014-05-16

    Same for me !

     
  • Anonymous

    Anonymous - 2014-06-18

    Help please

     
  • Anonymous

    Anonymous - 2014-08-15

    Just deployed and have the same problem. has anyone come across any resolution on this yet?

     
  • Anonymous

    Anonymous - 2014-09-11

    Same here. It would really be great to get this working.

     
  • Anonymous

    Anonymous - 2014-11-07

    Anyone have any ideas? Not able to get this working on my WAMP'd phpipam installation either, no matter what variation of c:\windows\system32\ping.exe I place in the config-scan.php or ping path in the IPAM Management.

     
  • Miha Petkovsek

    Miha Petkovsek - 2014-11-12

    Hi guys, sorry cannot give you any help for windows.

    pingcheck script must be run from CLI via cron as it uses threading which is only supported in cli.

    Maybe try this:
    open site/ipaddr/pingCheck.php
    after
    $pingRes = pingHost($ip['ip_addr'], 1, 1);
    add
    print $pingRes;

    this should give you a result from script, some number.

    also maybe you can check functions/functions-network.php and take a look at function pingHost.

    brm

     
  • Anonymous

    Anonymous - 2015-02-05

    Pour L'option "Vérifier la disponibilité" (écran : Détail adresse IP).
    $pingRes recoit 1000, indiquant que le fichier exécutable n'existe pas. Dans le fichier "functions-network.php", fonction pingHost, la variable $settings['scanPingPath'] est valorisée à "/bin/ping"

    function pingHost ($ip, $count=1, $timeout = 1, $exit=false)
    { $settings = getAllSettings();
    //verify ping path
    if(!file_exists($settings['scanPingPath'])) {
    $retval = 1000;
    Solution.
    Modifier la table settings et remplacer la valeur de la colonne scanPingPath par le bon chemin.

     
  • Nav

    Nav - 2015-03-26

    Just thought i would post on here - i got host check working by editing the function-network.php file.

    Replace:
    elseif(PHP_OS == "WIN32" || PHP_OS == "Windows" || PHP_OS == "WINNT") { $cmd = $settings['scanPingPath']." -n $count -I ".($timeout*1000)." $ip 1>/dev/null 2>&1"; }

    With
    elseif(PHP_OS == "WIN32" || PHP_OS == "Windows" || PHP_OS == "WINNT") { $cmd = $settings['scanPingPath']." -n $count $ip > NUL 2>&1"; }

     

    Last edit: Nav 2015-03-26
    • Anonymous

      Anonymous - 2015-04-24

      Sorry, this did not work for me.
      I tried also adding
      $pathPing = "c:\windows\system32\PING.EXE"
      to config-scan.php with no results.

      Windows 2008 R2 64 bits, WAMP 2.5 32 bits, PHPIPAM 1.1.010.

       
  • Miha Petkovsek

    Miha Petkovsek - 2015-03-26

    cool. Can someone confirm this?
    brm

     
  • Anonymous

    Anonymous - 2015-03-29

    Confirmed, not working with Windows (XAMPP), regardless of suggested work arounds.
    "Cannot access php executable"
    On my Linux boxes works without issue.
    Would really like to get this going on the Windows side. Exclusively windows network at work. Otherwise need to move onto another solution.
    Thanks.

     
  • Anonymous

    Anonymous - 2015-05-04

    Hello

    some test show that under windows the script don't even try to access the ping.exe file.

    i took the following command line:
    D:\workspace\appli\xampp\php\php.exe D:\workspace\appli\xampp\htdocs\phpipam\site\ipaddr\scan......\functions\scan\scanIPAddressesScript.php discovery 192.168.1.0/24 19

    and try to execute it directly:
    {"errors":"Threading is required for scanning subnets. Please recompile PHP with pcntl extension"}

    "Google is my friend" later :
    http://php.net/manual/en/intro.pcntl.php

    the important line is:
    "Note: This extension is not available on Windows platforms."

    so no possibility to execute like this the ping.exe file under windows.

    :-(

     
  • Anonymous

    Anonymous - 2015-06-13

    I can confirm Nav's change on IIS 7 @ WIndows Server 2008 R2

     
  • Anonymous

    Anonymous - 2015-09-29

    i look code changed.
    but in old functions-network.php (function pingHost) was mistake:

    command ping not have parameters -I, must be -w

    and not "1>/dev/null 2>&1"
    in windows it's type "c:\autoexec.bat > NUL"

     
  • Anonymous

    Anonymous - 2015-11-17

    This is fixed my check status problem . I editted functions-network.php

    replace this one:

    elseif(PHP_OS == "WIN32" || PHP_OS == "Windows" || PHP_OS == "WINNT") { $cmd = $settings['scanPingPath']." -n $count -I ".($timeout*1000)." $ip 1>/dev/null 2>&1"; }

    with this:

    elseif(PHP_OS == "WIN32" || PHP_OS == "Windows" || PHP_OS == "WINNT") { $cmd = $settings['scanPingPath']." -n $count -w $timeout $ip > NUL 2>&1"; }

     
  • Anonymous

    Anonymous - 2015-12-11

    Having the same issue, so far makign a mix of the changes above hasn't worked.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02
    • Status: open --> closed
     
  • Mike Smith

    Mike Smith - 2016-06-24

    I am having the same issues as above. I've tried everything, but nothing will do the trick. I'm getting the error "invalid ping path".

    I'm thinking the issue is caused by the "ping path" option in the main phpipam settings. By default its set to /bin/ping. My server is a windows 2012 box, and not linux so i've changed the path to every variation i can think of to point to the windows ping.exe. No luck.

    Any ideas?

     
  • Anonymous

    Anonymous - 2016-08-16
    Post awaiting moderation.
  • Anonymous

    Anonymous - 2016-08-16
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.