Ping functionality not working under Windows environment.
phpipam open-source IP address management
Brought to you by:
myha
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?
Anonymous
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.
Same for me !
Help please
Just deployed and have the same problem. has anyone come across any resolution on this yet?
Same here. It would really be great to get this working.
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.
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
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.
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
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
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.
cool. Can someone confirm this?
brm
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
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.
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
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.
:-(
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
I can confirm Nav's change on IIS 7 @ WIndows Server 2008 R2
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
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"
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
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"; }
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Support Requests"
Having the same issue, so far makign a mix of the changes above hasn't worked.
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?