• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Running multiple TriggerCMD Agent instances on a single machine

General Discussion
2
13
664
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    esaltat
    last edited by Dec 1, 2021, 10:01 PM

    Hi Russ,

    I'm wondering if it's possible to run multiple instances of the agent on a single machine. Basically, I want them to behave separately. I want one Alexa device to be tied into one instance. Do you have an idea how I can accomplish this?

    Thanks,

    R 1 Reply Last reply Dec 1, 2021, 10:56 PM Reply Quote 0
    • R
      Russ @esaltat
      last edited by Dec 1, 2021, 10:56 PM

      @esaltat, you could make a batch file to run the agent that first sets the HOMEPATH variable to different folder that contains a .TRIGGERcmdData subfolder, then runs the agent.js with the --console parameter. Like this:

      set HOMEPATH=\altagent
      cd %USERPROFILE%\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src
      node agent.js --console
      

      The following data files would go in C:\altagent\.TRIGGERcmdData

      token.tkn should contain a token for the account the agent.
      computer.cfg should contain the computer ID for the agent.
      commands.json should contain the commands for the agent.

      Russell VanderMey

      E 1 Reply Last reply Dec 2, 2021, 12:15 AM Reply Quote 0
      • E
        esaltat @Russ
        last edited by Dec 2, 2021, 12:15 AM

        @russ

        I'm getting this error when running the batch file

        C:\Users\Administrator\Desktop>test.bat
        
        C:\Users\Administrator\Desktop>set HOMEPATH=\altagent
        
        C:\Users\Administrator\Desktop>cd C:\Users\Administrator\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src
        
        C:\Users\Administrator\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src>node agent.js --console
        Daemon install: false
        fs.js:922
          return binding.mkdir(pathModule._makeLong(path),
                         ^
        
        Error: ENOENT: no such file or directory, mkdir 'C:\altagent\.TRIGGERcmdData'
            at Error (native)
            at Object.fs.mkdirSync (fs.js:922:18)
            at initFiles (C:\Users\Administrator\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src\agent.js:88:10)
            at consoleagent (C:\Users\Administrator\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src\agent.js:154:3)
            at Object.<anonymous> (C:\Users\Administrator\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src\agent.js:149:3)
            at Module._compile (module.js:570:32)
            at Object.Module._extensions..js (module.js:579:10)
            at Module.load (module.js:487:32)
            at tryModuleLoad (module.js:446:12)
            at Function.Module._load (module.js:438:3)
        
        R 1 Reply Last reply Dec 2, 2021, 12:56 PM Reply Quote 0
        • R
          Russ @esaltat
          last edited by Dec 2, 2021, 12:56 PM

          @esaltat , you need to create the c:\altagent folder first.

          It's trying to create the .TRIGGERcmdData folder in that altagent folder and it doesn't exist.

          Russell VanderMey

          E 2 Replies Last reply Dec 2, 2021, 11:21 PM Reply Quote 0
          • E
            esaltat @Russ
            last edited by Dec 2, 2021, 11:21 PM

            @russ perfect! thank you so much!

            1 Reply Last reply Reply Quote 1
            • E
              esaltat @Russ
              last edited by Dec 10, 2021, 9:44 PM

              @russ

              Hi Russel,

              One thing I notice when I leave the agent running for a period of time and when I run commands it doesn't seem to work. I have to restart the agent to make it work again. I have two agents running at the same time, I don't have issues with the other one.

              R 1 Reply Last reply Dec 10, 2021, 9:53 PM Reply Quote 0
              • R
                Russ @esaltat
                last edited by Dec 10, 2021, 9:53 PM

                @esaltat, does that consistently happen? I ask because there was an outage yesterday when my database server's drive filled up. I wonder if that caused it.

                The agent is supposed to keep trying to reconnect, and it generally works, but I haven't tested that with 2 agents on one computer.

                I'll start running a 2nd agent on my PC and see if I can reproduce it.

                Russell VanderMey

                E 2 Replies Last reply Dec 10, 2021, 9:55 PM Reply Quote 0
                • E
                  esaltat @Russ
                  last edited by Dec 10, 2021, 9:55 PM

                  @russ It only happened today but right now it seems to be running smoothly after I restarted the agent 3 times today. I'll keep you posted if it stops working again.

                  1 Reply Last reply Reply Quote 0
                  • E
                    esaltat @Russ
                    last edited by esaltat Dec 11, 2021, 5:57 PM Dec 11, 2021, 5:46 PM

                    @russ It happened again today, I have to hit enter to the command line for the agent to pick up commands. I don't mind restarting agents every now and then but do you have an idea how to schedule a task to restart agents every 24 hours? Thank you

                    R 1 Reply Last reply Dec 11, 2021, 6:53 PM Reply Quote 0
                    • R
                      Russ @esaltat
                      last edited by Russ Dec 11, 2021, 6:56 PM Dec 11, 2021, 6:53 PM

                      @esaltat, please clarify - the agent stops working until you hit enter in the cmd window that's running your 2nd agent? Or are you saying when you remotely run a command on that agent, it waits until you press enter? Please clarify. That pressing enter thing might be a clue.

                      I've had my 2nd agent running on my PC for about 21 hours now with no issue yet.

                      Also, can you run this command and tell me which version of node you're running? I'll try running the same version:

                      node -v
                      

                      Russell VanderMey

                      1 Reply Last reply Reply Quote 0
                      • E
                        esaltat
                        last edited by Dec 11, 2021, 7:59 PM

                        When I remotely run a command on the agent (from echo dot or triggercmd panel), it waits until I press enter. However, if I restart the agent, I don't have to press enter and it works just fine.

                        It's weird that it only happens when I leave the agent running for a period of time, in this case 24 hours.

                        I'm not sure if I have nodejs installed on my Windows computer so I can't see which version I am using.

                        Thanks for the fast response!

                        R 1 Reply Last reply Dec 14, 2021, 1:34 PM Reply Quote 0
                        • R
                          Russ @esaltat
                          last edited by Dec 14, 2021, 1:34 PM

                          @esaltat, I still haven't been able to reproduce that problem. My 2nd agent never waits until I press enter. Do you have another computer you could try it on?

                          I realize now that you're using node.exe from this folder, which is fine. I'm using the same and it's working for me.
                          %USERPROFILE%\AppData\Local\TRIGGERcmdAgent\app-1.0.25\resources\app\src

                          Russell VanderMey

                          E 1 Reply Last reply Dec 21, 2021, 4:18 PM Reply Quote 0
                          • E
                            esaltat @Russ
                            last edited by Dec 21, 2021, 4:18 PM

                            @russ

                            Sorry for the late reply, I didn't get any issues in the past few days, It seems to be completely working fine right now. Thanks for the help!

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post