Thursday, March 27, 2014

Mikrotik The Dude On Ubuntu 12.04 Lts Server (Step-By-Step)


On my network I cause got a single, depression ability server, running on my unmarried highsite. This server runs Ubuntu 12.04.2 LTS, together with it does non cause got the oomph to virtualize windows for the sake of dude. To this goal I cause got deployed The Dude running nether Wine.

Dude is a network monitoring application yesteryear Mikrotik that is first-class for monitoring Mikrotik together with other SNMP enabled devices.

We volition non move compiling anything, opting rather for the easier apt-get installs where possible.

This tutorial is based off the instructions from the Mikrotik Wiki, but adapted for Ubuntu 12.04 together with The Dude Version 4.0 Beta 3

Please Note:

I volition move running The Dude on a headless server, ie. this car has no desktop managing director installed. I volition too move setting upwards The Dude to run every bit a Linux Service together with thus that it starts upwards amongst the server.

Prerequisites:

Make certain yous are running every bit root
The start affair to install is the Wine abstraction layer:
# apt-get install wine

Next, yous desire to install is the Xvfb virtual frame buffer. This is to furnish the graphical surroundings to run The Dude's installer
# apt-get install xvfb

Now install the x11vnc server:
# apt-get install x11vnc

Download The Dude installer, at the fourth dimension of writing, the latest version is 4.0 Beta 3:
# wget http://download.mikrotik.com/dude/4.0beta3/dude-install-4.0beta3.exe

The Dude Installation:

Start a virtual display using xvfb together with enable vnc access:
Xvfb :1 -screen 0 800x600x16 &
x11vnc -display :1 -bg -forever


You tin hand notice instantly start the Dude installation.
export DISPLAY=:1
export WINEPREFIX=/srv/dude
vino dude-install*.exe

Use your favourite VNC customer to connect to your Dude server, this volition acquaint yous amongst The Dude install screen, the setup is fairly simple, yous tin hand notice but click side yesteryear side until the install is finished:




Click approximately complete the install. You may authorities notation that this too ends the procedure on the server ane time the install is done.


Running Dude every bit a Linux Server:

Create the file /etc/init.d/dude
# vim /etc/init.d/dude


And glue the next code (taken from Mikrotik Wiki):
#!/bin/bash

### BEGIN INIT INFO
# Provides: dude
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 three iv 5
# Default-Stop:
# Short-Description: Dude Server
### END INIT INFO

action=${1}

# ----------------------------------------------
# User Options
# ----------------------------------------------
xvfb_pidfile='/var/run/dude-xvfb.pid'
wine_pidfile='/var/run/dude-wine.pid'
virtual_display=':1'
dude_path='/srv/dude'
# ----------------------------------------------

export DISPLAY=$virtual_display
export WINEPREFIX=$dude_path

start ()
{
echo -n 'Starting Dude virtual display: '
Xvfb $virtual_display &> /dev/null &
echo $! > $xvfb_pidfile
echo 'ok'
echo -n 'Starting Dude Server: '
sleep 5
wine 'c:\Program Files (x86)\Dude\dude.exe' --server &> /dev/null &
echo $! > $wine_pidfile
echo 'ok'
}

halt ()
{
echo -n 'Stopping Dude Server: '
kill $(cat $wine_pidfile)
rm -f $wine_pidfile
sleep 5
echo 'ok'
echo -n 'Stopping Dude virtual display: '
kill $(cat $xvfb_pidfile)
rm -f $xvfb_pidfile
echo 'ok'
}

illustration "$action" in
start)
start
;;

stop)
stop
;;

*)
echo "Usage: $0 {start|stop}"
;;
esac

# -----------------------------------------------------------------------


Make the init script executable:
chmod +x /etc/init.d/dude


Start The Dude service:
/etc/init.d/dude start


Add service to startup:
update-rc.d dude defaults

You tin hand notice instantly connect to your Dude server using the criterion Dude customer on your Windows PC