Community discussions

MikroTik App
 
GuttoSP
just joined
Topic Author
Posts: 6
Joined: Sat May 19, 2012 5:20 am

How to use the SNMP with API Mikrotik

Wed Dec 06, 2017 6:42 pm

This code below works, but the other one does not.
$API->write('/ip/dhcp-server/lease/print', false);
$API->write('~active-address~"1.1."');
$ARRAY = $API->read();
$API->disconnect();

What is the basic syntax for SNMP commands via API? I use the command below, but something is certainly missing.
$API = new RouterosAPI();
$API->write( "/ip/snmp/print" ); // or $API->write( "/tool snmp" );	
$API->write('=address=177.xx.xxx.xx', false);
$ARRAY = $API->read();
var_dump( $ARRAY );
Using the API, which command to display the SSID, or the MAC of a device?

Who is online

Users browsing this forum: No registered users and 17 guests