Brief
In this guide we will provide detailed process for installing FastNetMon manually. You may need it when your run FastNetMon in non standard environment or use cloud provisioning. In other cases, please use installer tool.
Requirements
We support this guide only for Ubuntu 18.04
Install process
First of all, we will need https support for APT because FastNetMon’s repository secured using this protocol:
sudo apt install -y apt-transport-https libssl1.0.0 iproute2
After that, please sync time. Our license server relies on accurate time and SSL certificate validation can fail in case of inaccurate time or date.
Add FastNetMon’s repository:
echo "deb [arch=amd64] https://repo.fastnetmon.com/fastnetmon_ubuntu_bionic bionic fastnetmon" | sudo tee /etc/apt/sources.list.d/fastnetmon.list
Put this content into file fastnetmon.key:
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQINBFenbeUBEADdN/WjudCb0FgC3Oe02R3DriRwzlgirMYGOApT+cfMvsety/Wk SRztjFFkX2K/ywXOSRG1+s95D2KG9Ic9vV+2iGKw7q8++v8I1J/bij4r7rY5Pz7m diC83JjdcjX86rmJ0m2P3trhqWhYhd3yxwinQg1/P9Oydv7EqS8ool4RXz9/QKfd U6KtVTp84F/ONVVZaXv1MPLi/OyG/UJKMuYie0Gw6DCsb4KDVukUZisttk5fucz7 HvWU9cD0Xgqxup0QFSa6uI6Zcq7FAlfujeIISAsAAk7IzaIbCiae89HPbmGG0gtH tSJTgrZKl9oshtZcEOyFDX/Q8dUlzv+GIdbK0BJG8buui+2gRGiANe6glplcQGZE kEqSKRnJNi/1WAG4NLpik8WLDhNGVk1G496GtIQl7yyWnB1awXPQqNUBSazdJR9b 6mHQiz1ZoH1LMP2zCwopGrdxQJsi+8bhx9iDUlJbwDhcmNny5oEsbjBZnSwO6CS7 TKUOgpxiCNQ/p/0dM0IlTz2YdAVFAbXW3A3tq+cKRBTSrIMDsm0pPckhgeuekM4K NSb4Izm5NrlM1+tV/JfUUr7I7jSuSpaIbJBgsC94NvA1K2+T0J/gHzsDOASf6OiB rWZ7u+SMSlha2j5dhB3eqt+UZfErBhmnR6Qy4jKncSlo5FiQDTkhDWKKqwARAQAB tClQYXZlbCBPZGludHNvdiA8cGF2ZWwub2RpbnRzb3ZAZ21haWwuY29tPokCPQQT AQoAJwUCV6dt5QIbAwUJEswDAAULCQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRDM fW3ec2JlYw6OEACDOzIrVFTHkRt09Zr5Eoi501+ZH+H0S0+ujuMps76o405lCRZv eUSrLgdGGx6NxkR6x7cGLAeJpn0xuKcVb0fNDwNQQ/wFxsI8h8p0OrIkXJ2I2dX3 8edeNT6Y7dbR7MeSUbRkd5rJECMGT3BJvpHZ8bYosptETlp4HajpTPohZU9poPG/ H+liYcbtFAcw3LqcWzUABqX45UiSittKUgYv4G19/+IkEAjF916fj20HlkZyvU1M aRGfGIQDmLLEsC37iBxfeSmokcb68Ld2uWxTPeZYdAAn2cogu2mO+MKFnCtfGnkP 32IGXcEtTI+dOK6umKiL7tQqmRou2Knx0F4ul7f2i1oTRlf3w5PKKt7BwF572hqW VeGWwVAG4gVEAMncMgFMJPFju9vJX+Zq5WBR8cAJOkA2f6fGsklZgC4qOg/TZeNh WUKdYPXneoh7YMqOY8PaDeVPArk2+N38vsa2sSuSesoo7Xr4b+9D59ZoxEHn6qKs zfIGJqS9dV1OMqwNNi9BDyivor/iDnaoK3xwNsWOg0CjpnFhTLmq1cctO+4pm97q 4JVfmyedg14ADhe3cAsmXWep8v19+OtN3CkHF+HHKULGn3EOIHk7VQmpJlx74y3Q O1QasPDzl2v0nggAJzCng4SkCivzHkP31Y7T4q+WPMjxBfsr9BveAGH6KA== =kFoU -----END PGP PUBLIC KEY BLOCK-----
Add key trust storage:
sudo apt-key add fastnetmon.key
Install FastNetMon:
sudo apt-get update sudo apt install -y fastnetmon
FastNetMon will fail because you do not have MongoDB.
MongoDB installation
If you use Docker you may use standard images with MongoDB. Otherwise, you can install it manually.
We use version 4.0 for Ubuntu 18.04. You can follow official guide or you can follow our own guide.
Add Mongo repository:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
Add Mongo gpg key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
Install MongoDB:
sudo apt-get update sudo apt-get install -y mongodb-org
Load MongoDB:
sudo systemctl enable mongod sudo systemctl start mongod
Create users in MongoDB.
NB! Please replace “<secret_password>” and “<fastnetmon_secure_pasword>” by secure passwords with at least 16 symbols.
Open MongoDB console:
mongo --host 127.0.0.1
Create administrator:
use admin db.createUser( { user: "administrator", pwd: "secret_password", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, { role: "readWriteAnyDatabase", db: "admin" }, { role: "dbAdminAnyDatabase", db: "admin"}, { role: "__system", db: "admin" }] })
Open MongoDB configuration:
sudo nano /etc/mongod.conf
And near commented line “security” add (it enabled authorization):
security: authorization: enabled
Apply changes:
sudo systemctl restart mongod
Create folder for FastNetMon’s passwords:
sudo mkdir -p /etc/fastnetmon/keychain sudo chmod 700 /etc/fastnetmon/keychain
And after that put administrator’s password into this file:
echo -n "secret_password" | sudo tee /etc/fastnetmon/keychain/.mongo_admin
Login into MongoDB as administrator:
mongo admin --username administrator --password `sudo cat /etc/fastnetmon/keychain/.mongo_admin`
Create user for FastNetMon:
use admin db.createUser( { user: "fastnetmon_user", pwd: "fastnetmon_secure_pasword", roles: [ { role: "dbOwner", db: "fastnetmon" } ] } )
Store password for user in file:
echo -n "fastnetmon_secure_pasword" | sudo tee /etc/fastnetmon/keychain/.mongo_fastnetmon_password
Apply changes:
sudo systemctl restart mongod
Confirm that you can login into MongoDB using user credentials:
mongo --host 127.0.0.1 -u fastnetmon_user -p `sudo cat /etc/fastnetmon/keychain/.mongo_fastnetmon_password` --authenticationDatabase admin
Specify MongoDB access credentials for FastNetMon (you do not need it for localhost case but you have to specify remote server when you use it):
sudo nano /etc/fastnetmon/fastnetmon.conf
Default configuration:
{ "mongodb_host": "127.0.0.1", "mongodb_port": 27017, "mongodb_database_name": "fastnetmon", "mongodb_username": "fastnetmon_user", "mongodb_auth_source": "admin" }
Create default configuration:
sudo fcli create_configuration
Restart FastNetMon:
sudo systemctl restart fastnetmon
Confirm that FastNetMon is running properly:
sudo fcli show system_counters