meshmonitor icon indicating copy to clipboard operation
meshmonitor copied to clipboard

[FEAT] extend scripts env or answer option in Auto Responder

Open sergeygalkin opened this issue 11 months ago • 5 comments

Hi Yeraze, thank you very much for the excellent product !

Is there any future plan of add answer option or extended env variables in Auto Responder? Something like SHORT_NODE_NAME and LONG_NODE_NAME :) FROM_NODE looks like very hard in message body

Thank you, Serge

sergeygalkin avatar Dec 18 '25 06:12 sergeygalkin

Can you elaborate or share screenshots of what you're talking about? I thought these variables were already supported.

Yeraze avatar Dec 18 '25 13:12 Yeraze

Hi, he's talking about these variables. https://meshmonitor.org/user-scripts.html#environment-variables

Sashoid-x avatar Dec 18 '25 14:12 Sashoid-x

Yes, and some of these variables are already exposed to Auto-Respond scripts as documented here : https://meshmonitor.org/user-scripts.html#environment-variables

Yeraze avatar Dec 18 '25 14:12 Yeraze

FROM_NODE returns the numeric node ID. For convenience, it would be nice to have variables like SHORT_NODE_NAME and LONG_NODE_NAME that would return values ​​from the ShortName and LongName. Perhaps these could be retrieved using PARAM_* ?

Sashoid-x avatar Dec 18 '25 14:12 Sashoid-x

On example if I need to add to answer in bash script something like this

FRENLY_NAME=$(curl -H "Accept: application/json" \
  -H "Authorization: Bearer $API_TOKEN" \ 
 "http://localhost:8080/api/v1/nodes/\!$FROM_NODE" | jq -r '.data | "\(.longName)(\(.shortName))"')

but i don't see jq inside docker container and need to add API_TOKEN

may be you can add all info from api/v1/nodes/!$FROM_NODE as env variables ? FROM_NODE_INFO_NODENUM, FROM_NODE_INFO_LONGNAME, FROM_NODE_INFO_SHORTNAME, ...etc

sergeygalkin avatar Dec 18 '25 15:12 sergeygalkin