In order to run fastnetmon can be installed via automatic script installer:

wget https://raw.githubusercontent.com/pavel-odintsov/fastnetmon/master/src/fastnetmon_install.pl -Ofastnetmon_install.pl

Run the downloaded script:

sudo perl fastnetmon_install.pl

If not need to share the OS version youn are installing the fastnetmon add at the end of the command

--do-not-track-me

If you need to start the fastnetmon process you can use this command:

/opt/fastnetmon/fastnetmon

or you can run this process in the backgroung adding a “&” at the end of the command

/opt/fastnetmon/fastnetmon &

In another console in the same machine start the client process:

/opt/fastnetmon/fastnetmon_client

To enable fastnetmon to start on server startup, please add the following line to /etc/rc.local:

/opt/fastnetmon/fastnetmon  --daemonize

If something goes wrong you can check the following log file:

tail -f /var/log/fastnetmon.log

When an incoming or outgoing attack occurs, the program calls a bash script twice (if it exists):

/usr/local/bin/notify_about_attack.sh

The first time when threshold exceed (at this step we know IP, direction and power of attack). Second when we collect 100 packets for detailed audit of what happened.A sample script is provided and can be installed as follows:

  cp /usr/src/fastnetmon/src/notify_about_attack.sh  /usr/local/bin/notify_about_attack.sh

chmod 755 /usr/local/bin/notify_about_attack.sh
After copying the file, you need to open it and configure the ’email_notify’ option as required.

After installing fastnetmon open the following file:

nano /etc/fastnetmon.conf

Uncoment and edit the following lines:

graphite = on
graphite_host = 127.0.0.1
graphite_port = 2003
graphite_prefix = fastnetmon

Install the following packages:
apt-get install -y python-whisper graphite-carbon

Next install web frontend

apt-get install -y graphite-web

Create database, specify login/password and email here:

graphite-manage syncdb

Specify your timezone in file /etc/graphite/local_settings.py on line TIME_ZONE.

nano /etc/graphite/local_settings.py

Change owner:

chown _graphite:_graphite /var/lib/graphite/graphite.db

Install and confgiure apache

apt-get install -y apache2 libapache2-mod-wsgi
cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-
available/graphite-web.conf

a2dissite 000-default.conf
a2ensite graphite-web
a2enmod wsgi

Enable load on startup:

systemctl enable apache2.service systemctl restart apache2.service

For big networks please enlarge number of created file in /etc/carbon/carbon.conf:

MAX_CREATES_PER_MINUTE = 5000
And if you want to store data every 5 seconds for 1 months please do following
before starting collection to Graphite in file /etc/carbon/storage-schemas.conf:
[default_5sec_for_1month]
pattern = .*
retentions = 5s:31d

Leave a Reply

Your email address will not be published. Required fields are marked *