Questions on TCMD tool and usage?
-
So I just found this cool tool and have several ideas for its usage.
I've downloaded it and attempted to use it from my Raspi where TRIGGERCMD is install but I get the error {"error":"Computer not found."}
So I'm doing something wrong.
Does the file need to be in a specific folder? I have it in my /home/pi/scripts folder
does it have to be run from inside a script? I'm testing just from command line using sudo ./tcmd -t Panic
Panic is the name of my TRIGGERcmd trigger
Does it need to be run from root in this case? -
UpDate: still no luck
I also tried sudo ./tcmd -c -t Panic
and get "No trigger specified. Use --help or -h for help."
Running as Root makes no difference -
@tuicemen, it doesn't have to be in any particular folder.
You're missing the computer name in your commands. Here's an example of it working:
tcmd -c russfam -t calculator {"message":"Trigger sent."}
You can also run this to use --list to show a list of tcmd commands - one for each of your TRIGGERcmd commands on each of your computers.
tcmd -list 0 tcmd --computer "bedroompi" --trigger "apt update" 1 tcmd --computer "bedroompi" --trigger "Bedroom" --params "(your parameters)"
Or use --help to show help:
C:\Users\russe\.TRIGGERcmdData>tcmd -h NAME: tcmd - Run commands on computers in your TRIGGERcmd account USAGE: tcmd [options] OPTIONS: --trigger value, -t value Trigger name of the command you want to run --computer value, -c value Name of the computer (leave blank for your default computer) --params value, -p value Any parameters you want to add to the remote command --list, -l List your commands --help, -h show help --version, -v print the version
FYI, it logs in using the ~/.TRIGGERcmdData/token.tkn or C:\Users\(user)\.TRIGGERcmdData\token.tkn file depending on the OS. That token.tkn file gets written when you install the TRIGGERcmd agent.
-
@russ directions state -c option can be blank if running from default which I am I'll try adding computer name
-
Yep that did it! thanks
-
@tuicemen said in Questions on TMCD tool and usage?:
@russ directions state -c option can be blank if running from default which I am I'll try adding computer name
You're right, that should work. Thanks for pointing that out. I need to fix that.
EDIT: Fixed - now if you don't specify the computer it will run on your default computer.
-
@russ, thanks I'll update the tool.
-
@russ I updated the tool, option -v states: tcmd version 1.0.5
Can't remember what it was previously but I still have to input the computer name.
Maybe the issue is only for the tcmd-linux-arm file. -
@tuicemen, I actually fixed it on the server side in this case. I found that it even worked on version 1.0.3
tcmd -t calculator {"message":"Trigger sent."} tcmd -v tcmd version 1.0.3
I upgraded to 1.0.5 and it still works:
tcmd -v tcmd version 1.0.5 tcmd -t calculator {"message":"Trigger sent."}
-
@russ yep your right it works, guess my fat fingers got in the way.
Sorry about that. -
@tuicemen, nice, no problem. I'm glad it works.
Isn't that a nice way to trigger your command from a command? I think it's easier than using curl.
-
@russ Ya it is so simple to use. I like the list option for showing trigger names. My memory isn't what it use to be and my spelling never was the greatest!