How do I add the following to an existing and working email script (it sends a telegram to my phone).
/ tool fetch "https://api.telegram.org/bot1111111111:t rAndomStrInGof lettersandnumbers/sendMessage?chat_id
=-222222222&text=Router $[/system identity get name] has detected the HP Printer Offline"
:log info "Telegram notification sent about HP Printer offline"
…
If the email script that works to send me an email is as follows when the DEVICE (printer) status is changed to DOWN:
:local sub1 ([/system clock get time])
/tool e-mail send from="myemail@address.com.ca" body="At $sub1 HP Printer is Offline" subject="HP Printer is offline" to="myemail@address.com"
:log info "CHECK HP printer stat!!"
…
Is there some special syntax to join to separate functions??
This does not work…
:local sub1 ([/system clock get time])
/tool e-mail send from="myemail@address.com.ca" body="At $sub1 HP Printer is Offline" subject="HP Printer is offline" to="myemail@address.com"
:log info "CHECK HP printer stat!!"
/ tool fetch "https://api.telegram.org/bot1111111111:t rAndomStrInGof lettersandnumbers/sendMessage?chat_id
=-222222222&text=Router $[/system identity get name] has detected the HP Printer Offline"
:log info "Telegram notification sent about HP Printer offline"
I finally got the Fetch script working the issue was a hidden return character or extra space that I had to remove.
Now my netwatch can fetch a script from systems scripts…
wow thats very advanced for me LOL, an automated master script that runs and updates a bunch of others…
I didnt understand your notification script so rather not use what I dont fathom.
What I would like is to know how to insert date/time or just time into my Fetch URL script.
This way isnt working very well with multiple scripts
It seems to work great in simple /tool email netwatch scripts…
:local sub1 ([/system clock get time])
/tool e-mail send from=“myemail@address.com” body=“At $sub1 HP Printer is Offline” subject=“HP Printer is offline” to=“myemail@address.com”
:log info “CHECK HP printer stat!!”
But I get poor results when using it in /tool fetch scripts in system scripts, when the time is within an URL. I often get no entry where the time should be.