-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL bash always returns host down #111
Comments
I suggest you to rewrite this program with promise based. Then, try to take
a look the error from the promised, and see what's happening
Simone <notifications@github.com> 於 2020年2月27日週四 上午12:06寫道:
… Hello, here's my script:
var ping = require('ping');
const fs = require('fs');
var hosts = ['192.168.1.253'];
hosts.forEach(function(host){
ping.sys.probe(host, function(isAlive){
if (isAlive) {
return;
} else {
d = new Date().toLocaleString();
fs.appendFile("/mnt/c/Users/roughnecks/Desktop/ping.txt", "Access Point is Down! - " + d + "\n" , function(err) {
if(err) {
return;
}
//console.log("The file was saved!");
});
}
});
});
This used to work but for some reason on my new WSL Debian install it
always reports "host down",
Can you help?
***@***.***:~$ node --version v12.16.1
***@***.***:~$ cat /etc/debian_version
10.3
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#111?email_source=notifications&email_token=AA5YBI26VV2H3TIWPZG2M2LRE2HOZA5CNFSM4K4I3XGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IQQJJOQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5YBI4MLNWAC23LH7SVJC3RE2HOZANCNFSM4K4I3XGA>
.
|
New script, just copy-pasted from README:
roughnecks@CUSPIDE:~/scripts$ node pingpromise.js |
Since you have installed a new system, did you install ping in your system?
Simone <notifications@github.com> 於 2020年2月27日週四 上午12:24寫道:
… New script, just copy-pasted from README:
var ping = require('ping');
var hosts = ['192.168.1.253'];
hosts.forEach(function (host) {
ping.promise.probe(host)
.then(function (res) {
console.log(res);
});
});
***@***.***:~/scripts$ node pingpromise.js {
host: 'unknown',
alive: false,
output: '',
time: 'unknown',
min: 'unknown',
max: 'unknown',
avg: 'unknown',
stddev: 'unknown'
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#111?email_source=notifications&email_token=AA5YBIYK2ZV4NJF6NPPIFGTRE2JSRA5CNFSM4K4I3XGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENA4ZHI#issuecomment-591514781>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5YBI6ZGBRVTYPPRTZYZ2LRE2JSRANCNFSM4K4I3XGA>
.
|
I have installed with:
Now I also tried with:
But it's still not working |
No. I mean the ping in your system. Can you run ping in your debian
terminal?
Simone <notifications@github.com> 於 2020年2月27日週四 上午12:31寫道:
… I have installed with:
npm install ping
Now I also tried with:
npm install node-ping
But it's still not working
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#111?email_source=notifications&email_token=AA5YBI6PIOWLRGIRUWGCZNLRE2KNJA5CNFSM4K4I3XGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENA5VSI#issuecomment-591518409>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5YBI336MWRQS2YCAFKWJ3RE2KNJANCNFSM4K4I3XGA>
.
|
Yes, it's installed but it doesn't actually work. "ping: socket: Operation not permitted" I wonder how did I manage to have it working in my old setup, which was pretty much the same. |
Hey, I fixed it by running this: sudo chmod u+s Which was referenced here: microsoft/WSL#18 (comment) |
Hello, here's my script:
This used to work but for some reason on my new WSL Debian install it always reports "host down",
Can you help?
roughnecks@CUSPIDE:~$ node --version
v12.16.1
roughnecks@CUSPIDE:~$ cat /etc/debian_version
10.3
Thanks
The text was updated successfully, but these errors were encountered: