Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got an inline table with some IPs.
Load IP Inline [
IP
192.168.1.1
192.168.1.2
192.168.1.3];
Exist one way to ping these IPs (like using Windows CMD command) and get the IP result into QlikSense Table ?
Thanks
This is the founded solution:
ServerList:
Load * Inline [
IP, Descripion
192.168.1.1, Server1: 192.168.1.1
192.168.1.2, Server2: 192.168.1.2];
for n=0 to NoOfRows('ServerList')-1
let vIP=Peek('IP',$(n),'ServerList');
let vDescription=Peek('Descripion',$(n),'ServerList');
Execute c:\Windows\System32\cmd.exe /c ping $(vIP) > E:\Test\PingResults.txt;
ping:
LOAD
"@1:n"
FROM [lib://BaseFolder/Test\PingResults.txt]
(fix, codepage is 28591, embedded labels, record is 1 lines)
where match("@1:n",'Request timed out.');
if NoOfRows('ping')>0 then
call SendeMail('To@domain.com','From@domain.com','','','Server unreachable!','$(vDescription) is unreachable.','E:\Test\PingResults.txt','',unreachable.','E:\Test\PingResults.txt','','','','');
end if
Drop table ping;
next
Drop table ServerList;
let vIP=null();
let vDescription=null();
This is the founded solution:
ServerList:
Load * Inline [
IP, Descripion
192.168.1.1, Server1: 192.168.1.1
192.168.1.2, Server2: 192.168.1.2];
for n=0 to NoOfRows('ServerList')-1
let vIP=Peek('IP',$(n),'ServerList');
let vDescription=Peek('Descripion',$(n),'ServerList');
Execute c:\Windows\System32\cmd.exe /c ping $(vIP) > E:\Test\PingResults.txt;
ping:
LOAD
"@1:n"
FROM [lib://BaseFolder/Test\PingResults.txt]
(fix, codepage is 28591, embedded labels, record is 1 lines)
where match("@1:n",'Request timed out.');
if NoOfRows('ping')>0 then
call SendeMail('To@domain.com','From@domain.com','','','Server unreachable!','$(vDescription) is unreachable.','E:\Test\PingResults.txt','',unreachable.','E:\Test\PingResults.txt','','','','');
end if
Drop table ping;
next
Drop table ServerList;
let vIP=null();
let vDescription=null();