My bad. I forgot to add the “as-value” — that’s critical to returning the data for the string. So it should be “$[/interface/lte/monitor lte1 once as-value]”.
Hey Ammo, many thanks for changing this, but unfortunately this doesn’t work and I get no message at all. The clock and system names work, as I said in my previous examples. These are 1 line results, though.
e.g.
message="Mikrotik SXT Rebooted <b>nPushover</b> $[/system clock get time] $[/system identity get name]"
I’m wondering if it is because the output of LTE monitor has many line of info … that it is not escaping or processing the lines properly
Does this code work on your device pushover? or is there a multi-line output we could check?
It’s not the multi-line output per se. It the data type returned by “monitor” is a RouterOS array type. And one rule (which I forgot in my quick example of LTE monitor) is array cannot be interpolated, so a “:tostr” is needed. This will get rather ugly output, but should work:
Alternatively, you can collect the LTE monitor BEFORE build the PUSHOVER message, and use invidudual data items from LTE monitor in the string, like this:
Hi,
I have a question, not so much about pushover.
I use TheDude and pushover - and it worked perfectly up until version 7.6 - in notifications it was enough to call the function “$pushover message=“Service [Probe.Name] on [Device.Name] is now [Service.Status]”;” just like other scripts.
Unfortunately, in version 7.15 - 7.16 calling $pushover does not work - scripts are called but not pushover - maybe you have an idea to fix it.
But your issue may be permissions on RouterOS side… You likely have put the script in /system/script with “Do not require permissions” with “policy” and “test” rights to run /tool/fetch. I believe there should be some log about it but perhaps not.
policy - policy that grants user management rights. Should be used together with the write policy. > Allows also to see global variables created by other users (requires also ‘test’ policy)> .
test - policy that grants rights to run ping, traceroute, bandwidth-test, wireless scan, snooper, > fetch> , email and other test commands
It’s not a permissions issue.
On RouterOS in the terminal or in other scripts the $pushover function works - and the firmware version /7.6, 7.15, 7.16/ doesn’t matter, only calling the $pushover function/script in TheDude in version 7.15, 7.16 doesn’t work.
Well I do not use notification with Dude, so IDK. But I’m not sure your Terminal test is exactly same user context as Dude running a notification. I cannot say for sure, but when Dude run calls RouterOS… that’s more similar to netwatch (which uses a *sys user), than Terminal from a logged in admin user.
Best you can do is add debug logging and perhaps something shows up when Dude call pushover. Because if it works in Terminal it ain’t the script code itself, thus the theory on permissions - since there are not a lot of other options…
Does calling a more basic script work from Dude? i.e. one that does not use /tool/fetch or global variables…
In this form it works and that’s enough for me. Thank you.
/tool fetch mode=https url="> https://api.pushover.net/1/messages.json> " http-method=post http-data=“token=axxxxxxx&user=uxxxxx1&message=Service [Probe.Name] on [Device.Name] is now [Service.Status]” output=none;