loading...

27/07/2023

NFSen

====================== Basic Configuration ======================

# timedatectl set-timezone Asia/Dhaka
# timedatectl


# vi /etc/selinux/config

SELINUX=disabled
😡

# chkconfig firewalld on
#reboot

# hostnamectl set-hostname graph.nmslab.net
# logout

# hostname

# nmtui
# nmcli connection down enp0s3
# nmcli connection up enp0s3
# ifconfig

# vim /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
103.110.59.150 graph.nmslab.net graph
😡

# hostname

# adduser sysadmin
# passwd sysadmin

# dnf -y install openssh-clients openssh-server
or yum install openssh-clients openssh-server

# cd /etc/ssh/

#vi sshd_config

Port 4422
PermitRootLogin no
AllowUsers sysadmin
😡

# firewall-cmd –permanent –add-port=4422/tcp
# firewall-cmd –reload

# systemctl enable sshd
# systemctl status sshd
# systemctl restart sshd

Try to login remotely
#ssh sysadmin@103.110.59.150 –p 4422

========================== NFSen Configuration ====================

# yum update -y

# systemctl mask firewalld
# systemctl stop firewalld
# systemctl disable firewalld
# yum -y install iptables-services
# systemctl enable iptables
# systemctl start iptables
# iptables -I INPUT -p tcp –dport 80 -j ACCEPT
# iptables -I INPUT -s “0/0” -p udp –dport 9666 -j ACCEPT
# reboot

# firewall-cmd –state

# yum install -y httpd php wget gcc make rrdtool-devel rrdtool-perl perl-MailTools perl-Socket6 flex byacc
# yum install perl-Sys-Syslog -y
# yum install perl-Data-Dumper -y
# echo “date.timezone = Asia/Dhaka” > /etc/php.d/timezone.ini

# useradd netflow
# usermod -a -G apache netflow

# mkdir -p /data/nfsen
# mkdir -p /var/www/html/nfsen

# cd /opt
# w!get http://downloads.sourceforge.net/project/nfdump/stable/nfdump-1.6.13/nfdump-1.6.13.tar.gz
# w!get http://downloads.sourceforge.net/project/nfsen/stable/nfsen-1.3.8/nfsen-1.3.8.tar.gz

# service httpd start

/opt# tar -zxvf nfdump-1.6.13.tar.gz
/opt# cd nfdump-1.6.13


======================
# yum install gcc
/opt/nfdump-1.6.13# ./configure –enable-nfprofile –enable-nftrack –enable-sflow

/opt/nfdump-1.6.13# make && sudo make install

=========================

# cd /opt
# tar -zxvf nfsen-1.3.8.tar.gz
# ls
# cd nfsen-1.3.8

/opt/nfsen-1.3.8/# cp etc/nfsen-dist.conf etc/nfsen.conf

# vi etc/nfsen.conf

Make sure all data path variables are set correctly

$BASEDIR= “/data/nfsen”;
$HTMLDIR = “/var/www/html/nfsen”;
$PREFIX = ‘/opt/nfdump/bin’;

For CentOS based systems change

$WWWUSER = “www”;
$WWWUSER = “apache”; —> N.B. Change Here
$WWWGROUP = “www”;
$WWWGROUP = “apache”; —> N.B. Change Here

Give comment before the following lines
#’upstream1’
#’peer1’ —> N.B. Change Here
#’peer2’ —> N.B. Change Here

/opt/nfsen-1.3.8/# ./install.pl etc/nfsen.conf

# vi /etc/init.d/nfsen

N.B. Copy and Paste Below Code

#!/bin/bash
#
# chkconfig: – 50 50
# description: nfsen
DAEMON=/data/nfsen/bin/nfsen
case “$1” in
start)
$DAEMON start
;;
stop)
$DAEMON stop
;;
status)
$DAEMON status
;;
restart)
$DAEMON stop
sleep 1
$DAEMON start
;;
*)
echo “Usage: $0 {start|stop|status|restart}”
exit 1
;;
esac
exit 0


# chmod +x /etc/init.d/nfsen

# /etc/init.d/./nfsen start

# vi /etc/httpd/conf.d/nfsen.conf

Alias /nfsen /var/www/nfsen
<Directory /var/www/nfsen/>
DirectoryIndex nfsen.php
Options -Indexes
order allow,deny
allow from all
</Directory>

# service httpd restart

http://server-IP/nfsen/nfsen.php

Posted in LinuxTaggs: