How to use the SNMP with API Mikrotik
Posted: Wed Dec 06, 2017 6:42 pm
This code below works, but the other one does not.
What is the basic syntax for SNMP commands via API? I use the command below, but something is certainly missing.
Using the API, which command to display the SSID, or the MAC of a device?
Code: Select all
$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.
Code: Select all
$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 );