Manual:SNMP Write: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
No edit summary
 
(Redirected page to Manual:SNMP)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Overview=
#REDIRECT [[Manual:SNMP]]
 
v3 MikroTik RouterOS supports SNMP write for some functions. SNMP write allows to change router configuration with SNMP requests. Consider to secure access to router or to router's SNMP, when SNMP and write-access are enabled.
 
=Writable options=
 
To change settings by SNMP requests, use the command below to allow SNMP write for the selected community,
Write-access option for SNMP is available from v3.14,
 
<pre>
/snmp community set <number> write-access=yes
</pre>
 
==System Identity==
 
It's possible to change router system identity by SNMP set command,
 
<pre>
snmpset -c public -v 1 192.168.0.0 1.3.6.1.2.1.1.5.0  s New_Identity
</pre>
 
* '''snmpset''', SNMP application used for SNMP SET requests to set information on a network entity;
* '''public''', router's community name;
* '''192.168.0.0''', IP address of the router;
* '''1.3.6.1.2.1.1.5.0''', SNMP value for router's identity;
 
SNMPset command above is equal to the RouterOS command,
 
<pre>
/system identity set identity=New_Identity
</pre>
 
==Reboot==
 
It's possible to reboot the router with SNMP set commamd, you need to set value for reboot SNMP settings, which is not equal to 0,
 
<pre>
snmpset -c public -v 1 192.168.0.0 1.3.6.1.4.1.14988.1.1.7.1.0 s 1
</pre>
 
* '''1.3.6.1.4.1.14988.1.1.7.1.0''', SNMP value for the router reboot;
* '''s 1''', snmpset command to set value, value should not be equal to 0;
 
Reboot snmpset command is equal to the RouterOS command,
 
<pre>
/system reboot
</pre>
 
==Run Script==
 
SNMP write allows to run scripts on the router from '''system script''' menu, when you need to set value for SNMP setting of the script,
 
<pre>
snmpset -c public -v 1 192.168.0.0 1.3.6.1.4.1.14988.1.1.8.1.1.3.X s 1
</pre>
 
* '''X''', script number, numeration starts from 1;
* '''s 1''', snmpset command to set value, value should not be equal to 0;
 
The same command on RouterOS,
 
<pre>
 
/system script> print
Flags: I - invalid
0  name="kaka" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff last-started=jan/01/1970 01:31:57 run-count=23 source=:beep
 
/system script run 0
</pre>
 
[[Category:SNMP]]

Latest revision as of 07:40, 8 December 2011

Redirect to: