afcmd - setting nimby errors

Installation and configuration.
Post Reply
belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

afcmd - setting nimby errors

Post by belegdae » Tue May 28, 2019 2:16 pm

Hello,

I'm trying to configure a local script (windows) to set nimby when users log in, and clear when log off.

If I use keeper or the webui I can toggle Nimby fine, but running afcmd I get an error:

Code: Select all

TJSONBIN[149]
{"info":{"kind":"error","text":"Action node(s) not found."}}
AfCmd::msgOut: TJSONBIN[72]
Running on windows, and command is:

Code: Select all

_afcmd.cmd rNIMBY %computername%
Using afcmd to create users works fine.

Any ideas? Thanks!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 482
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: afcmd - setting nimby errors

Post by timurhai » Tue May 28, 2019 2:53 pm

Hi.
Try to enter host name by hand, some host that is definitely exists.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Re: afcmd - setting nimby errors

Post by belegdae » Tue May 28, 2019 2:57 pm

Aah, found the problem!
Afanasy appears to convert all hostnames to lower case.
If a machine has a hostname of "ABCDE" then it needs to command to be "abdce" first.

If this is by design, could afcmd convert hostnames to lower as a feature request? I'll fix in our script for now

Thanks for the help!
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 482
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: afcmd - setting nimby errors

Post by timurhai » Tue May 28, 2019 3:00 pm

Yes, afcmd should do the same as afserver.
Will be implemented!
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

belegdae
Posts: 7
Joined: Tue May 28, 2019 2:10 pm

Re: afcmd - setting nimby errors

Post by belegdae » Tue May 28, 2019 3:26 pm

That's great, thank you!

For anyone that might need it, here's a little batch that converts the hostname to lower before calling afcmd:

Code: Select all

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

CALL :LCase COMPUTERNAME _HOSTNAME_LOWER
CALL _afcmd.cmd rNIMBY %_HOSTNAME_LOWER%

ENDLOCAL
GOTO:EOF

:LCase
SET _LCase=a b c d e f g h i j k l m n o p q r s t u v w x y z
SET _Lib_UCase_Tmp=!%1!
FOR %%Z IN (%_LCase%) DO SET _Lib_UCase_Tmp=!_Lib_UCase_Tmp:%%Z=%%Z!
SET %2=%_Lib_UCase_Tmp%
GOTO:EOF
Rich
CGRU 2.3.1, Server - Win 2012 R2, ~300x Render Nodes - Windows 10.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest