Community discussions

MikroTik App

Search found 12 matches

by DeCr0pt
Sat Aug 26, 2017 1:00 pm
Forum: Scripting
Topic: SFP port status
Replies: 12
Views: 38886

Re: SFP port status

Other solution: I can save a dump to a file, but how do I read a selected data (sfp-tx-power and sfp-rx-power) from a file and send it to value? I think mikrotik dont support this, just use my solution and write it to /tool sms script or other script, if you are interested to scripting i recommend ...
by DeCr0pt
Sat Aug 26, 2017 12:53 pm
Forum: Scripting
Topic: SFP port status
Replies: 12
Views: 38886

Re: SFP port status

As i wrote use variables and print specific key.
:global monitor [/interface ethernet monitor sfp1 once as-value]
:put ($monitor->"sfp-tx-power")
:put ($monitor->"sfp-rx-power")
by DeCr0pt
Fri Aug 25, 2017 1:55 pm
Forum: Scripting
Topic: SFP port status
Replies: 12
Views: 38886

Re: SFP port status

Well, you can simple use variables
:global monitor [/interface ethernet monitor sfp1 once as-value]
:put ($monitor->valuewhatyouwant)
by DeCr0pt
Sun Aug 13, 2017 6:29 pm
Forum: Scripting
Topic: how i can disable and then enable pppoe users automatic ?
Replies: 6
Views: 4805

Re: how i can disable and then enable pppoe users automatic ?

If you are want disable multiple ppp profiles just use array and make foreach example like this: :global ppplimit [:toarray ppp1,ppp2,ppp4] :foreach i in $ppplimit do { /ppp secret disable $i } Add this to scheduler and run it on time what you want, if you want make "enable" script too, ju...
by DeCr0pt
Fri Aug 04, 2017 12:49 pm
Forum: Scripting
Topic: [possible bug] interface id from variable is different
Replies: 4
Views: 1098

Re: [possible bug] interface id from variable is different

I rewrite my script to work just only with name of interface, but it will be good to have something to grep id of interface via get. But thanks anyway
by DeCr0pt
Thu Aug 03, 2017 10:09 pm
Forum: Scripting
Topic: send MikroTik Notification via WhatsApp
Replies: 55
Views: 42119

Re: send MikroTik Notification via WhatsApp

Whatsapp already had a API https://github.com/mgp25/Chat-API, you should try combine it with PHP RouterOS Api or combine it with unix systems and mail server
by DeCr0pt
Thu Aug 03, 2017 10:00 pm
Forum: Scripting
Topic: [possible bug] interface id from variable is different
Replies: 4
Views: 1098

Re: [possible bug] interface id from variable is different

Thanks for info, and how i can get number of position in list? Is possible to use like in unix system /interface print | grep ether2 | awk '{print $1}' ?
by DeCr0pt
Thu Aug 03, 2017 4:58 pm
Forum: Scripting
Topic: [possible bug] interface id from variable is different
Replies: 4
Views: 1098

[possible bug] interface id from variable is different

Hello, i have simple script :local getid [/interface get [find name=ether2] id] normally when i check it via /interface print i see id 1 but when i make :put $getid i got id 6, of course i can use something like a ($getid -5) but i dont want use it because on my testing CHR is this working fine, wha...
by DeCr0pt
Wed Aug 02, 2017 3:19 pm
Forum: Scripting
Topic: Variable in Variable Mikrotik
Replies: 6
Views: 1692

Re: Variable in Variable Mikrotik

Array seems to work but how can i made example this? ($array->"$forVariable") 1; This got empty or very strange output
by DeCr0pt
Wed Aug 02, 2017 2:57 pm
Forum: Scripting
Topic: Variable in Variable Mikrotik
Replies: 6
Views: 1692

Re: Variable in Variable Mikrotik

You should use an array for this. You can loop across an array using foreach. An array index can be a string.
:global ArrayName;

:set ($Arrayname->"value1") 1;
Thanks man, i will try it
by DeCr0pt
Wed Aug 02, 2017 1:32 pm
Forum: Scripting
Topic: Variable in Variable Mikrotik
Replies: 6
Views: 1692

Re: Variable in Variable Mikrotik

And is possible to get a variable directly from /system script enviroment? Example via get? I tried it but i got empty responde
by DeCr0pt
Wed Aug 02, 2017 1:27 pm
Forum: Scripting
Topic: Variable in Variable Mikrotik
Replies: 6
Views: 1692

Variable in Variable Mikrotik

Please sorry for my english i m not native english speaker. Hello, i m trying to make a program what will check my bgp peers, i have set global variables (example 1 = 1 , 2 = 0) and i want make if with foreach. Simple i want make something like a "Variable what will call variable and display va...