Re: Batch command with slave mode configuration

2015-09-28 Thread Quang Truong
I have found the root cause: because I changed the way to invoke the slave 
and the account running the slave connection doesn't have enough permission 
so that Jenkins doesn't have permission to see nbtstat command.

A workaround is running the slave.jar to call the jnlp from Jenkins master 
by the java which is defined in Javahome.

Regards,
Quang

On Friday, September 18, 2015 at 1:15:39 AM UTC+7, Quang Truong wrote:

> Thanks Victor!
>
> I have tried with backlash (actually we can use even Linux syntax here) 
> and use %windir% instead of C:\Windows but still got the syntax error. I 
> don't know how to correct the syntax for this block in FOR command
>
> '"%windir%\System32\nbtstat.exe" -A %VM_IP% ^|FIND "<20>"'
>
> Thanks,
> Quang
>
> On Thursday, September 17, 2015 at 2:39:33 AM UTC+7, Quang Truong wrote:
>
>> Dear all,
>>
>> I have encountered an issue like this:
>>
>> - If I setup a slave by downloading and running the jnlp file (no need to 
>> install as Window service, just leave the java dialog as connected 
>> process). Then I can run this batch command:
>>
>> setlocal EnableDelayedExpansion
>> FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO 
>> (
>> SET Test_Machine_Name=%%G
>> echo Test_Machine_Name=!Test_Machine_Name!
>> )
>>
>> to return a target machine name (from provide IP %VM_IP%)
>>
>> - But if I run the commandline to setup the slave ( java -jar slave.jar 
>> -jnlpUrl http://:8080/computer//slave-agent.jnlp 
>> -secret ) then I encounter this error: 
>> 'nbtstat' is not recognized as an internal or external command,
>> operable program or batch file.
>> I have tried to point the absolute path of the nbtstat
>>
>> setlocal EnableDelayedExpansion
>> FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
>> %VM_IP%" ^|FIND "<20>"') DO (
>> SET Test_Machine_Name=%%G
>> echo Test_Machine_Name=!Test_Machine_Name!
>> )
>> then got the syntax incorrect.
>>
>> Please help to guide for solving this issue
>>
>> Thanks,
>> Quang
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/33e3f88b-d13d-46dc-85d9-c756d8b15d8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Batch command with slave mode configuration

2015-09-17 Thread Quang Truong
Thanks Victor!

I have tried with backlash (actually we can use even Linux syntax here) and 
use %windir% instead of C:\Windows but still got the syntax error. I don't 
know how to correct the syntax for this block in FOR command

'"%windir%\System32\nbtstat.exe" -A %VM_IP% ^|FIND "<20>"'

Thanks,
Quang

On Thursday, September 17, 2015 at 2:39:33 AM UTC+7, Quang Truong wrote:

> Dear all,
>
> I have encountered an issue like this:
>
> - If I setup a slave by downloading and running the jnlp file (no need to 
> install as Window service, just leave the java dialog as connected 
> process). Then I can run this batch command:
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
>
> to return a target machine name (from provide IP %VM_IP%)
>
> - But if I run the commandline to setup the slave ( java -jar slave.jar 
> -jnlpUrl http://:8080/computer//slave-agent.jnlp 
> -secret ) then I encounter this error: 
> 'nbtstat' is not recognized as an internal or external command,
> operable program or batch file.
> I have tried to point the absolute path of the nbtstat
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
> %VM_IP%" ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
> then got the syntax incorrect.
>
> Please help to guide for solving this issue
>
> Thanks,
> Quang
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9d7da479-6074-41c3-a41b-558df90784d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Batch command with slave mode configuration

2015-09-16 Thread Quang Truong
Dear all,

I have encountered an issue like this:

- If I setup a slave by downloading and running the jnlp file (no need to 
install as Window service, just leave the java dialog as connected 
process). Then I can run this batch command:

setlocal EnableDelayedExpansion
FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO (
SET Test_Machine_Name=%%G
echo Test_Machine_Name=!Test_Machine_Name!
)

to return a target machine name (from provide IP %VM_IP%)

- But if I run the commandline to setup the slave ( java -jar slave.jar 
-jnlpUrl http://:8080/computer//slave-agent.jnlp 
-secret ) then I encounter this error: 
'nbtstat' is not recognized as an internal or external command,
operable program or batch file.
I have tried to point the absolute path of the nbtstat

setlocal EnableDelayedExpansion
FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
%VM_IP%" ^|FIND "<20>"') DO (
SET Test_Machine_Name=%%G
echo Test_Machine_Name=!Test_Machine_Name!
)
then got the syntax incorrect.

Please help to guide for solving this issue

Thanks,
Quang

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3d211bd8-c00e-4291-95d3-f8dcdbc886d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Batch command with slave mode configuration

2015-09-16 Thread Victor Martinez
Hi Quang,

C:/Windows/System32/nbtstat.exe is not windows format. AFAIK it should be 
backlash instead.

You could try to set your path variable too.

Cheers

On Wednesday, 16 September 2015 21:39:33 UTC+2, Quang Truong wrote:
>
> Dear all,
>
> I have encountered an issue like this:
>
> - If I setup a slave by downloading and running the jnlp file (no need to 
> install as Window service, just leave the java dialog as connected 
> process). Then I can run this batch command:
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
>
> to return a target machine name (from provide IP %VM_IP%)
>
> - But if I run the commandline to setup the slave ( java -jar slave.jar 
> -jnlpUrl http://:8080/computer//slave-agent.jnlp 
> -secret ) then I encounter this error: 
> 'nbtstat' is not recognized as an internal or external command,
> operable program or batch file.
> I have tried to point the absolute path of the nbtstat
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
> %VM_IP%" ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
> then got the syntax incorrect.
>
> Please help to guide for solving this issue
>
> Thanks,
> Quang
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0d6b-cc5a-4539-9ffe-046405a27700%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.