Skip to main content

AUTOCENG - MIKROTIK AUTOMATION - EN

Let me introduce my first tools for autoconfigure mikrotik device.

I run this script on Linux Ubuntu 16.04 and python 2.7

I hope this tool useful for you who want to do the same configuration for many devices at once. For example you want to change / ip services or want to add the same firewall, etc. You can also use this tool to backup the router configuration.

For the algorithm, this script checks the ping first before executing directly to the device. If the ping is successful, it will be immediately executed to the device. If the ping test results are not successful, it will be skipped for the device and continued to the next device.

There is 3 files, autoceng.py configmikrotik.py and ipnya.py


 configmikrotik.py : configuration contents to be executed to the device. Write your configuration inside cm variable or below #input config here


ipnya : this file contains list router that will executed by autoceng. Fill this file with this format :

ipaddress|portssh|username|password

example :

172.26.153.130|22|admin|uhuy123
172.26.153.132|22|admin|uhuy123

autoceng.py : main file

How To Use :

[Default]
python autoceng.py

It will do the configuration in accordance with the configmikrotik.py file to all devices in the ip.py file

[Option1]
python autoceng.py withlog

It will do the configuration in accordance with the configmikrotik.py file to all devices in the ip.py file and save the output to log. 

[Option2]
python autoceng.py single {ipaddress} {port} {username} {password}

ex : python autoceng.py single 172.26.122.1 6522 aceng kepo
It will do the configuration in accordance with the configmikrotik.py file to single host only.

[Option3]
python autoceng.py single withlog {ipaddress} {port} {username} {password}

ex : python autoceng.py single withlog 172.26.122.1 6522 aceng kepo
It will do the configuration in accordance with the configmikrotik.py file to single host only and save the output to log.

If you found error, see this.
[Error 1]
Cannot execute this device, make sure you have make the file according to the specified format!

Make sure you have write list device in ipnya according to the specified format

format : ipaddress|portssh|username|password
ex : 172.26.153.130|22|admin|uhuy123

[Error 2] :
Device Down. Skipping.....

Can't connected to router. Checked by icmp ping. If your router not permitted ping, you can edit file autoceng.py at line 126 to this :
before : verifdevice(dd[0],int(dd[1]),dd[2].strip(),dd[3].strip()) 
after : eksekusi(dd[0],int(dd[1]),dd[2].strip(),dd[3].strip())

[Error 3] :
Cant connect to device. Skipping.....

Can't SSH to router. It can be wrong password, wrong port, wrong username or maybe your router have access list for limited access ssh so ssh not permitted from your machine.

loading...

Comments

Popular posts from this blog

Lab 8.8 Konfigurasi Log Analyzer Visited Pages dengan Awstats di Apache pada Centos7

Assalamu’alaikum wr.wb Pada kali ini ane ingin share cara monitoring dengan awstats. Awstats adalah sebuah tools untuk memantau visited pages pada webserver. Langsung saja kita konfigurasi 1. Install epel, karena awstats ini tidak ada pada repository centos, tetapi ada pada epel. Caranya adalah seperti dibawah ini   2. Kemudian install awstats 3. Awstats ini secara default membuat konfigurasi sesuai dengan hostname. Jika tidak sesuai Antara hostname dan web yang akan dibuatkan halaman awstatsnya, maka rename konfigurasi yang ada sesuai hostname menjadi nama domain anda tanpa menghilangkan format yang ada. [root@ct-ali ~]# mv /etc/awstats/awstats.ct-ali.alisofyan.com.conf /etc/awstats/awstats.www.alisofyan.com.conf 4. Konfigurasi awstats untuk webserver yang telah diatur [root@ct-ali ~]# vi /etc/awstats/awstats.www.alisofyan.com.conf Sesuaikan konfigurasi seperti dibawah ini dengan keadaan anda  dan ...

Merepresentasikan Algoritma dengan Flowchart dan Pseudocode

  Merepresentasikan Algoritma dengan Flowchart Flowchart adalah jenis diagram (grafis tau simbolik) yang mewakili suatu algoritma atau proses-proses tertentu. Setiap langkah dalam algoritma diwakili oleh simbol yang sama atau berbeda dan berisi penjelasan singkat setiap langkah. Flowchart merepresentasikan algoritma dalam bentuk desain, simbol dan dijadikan dokumentasi dan kemudian dituangkan menjadi kode-kode program. Sebelum membuat flowchart, kita harus memahami unsur flowchart sebagai berikut : Input Percabangan ( biasanya menggunakan perintah if dan switch) Perulangan ( biasanya menggunakan perintah atau kode while, for, loop, each ) Output Flowchart biasanya digambar menggunakan beberapa simbol standar, namun tidak menutup opsi lain untuk menyertakan simbol-simbol di luar standar untuk digunakan jika memang diperlukan simbol tersebut di desain yang kita buat. Berikut ini simbol – simbol yang biasa digunakan dalam flowchart. Simbol simbol diatas adalah simbol dasar yang diguna...

Contoh Soal Data dalam Sistem Bahasa Pemrograman R

  Tuliskan pernyataan R untuk membuat deret bilangan berikut : x = [-5 -4 -3 -2 -1 0 1 2 3] y = [5 4 3 2 1] z = [1000000 1166667 1333333 1500000 1666667 1833333 2000000] p = [9 9 9 5 5 5] q = [1 1 1 2 2 2 1 1 1 2 2 2] Jawaban : > x <- seq (from=-5,to=3,length=9) > x [1] -5 -4 -3 -2 -1 0 1 2 3 > y <- seq (from=5,to=1,length=5) > y [1] 5 4 3 2 1 > z <- seq (from=1000000,to=2000000,length=7) > z [1] 1000000 1166667 1333333 1500000 1666667 1833333 2000000 > p <- rep(c(9,5),each=3) > p [1] 9 9 9 5 5 5 > q <- rep(c(1,2,1,2),each=3) > q [1] 1 1 1 2 2 2 1 1 1 2 2 2 Tuliskan pernyataan R untuk membuat frame data siswa berikut : No Jurusan asal_daerah usia 1 Komputer Bogor 25 2 Fisika Bogor 25 3 Komputer Bandung 25 4 Fisika Bandung 25 5 Komputer Bogor 26 6 Fisika Bogor 26 7 Komputer Bandung 26 8 Fisika Bandung 26 Jawaban : > jurusan <- c("Komputer","Fisika","Komputer","Fisika","Komputer...
loading...