@Russ
This is exactly what i needed! Thanks very much!
Yeah parameter tracking would be great but there's no rush to implement it. I'd mainly just use it for repeating triggers.
@Russ
This is exactly what i needed! Thanks very much!
Yeah parameter tracking would be great but there's no rush to implement it. I'd mainly just use it for repeating triggers.
@Russ
I was thinking more along the lines of changing the request to be similar to the triggerSave API endpoint where it would use the computer name and the trigger name instead of the trigger id.
Something like this
# Replace COMPUTERNAME, TRIGGERNAME, STATUS and TOKEN with actual values
https://www.triggercmd.com/api/run/lastruntime?computer=COMPUTERNAME&trigger=TRIGGERNAME&status=STATUS&token=TOKEN
# e.g
https://www.triggercmd.com/api/run/lastruntime?computer=Mitch-PC&trigger=CreateFile&status=Ran&token=1234567891011121314151617181920
Output
{
"trigger": "CreateFile",
"computer": "Mitch-PC",
"parameters": "[names, docx]",
"user": "167836262hd738j0002b7ue",
"status": "Command ran",
"createdAt": "2018-10-12T20:02:39.165Z",
"updatedAt": "2018-10-12T20:02:39.165Z",
"id": "5abe97df88d0f810005422a0"
}
I'm not sure if you track what parameters have been used but including this in the output could allow the last command to be repeated with the same parameters.
@russ
Thanks!
If it reduces stress on your server you can remove the extra fields. I could use a regex anyway to just get the createdAt/updatedAt value so I don't really mind what the rest of the output is.
Would it be possible to use the command name rather than the command id though? I've noticed that when editing commands they generate a new command id and I don't want to have to update my script with the new id every time.
Thanks again!
Hi Russ,
Is there an API call to query when a command was last run?
I could use the method below but was wondering if there is a better way to do it.
# Replace COMMAND_ID and TOKEN with actual values
https://www.triggercmd.com/api/run/list?status=Command+ran&command_id=COMMAND_ID&token=TOKEN
Thanks,
Mitch Razga