afcmd - setting nimby errors

Installation and configuration.
Post Reply
User avatar
belegdae
Posts: 15
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, 406x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 553
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).

User avatar
belegdae
Posts: 15
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, 406x Render Nodes - Windows 10.

User avatar
timurhai
Site Admin
Posts: 553
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).

User avatar
belegdae
Posts: 15
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, 406x Render Nodes - Windows 10.

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

Re: afcmd - setting nimby errors

Post by timurhai » Wed Feb 26, 2020 4:51 pm

Hi!
It is implemented in code (GitHub master).
Will be available in the next releases.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests