I’m facing a strange issue using ros_command() and /tool fetch in notification.
I’m making a probe using Detect Internet with this command below to get interface statuses that are different than “internet”
ros_command(“:put [interface/detect-internet/state/get [find where state!=internet] name ]”)
The probe works well, in the problem section I get “pppoe-out1” if pppoe-out1 is down, but when I use it with a notification with a /tool fetch to my Telegram and [Service.ProblemDescription] in it the notification doesn’t show up.
If I pass every hand written string like “test” in the proble the notification works and [Service.ProblemDescription] is sent.
Can someone tell me how can I make ros_command() output an actual string? I’m not facing this problem with oid() for example.
The output of /tool/fetch is an array, so you need do something like ([/tool/fetch … as-value output=user]->“data”) in the ros_command() with command escaped.
e.g. ros_command(“([/tool/fetch … as-value output=user]->"data")”)
I didn’t test it, but it’s something like that I suspect.
I’m not using ros_command inside a /tool fetch, I’m using ros_command in a probe and using the problem result in a notification with a /tool fetch.
I am sending probe problem using [Service.ProblemDescription] which I can clearly read in Service → General, but it isn’t sent as [Service.ProblemDescription].
If instead of ros_command() returned value I write a string or get a parse failed error, the fetch sends the message error, so I assume it is ros_command() that doesn’t return a string like oid() for example.