Community discussions

 
User avatar
pnajm
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 93
Joined: Thu Nov 21, 2013 6:54 pm

Using PRTG to execute a script through Mikrotik API

Tue Oct 01, 2019 3:04 am

In PRTG notification template there is an option to execute HTTP action when a condition is met.
The HTTP action needs a URL, http method and payload.
I kindly require help in order to access the mikrotik through api and run a script called "myscript".
What would the URL format be?
What is the HTTP method?
What is the code required to execute the script?

Thanks for help.
 
User avatar
pnajm
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 93
Joined: Thu Nov 21, 2013 6:54 pm

Re: Using PRTG to execute a script through Mikrotik API

Tue Oct 08, 2019 3:09 pm

bump!
 
User avatar
jprietove
Trainer
Trainer
Posts: 96
Joined: Fri Jun 03, 2016 3:00 pm
Location: Cádiz, Spain
Contact:

Re: Using PRTG to execute a script through Mikrotik API

Tue Oct 08, 2019 11:55 pm

I don't know exactly what are you trying to do. If you want to execute a script in a MikroTik router you can follow this link https://wiki.mikrotik.com/wiki/Manual:SNMP#Run_Script

Using the OID and with write permissions in SNMP when PRTG gets the data though SNMP using this OID, the script is executed
 
User avatar
pnajm
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 93
Joined: Thu Nov 21, 2013 6:54 pm

Re: Using PRTG to execute a script through Mikrotik API

Wed Oct 09, 2019 12:30 am

I don't know exactly what are you trying to do. If you want to execute a script in a MikroTik router you can follow this link https://wiki.mikrotik.com/wiki/Manual:SNMP#Run_Script

Using the OID and with write permissions in SNMP when PRTG gets the data though SNMP using this OID, the script is executed
Maybe I wasn't clear in my original post. My apologies.
In PRTG program, you can define a template to send a notification whenever a condition is met, for example (sms, email) etc.

This is a screenshot from PRTG (notification template)
PRTG.JPG
The HTTP action lets you create an api request from PRTG to Mikrotik and run certain script.

My Question:
1-What should I put in the URL field if I want to login to a Mikrotik with an IP address of 192.168.88.1 and run a script named "MyScript" ?
2- Which "HTTP Method" should I select (GET, POST, PUT or PATCH)

Note: If I select POST, PUT or PATCH an additional field opens up called "Payload",
PRTG1.JPG
Perhaps this field is where the code should be placed to run the script on Mikrotik?
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: MSN [Bot] and 76 guests