Installing manual

Pavel Polyakov edited this page Nov 11, 2016 · 5 revisions

How do I can deploy it on my network?

  1. Install needed packages

    $ yum -y install net-snmp net-snmp-utils
    $ yum -y install mysql
    $ yum -y install epel-release
    $ yum -y install rabbitmq-server
    $ yum -y install -y python-pip
    $ pip install sqlalchemy
    $ pip install pymysql
    $ pip install celery
  2. Configure mySQL

    • Login to mysql

      $ mysql
    • Create database

      MariaDB [(none)]> create database traps;
    • Create user

      MariaDB [(none)]> CREATE USER 'flap'@'localhost' IDENTIFIED BY 'flapmyport';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON * . traps TO 'flap'@'localhost';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON `traps`.* TO `flap`@`localhost`;
      MariaDB [(none)]> FLUSH PRIVILEGES;
  3. Configure Celery

    • Copy into /etc/init.d/celeryd
    • Make it executable
      $ chmod +x /etc/init.d/celeryd
    • Create /etc/default/celeryd as in example
      CELERYD_OPTS="--time-limit=3000 --concurrency=3 -A tasks"
    • Create user celery
      $ sudo useradd -N -M --system -s /bin/bash celery
    • Create group celery
      $ sudo groupadd celery
    • Add user to the group
      $ sudo usermod -g celery celery
  4. Configure snmptrapd

    • Edit /etc/snmp/snmptrapd.conf

      disableAuthorization yes
      sqlMaxQueue 10
      sqlSaveInterval 0
      outputOption X
      traphandle default /usr/local/src/trapharvester/
    • And start snmtrapd

      $ sudo snmptrapd -fnLo &
  5. Configure trap harvester

    • Clone this repo to /usr/local/src/trapharvester/

      $ cd /usr/local/src
      $ git clone
      $ cd trapharvester
    • Rename to

      $ mv
    • Edit with your favorite text editor

      • Configure it for your mysql database.
        • your_username: instead 'flap'
        • your_server: instead 'localhost'
        • your_database: instead 'traps'
        > If you have configured the database as I described above that there is nothing needed to change
        DB_URL = 'mysql+pymysql://flap:flapmyport@localhost/traps'
      • Change from and to mail-adresses
        MAIL_FROM = ''
        MAIL_TO = ['','']
      • Configure SNMP_COMMUNITY — it's needed for getting description of interface and hostname of device
        SNMP_COMMUNITY = 'your_SNMP_community'
      • This parameter change only if you understand what you do

        Flapping interface flaps more then FLAP_THR_COUNT in the last FLAP_THR_MINUTES

        FLAP_THR_MINUTES = 15
        FLAP_THR_COUNT = 20
      • Set this variable to True for receive mails in Russian
        TRANSLATE = False
  6. Start processess

    $ sudo service rabbitmq-server start
    $ sudo service celeryd start
  7. Or without service just
    $ /usr/bin/python /bin/celery -A tasks worker
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.