Friday, November 18, 2016

Webmin / PHP base Mikrotik Control Panel

Following are two good .simple and basic ways to control your Mikrotik Box via your browser as fronted using WEBMIN or PHP base pane at backend. Both are good in there own ways.
Easy to setup and quick to manage , using these method, you don’t have to login via winbox to access your mikrotik for basic management :) ~
Just install them on any Linux base system, it can be your proxy or whatever Linux base pc on LAN you have.


WEMIN BASE CONTROL PANEL

Simply install WEBMIN from http://www.webmin.com and then follow the guide below.

http://wiki.mikrotik.com/wiki/Useful_Bash_Scripts 

[By Mr. Mudassir Mirza @ http://www.diglinux.com/%5D
Snapshot of webmin configured with the mikrotik scripts functions.


(My Modified OnlineUsers.sh, for my personnel reference,
idea was taken from  Mr. Mudassir Mirza @ http://www.diglinux.com/%5D)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# set -x
# for (( ; ; ))
# do
USER="admin"
MTIP="10.10.0.1"
PORT="22"
FPATH="/zaib"
DRL=zaib
FILE=$DRL
rm -fr $FPATH/$DRL.txt
ssh $USER@$MTIP -p $PORT / ppp active print file=$DRL
scp -P 22 $USER@$MTIP:$DRL.txt $FPATH/$DRL.txt
sed -i 's/MEJM-BFQK/secret/g' /zaib/zaib.txt
cat $FPATH/$DRL.txt
echo
echo
TTL=`cat $FPATH/$DRL.txt |sed '1,5d' | wc -l`
echo -e "\t\t\n Total Number of Active Users $TTL"

PHP BASE PANEL

Snapshot of PHP panel configured with the mikrotik scripts functions.

[By Mr. Mudassir Mirza @ http://www.diglinux.com/%5D


You must have LAMP base installation on your nix box. then follow the below guide.
[Note: it have some minor bugs, For example, when you tri to import mysql db via using manual command
1
mysql#\. /var/www/mtpanel/mtpanel.sql;
You may get following error.
1
2
ERROR:
Failed to open file '/var/www/mtpanel/mtpanel.sql;', error: 2
Use the following command instead.
1
mysql -u root -p123 --database mtpanel < mtpanel.sql
There is also an bug in live monitoring of specific user page, that can be corrected by editing it and remove refresh interval.
Warning: This page is accessible by every user, To password protect it, use the following guide to protect it with password.
http://aacable.wordpress.com/2011/11/05/howto-protect-a-web-folder-on-apache-with-password/
You can also remove some of its funcitons, for example i provided this panel for support personnel which have only specific functions available, Live Monitoring , Connected Users, Password Change.
Some information and instructions regarding this panel is well described and discussed at following links

http://wiki.mikrotik.com/wiki/Basic_php_ppp_scriptshttp://forum.mikrotik.com/viewtopic.php?f=2&t=54948

No comments: