Miroca_Server
This commit is contained in:
5
api/mikrotik/api.py
Normal file
5
api/mikrotik/api.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import ros_api
|
||||
|
||||
router = ros_api.Api('192.168.10.1', user='server', password='Cbvgcjy0V', port='8728')
|
||||
r = router.talk('/interface/wireless/cap/print')
|
||||
print(r[0]['enabled'])
|
||||
15
api/mikrotik/total.py
Normal file
15
api/mikrotik/total.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import netmiko
|
||||
from netmiko import ConnectHandler
|
||||
|
||||
mikrotik_router_1 = {
|
||||
'device_type': 'mikrotik_routeros',
|
||||
'host': '192.168.10.1',
|
||||
'port': '2202',
|
||||
'username': 'server',
|
||||
'password': 'Cbvgcjy0V'
|
||||
}
|
||||
|
||||
sshCli = ConnectHandler(**mikrotik_router_1)
|
||||
print(sshCli.find_prompt())
|
||||
output = sshCli.send_command("/interface ethernet print")
|
||||
print(output)
|
||||
Reference in New Issue
Block a user