There are two installation options available. If you are experienced *nix user, you can deploy all of the services manually on your server using deployment instructions below. Or you can download our [almost] ready-to-use FlapMyPort Server Image for and run it on virtual machine.

Manual Installation Instructions

This example is for CentOS Linux.

LAMP

You can find a lot of great tutorials on Internet about how to install Apache + MySQL + PHP on the Linux host. We are not going to repeat themselves here so please investigate and do it on your own. For further steps we suppose that you have installed LAMP (of LEMP) stack on your server with «/var/www/html» as a document root.

Try to not use private IP addresses for hosting API because it will make the API inaccessible from everywhere behind your network. You can protect your web directory with HTTP Basic auth. Our clients can deal with HTTP Basic authentication.

Additional packages

yum -y install php-gd
yum -y install net-snmp net-snmp-utils
yum -y install epel-release
yum -y install -y python-pip
pip install sqlalchemy
pip install pymysql

Database

Shall you have MySQL installed and running you are going to create Database structure and database user.

Enter MySQL CLI

$ mysql

Create database in Mysql CLI:

create database traps;

Create a database user (change login and password if neccesary)

CREATE USER 'flap'@'localhost' IDENTIFIED BY 'flapmyport';
GRANT ALL PRIVILEGES ON * . traps TO 'flap'@'localhost';
GRANT ALL PRIVILEGES ON `traps`.* TO `flap`@`localhost`;
FLUSH PRIVILEGES;

Installing FlapMyPort WEB

This is an optional step but we recommend you to install FlapMyPort WEB on the server.

1. Go to you web document root

$ cd /var/www/html/

2. Download FlapMyPort WEB archive

$ wget http://flapmyport.com/files/FlapMyPortWEB.zip

3. Unpack the archive

$ unzip FlapMyPortWEB.zip

Installing and configuring snmptrapd

1. Install the net-snmp package

$ sudo yum install net-snmp

2. Replace the contents of /etc/snmp/snmptrapd.conf with the following text:

disableAuthorization yes
outputOption X
traphandle default /root/trap_handler/trap_handler.sh

3. Start snmptrapd

$ sudo snmptrapd

Or you can temporary run it in foreground to check if it’s handle snmp traps:

$ snmptrapd -fnLo

4. [Somehow] ensure that snmptrapd will start automatically at next boot

Installing FlapMyPort API

1. Create the folder for API

$ mkdir /var/www/html/api

2. Go to the folder

$ cd /var/www/html/api

3. Download FlapMyPort API archive

$ wget http://flapmyport.com/files/FlapMyPortAPI.zip

4. Unpack the archive

$ unzip FlapMyPortAPI.zip

5. Change default database username and password as well as Timezone in your configuration file

$ vi config.php

List of supporting timezones you can find here.

Installing Trap Harverster

1. Go to the folder where trap_handler will live

$ cd /usr/local/src/

2. Download Trap Harvester archive

$ wget http://flapmyport.com/files/trap_handler.zip

3. Unzip it and enter to the unzipped folder

$ unzip trap_handler.zip && cd trap_handler

5. Move the bash script which is used by snmptrapd to its location

$ mv trap_handler.sh /usr/local/bin/

6. Do the needed changes in config.py

$ vi config.py

FlapMyPort Server image

The FlapMyPort Server image is currently preparing for release.