I would like to share the Step-by-Step of installing GenieACS v1.2.7 on Ubuntu 20.04 LTS under Windows 10 + VirtualBox
+ Download Ubuntu 20.04 Server from https://releases.ubuntu.com/20.04/ubunt ... -amd64.iso
+ Download latest version of VirtualBox from https://download.virtualbox.org/virtual ... 42-Win.exe
Install VirtualBox and follow the wizard.
Launch Virtual Box, click New
Code: Select all
Name : GenieACS
Type : Linux
Version : Ubuntu (64-bit)
Memory Size : 2048MB
Hard disk : Create a virtual disk now
Hard disk file type : VDI / VrtualBox Disk Image
Storage on physical hard disk : Dymanically allocated
File location and size : 20GB
Click the newly created machine and click Settings.
Click Network and than Adapter 1. Make sure Enable Network Adapter checked and Attached to Bridged Adapter.
Click Storage, under click Empty under Controller: IDE, click the DVD image next to Optical Drive, choose Choose a Disk File and select the above Ubuntu Server Image.
Click OK, and than click Start (Green right arrow) and follow the installation instruction. Do not forget to install OpenSSH Server.
While the installation run, i make the static lease on MikroTik DHCP Server leased (in my case 192.168.28.8) so later i can open via browser and or ssh to that ip address.
Once the above Ubuntu installation done, please ssh (suggested using putty) into the newly created Ubuntu Server and do the following installation :
node.js
=======
Code: Select all
cd ~
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
node -v
v.14.15.4
MongoDB
=======
Code: Select all
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
● OK
Code: Select all
apt-key list
● /etc/apt/trusted.gpg
--------------------
pub rsa4096 2019-05-28 [SC] [expires: 2024-05-26]
2069 1EEC 3521 6C63 CAF6 6CE1 6564 08E3 90CF B1F5
uid [ unknown] MongoDB 4.4 Release Signing Key <packaging@mongodb.com>
. . .
Code: Select all
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install mongodb-org
sudo systemctl start mongod.service
sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-09 12:57:06 UTC; 2s ago
Docs: https://docs.mongodb.org/manual
Main PID: 37128 (mongod)
Memory: 64.8M
CGroup: /system.slice/mongod.service
└─37128 /usr/bin/mongod --config /etc/mongod.conf
Code: Select all
sudo systemctl enable mongod
mongo --eval 'db.runCommand({ connectionStatus: 1 })'
● MongoDB shell version v4.4.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("1dc7d67a-0af5-4394-b9c4-8a6db3ff7e64") }
MongoDB server version: 4.4.0
{
"authInfo" : {
"authenticatedUsers" : [ ],
"authenticatedUserRoles" : [ ]
},
"ok" : 1
}
Code: Select all
sudo systemctl status mongod
sudo systemctl start mongod
sudo systemctl stop mongod
sudo systemctl restart mongod
sudo systemctl disabe mongod
sudo systemctl enable mongod
GenieACS:
=========
the instructions are on http://docs.genieacs.com/en/latest/inst ... l-genieacs
Code: Select all
sudo npm install -g --unsafe-perm genieacs@1.2.7
sudo useradd --system --no-create-home --user-group genieacs
We’ll use /opt/genieacs/ext/ directory to store extension scripts (if any).
Code: Select all
sudo su
mkdir /opt/genieacs
mkdir /opt/genieacs/ext
chown genieacs:genieacs /opt/genieacs/ext
create /opt/genieacs/genieacs.env with following content :
Code: Select all
GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
GENIEACS_EXT_DIR=/opt/genieacs/ext
GENIEACS_UI_JWT_SECRET=secret
set the permission and ownership of /opt/genieacs/genieacs.env
Code: Select all
sudo chown genieacs:genieacs /opt/genieacs/genieacs.env
sudo chmod 600 /opt/genieacs/genieacs.env
logs directory
Code: Select all
mkdir /var/log/genieacs
chown genieacs:genieacs /var/log/genieacs
Create systemd unit files:
genieacs-cwmp
-------------
sudo systemctl edit --force --full genieacs-cwmp
Code: Select all
[Unit]
Description=GenieACS CWMP
After=network.target
[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-cwmp
[Install]
WantedBy=default.target
genieacs-nbi
------------
sudo systemctl edit --force --full genieacs-nbi
Code: Select all
[Unit]
Description=GenieACS NBI
After=network.target
[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-nbi
[Install]
WantedBy=default.target
genieacs-fs
-----------
sudo systemctl edit --force --full genieacs-fs
Code: Select all
[Unit]
Description=GenieACS FS
After=network.target
[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-fs
[Install]
WantedBy=default.target
genieacs-ui
-----------
sudo systemctl edit --force --full genieacs-ui
Code: Select all
[Unit]
Description=GenieACS UI
After=network.target
[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/usr/bin/genieacs-ui
[Install]
WantedBy=default.target
logrotate
---------
create /etc/logrotate.d/genieacs with content :
Code: Select all
/var/log/genieacs/*.log /var/log/genieacs/*.yaml {
daily
rotate 30
compress
delaycompress
dateext
}
check all units and make sure no errors :
Code: Select all
sudo systemctl enable genieacs-cwmp
sudo systemctl start genieacs-cwmp
sudo systemctl status genieacs-cwmp
sudo systemctl enable genieacs-nbi
sudo systemctl start genieacs-nbi
sudo systemctl status genieacs-nbi
sudo systemctl enable genieacs-fs
sudo systemctl start genieacs-fs
sudo systemctl status genieacs-fs
sudo systemctl enable genieacs-ui
sudo systemctl start genieacs-ui
sudo systemctl status genieacs-ui
Open GenieACS Server web (in my case http://192.168.28.8:3000) from any browser, for newly installation need to click ABRACADABRA than the system will create the first username admin/admin.
Please login using admin/admin and create another user under Admin tab.
To make MikroTik Devices to be well listed into GenieACS, you need to edit both Index Page and Device Page.
Both mentioned pages can be reached under Admin tab, Config and you will see Edit index page and Edit device page. Go to the link and change the contents to my codes.
My codes are as follow :
Index page:
Code: Select all
- label: "'Serial number'"
parameter: Device.DeviceInfo.SerialNumber
type: "'device-link'"
components:
- type: "'parameter'"
- label: "'Identity'"
parameter: Device.DeviceInfo.X_MIKROTIK_SystemIdentity
- label: "'Class'"
parameter: Device.DeviceInfo.ProductClass
- label: "'Model'"
parameter: Device.DeviceInfo.ModelName
- label: "'ROS'"
parameter: Device.DeviceInfo.SoftwareVersion
- label: "'Uptime'"
parameter: Device.DeviceInfo.UpTime
- label: "'Ether1 MAC'"
parameter: Device.Ethernet.Interface.1.MACAddress
- label: "'DHCP Client IP'"
parameter: Device.DHCPv4.Client.1.IPAddress
- label: "'IP'"
parameter: Device.IP.Interface.1.IPv4Address.1.IPAddress
- label: "'WiFi 1'"
parameter: Device.WiFi.AccessPoint.1.AssociatedDeviceNumberOfEntries
- label: "'WiFi 2'"
parameter: Device.WiFi.AccessPoint.2.AssociatedDeviceNumberOfEntries
- label: "'DHCP'"
parameter: Device.Hosts.HostNumberOfEntries
- element: "'span.inform'"
label: "'Last inform'"
parameter: DATE_STRING(Events.Inform)
type: "'container'"
components:
- type: "'parameter'"
- chart: "'online'"
type: "'overview-dot'"
- label: "'Tags'"
parameter: Tags
type: "'tags'"
unsortable: true
writable: false
Device page:
Code: Select all
- type: "'tags'"
- type: "'ping'"
- type: "'parameter-list'"
parameters:
- element: "'span.inform'"
label: "'Last inform'"
parameter: DATE_STRING(Events.Inform)
type: "'container'"
components:
- type: "'parameter'"
- chart: "'online'"
type: "'overview-dot'"
- type: "'summon-button'"
parameters:
- Device.DeviceInfo.X_MIKROTIK_SystemIdentity
- Device.DeviceInfo.X_MIKROTIK_ArchName
- Device.DeviceInfo.Description
- Device.DeviceInfo.ManufacturerOUI
- Device.DeviceInfo.HardwareVersion
- Device.DeviceInfo.ProductClass
- Device.DeviceInfo.ModelName
- Device.DeviceInfo.SerialNumber
- Device.Ethernet.Interface.1.MACAddress
- Device.DeviceInfo.SoftwareVersion
- Device.DeviceInfo.UpTime
- Device.DHCPv4.Client.1.IPAddress
- Device.IP.Interface.1.IPv4Address.1.IPAddress
- Device.WiFi.SSID.1.SSID
- Device.WiFi.SSID.2.SSID
- Device.WiFi.SSID.1.MACAddress
- Device.WiFi.SSID.2.MACAddress
- Device.WiFi.AccessPoint.1.AssociatedDeviceNumberOfEntries
- Device.WiFi.AccessPoint.2.AssociatedDeviceNumberOfEntries
- Device.WiFi.AccessPoint.1.AssociatedDevice
- Device.WiFi.AccessPoint.2.AssociatedDevice
- Device.Hosts.Host
- Device.Hosts.HostNumberOfEntries
- Device.ManagementServer
- label: "'Manufacturer'"
parameter: DeviceID.Manufacturer
- label: "'Hardware version'"
parameter: Device.DeviceInfo.HardwareVersion
- label: "'Product class'"
parameter: Device.DeviceInfo.ProductClass
- label: "'Model Name'"
parameter: Device.DeviceInfo.ModelName
- label: "'Serial number'"
parameter: DeviceID.SerialNumber
- label: "'Ethernet 1 MAC'"
parameter: Device.Ethernet.Interface.1.MACAddress
- label: "'Wireless 1 MAC'"
parameter: Device.WiFi.SSID.1.MACAddress
- label: "'Software version'"
parameter: Device.DeviceInfo.SoftwareVersion
- label: "'UP Time'"
parameter: Device.DeviceInfo.UpTime
- label: "'Identity'"
parameter: Device.DeviceInfo.X_MIKROTIK_SystemIdentity
- label: "'IP'"
parameter: Device.IP.Interface.1.IPv4Address.1.IPAddress
- label: "'WLAN1 SSID'"
parameter: Device.WiFi.SSID.1.SSID
- label: "'WLAN2 SSID'"
parameter: Device.WiFi.SSID.2.SSID
- label: "'WLAN1 hosts'"
parameter: Device.WiFi.AccessPoint.1.AssociatedDevice
type: "'parameter-table'"
childParameters:
- label: "'MAC address'"
parameter: MACAddress
- label: "'Signal'"
parameter: SignalStrength
- label: "'SNR'"
parameter: X_MIKROTIK_Stats.SignalToNoise
- label: "'Tx Packet'"
parameter: Stats.PacketsSent
- label: "'Rx Packet'"
parameter: Stats.PacketsReceived
- label: "'Tx Byte'"
parameter: Stats.BytesSent
- label: "'Rx Byte'"
parameter: Stats.BytesReceived
- label: "'CCQ'"
parameter: X_MIKROTIK_Stats.TxCCQ
- label: "'Tx Frame'"
parameter: X_MIKROTIK_Stats.TxFrames
- label: "'Rx Frame'"
parameter: X_MIKROTIK_Stats.RxFrames
- label: "'HwTx Frame'"
parameter: X_MIKROTIK_Stats.TxHwFrames
- label: "'HwRx Frame'"
parameter: X_MIKROTIK_Stats.RxHwFrames
- label: "'Tx FrameByte'"
parameter: X_MIKROTIK_Stats.TxFrameBytes
- label: "'Rx FrameByte'"
parameter: X_MIKROTIK_Stats.RxFrameBytes
- label: "'HwTx FrameByte'"
parameter: X_MIKROTIK_Stats.TxHwFrameBytes
- label: "'HwRx FrameByte'"
parameter: X_MIKROTIK_Stats.RxHwFrameBytes
- label: "'WLAN2 hosts'"
parameter: Device.WiFi.AccessPoint.2.AssociatedDevice
type: "'parameter-table'"
childParameters:
- label: "'MAC address'"
parameter: MACAddress
- label: "'Signal'"
parameter: SignalStrength
- label: "'SNR'"
parameter: X_MIKROTIK_Stats.SignalToNoise
- label: "'Tx Packet'"
parameter: Stats.PacketsSent
- label: "'Rx Packet'"
parameter: Stats.PacketsReceived
- label: "'Tx Byte'"
parameter: Stats.BytesSent
- label: "'Rx Byte'"
parameter: Stats.BytesReceived
- label: "'CCQ'"
parameter: X_MIKROTIK_Stats.TxCCQ
- label: "'Tx Frame'"
parameter: X_MIKROTIK_Stats.TxFrames
- label: "'Rx Frame'"
parameter: X_MIKROTIK_Stats.RxFrames
- label: "'HwTx Frame'"
parameter: X_MIKROTIK_Stats.TxHwFrames
- label: "'HwRx Frame'"
parameter: X_MIKROTIK_Stats.RxHwFrames
- label: "'Tx FrameByte'"
parameter: X_MIKROTIK_Stats.TxFrameBytes
- label: "'Rx FrameByte'"
parameter: X_MIKROTIK_Stats.RxFrameBytes
- label: "'HwTx FrameByte'"
parameter: X_MIKROTIK_Stats.TxHwFrameBytes
- label: "'HwRx FrameByte'"
parameter: X_MIKROTIK_Stats.RxHwFrameBytes
- label: "'DHCPv4 hosts'"
parameter: Device.Hosts.Host
type: "'parameter-table'"
childParameters:
- label: "'IP address'"
parameter: IPAddress
- label: "'MAC address'"
parameter: PhysAddress
- label: "'Host name'"
parameter: HostName
- label: "'Interface'"
parameter: Layer1Interface
- element: "'div'"
type: "'container'"
components:
- element: "'h3'"
type: "'container'"
components:
- "'Faults'"
- type: "'device-faults'"
- element: "'div'"
type: "'container'"
components:
- element: "'h3'"
type: "'container'"
components:
- "'All parameters'"
- type: "'all-parameters'"
- type: "'device-actions'"
Other configuration: cwmp.deviceOnlineThreshold = 10000 or more
this configuration need to be added if you experience the error message 'No contact from device' when Summon clicked.
as state on the wiki (https://wiki.mikrotik.com/wiki/Manual:TR069-client), MikroTik will accept the following file types from ACS, they are :
1 Firmware Upgrade Image
3 Vendor Configuration File
X MIKROTIK Factory Configuration File
Important notes:
on the Mikrotik Router, please issue the following command :
Code: Select all
/tr069-client set acs-url=http://192.168.28.8:7547 enabled=yes periodic-inform-interval=5m
Make sure GenieACS and the target router can be ping each other, and no firewall that will block the communication among them.
Example of use :
● upgrade MikroTik RoS and Firmware, please create the following files and upload them to genieacs with type 1 Firmware Upgrade Image
Files:
ros-smips-6.46.8.xml:
Code: Select all
<upgrade version="1" type="links">
<config/>
<links>
<link>
<url>http://192.168.28.8:7567/advanced-tools-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/dhcp-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/ppp-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/security-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/system-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/tr069-client-6.46.8-smips.npk</url>
</link>
<link>
<url>http://192.168.28.8:7567/wireless-6.46.8-smips.npk</url>
</link>
</links>
</upgrade>
+ please include tr069-client-6.46.8-smips.npk package as well, otherwise you will loose the connection after upgrade.
+ please create another .xml for another architecture, such as mmips, mipsbe, ppc, tile, arm, etc.
+ please upload each individual .npk file mentioned on the above .xml files accordingly for each architecture used.
+ all files must with type 1 Firmware Upgrade Image
Create the following provisions:
ros-upgrade:
Code: Select all
let version=declare("Device.DeviceInfo.SoftwareVersion",{value: 1}).value[0];
let archname=declare("Device.DeviceInfo.X_MIKROTIK_ArchName",{value: 1}).value[0];
log('Software version: '+archname+' - '+version);
if (version>="6.46.8") {
log('No upgrade needed');
declare("Tags.UPGRADED",null,{value: true});
} else {
log('downloading Router OS files...');
declare("Downloads.[FileType:1 Firmware Upgrade Image]", {path: 1}, {path: 1});
declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName", {value: 1}, {value: "ros-"+archname+"-6.46.8.xml"});
declare("Downloads.[FileType:1 Firmware Upgrade Image].Download", {value: 1}, {value: Date.now()});
declare("Tags.UPGRADED",null,{value: true});
}
Let say you wanna upgrade the ROS version on the router hap mini with serial 1234567890
Create the following presets:
Name: router1-ros-upgrade
Events: 1 BOOT
Preconditon Device.DeviceInfo.SerialNumber = '1234567890'
Configurations Provision name: ros-upgrade
Power cycle the mentioned router – with serial number (1234567890) and the upgrade progress with be carried by GenieACS. Alternatively, you can disable and enable tr069-client on MikroTik router. When the ugprade finish, you will see UPGRADED under tags of index page.
● update current MikroTik configuration
Create any mikrotik script file and save it. Make sure the file has been tested with no errors.
If the file save with extention .alter than the script made will add the configuration on top of the existing configuration
If the file save with extention other than.alter (such as .rsc) than the script made will reset the router and load the configuration from the mentioned file.
Upload the created above files (.alter or other then .alter) to genieacs with type 3 Vendor Configuration File
To push the configuration, you can do Provisions and Presets like the previous example, or directly push the file under Device Tab.
This configuration will be loss when /system reset command issued.
● change the MikroTik default factory configuration
the file type X MIKROTIK Factory Configuration File will replace the default factory configuration.
As GenieACS v1.2.7 does not have an option to add X MIKROTIK Factory Configuration File type, than you can edit file app.js under /lib/node_modules/genieacs/public and add “X MIKROTIK Factory Configuration File” after “5 Ringer File” in 2 places, so it will become
Code: Select all
“5 Ringer File”,“X MIKROTIK Factory Configuration File”
Create the newly .rsc file, test it and make sure no errors. Than upload it into GenieACS with file type X MIKROTIK Factory Configuration File.
To push the configuration, you can do Provisions and Presets like the previous example, or directly push the file under Device Tab.
This configuration will be load on every /system reset command issued.
I will try to make the video on regards of this tutorial as soon as i have time.
Thank you
Paul Darius