Netshot installation on a Red Hat-based machine

We've updated the Netshot package to include the installation instructions and the starting script for Red Hat, CentOS, etc. Linux family.

Download version 0.4.3a from the Netshot page and follow the instructions below.

This should work for CentOS 6.x and below. CentOS 7 probably needs an update of the starting script. If you see a mistake, please tell me!

Note: If you don't have sudo on your server, execute the commands as root instead.

  1. Download Netshot and copy the package onto your server.
  2. Unzip the package.

    $ unzip

  3. Install a database server and create the database for Netshot.

    $ sudo yum install mysql-server $ sudo service mysqld start $ mysql -u root > CREATE DATABASE netshot01 CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; > GRANT ALL PRIVILEGES ON netshot01.* TO 'netshot'@'localhost' IDENTIFIED BY 'netshot'; > quit

  4. Install Java 8. Go to Select JRE Download then download JRE 8 last update for your linux architecture (32 or 64-bit), in RPM format, e.g. jre-8u25-linux-x64.rpm. Install it:

    $ sudo rpm -Uvh jre-8u25-linux-x64.rpm

    Check the running Java version, it should be 1.8.x:

    $ java -version 2>&1 | grep version

  5. Add a dedicated system user.

    $ sudo useradd --system -k /dev/null --create-home --home /usr/local/netshot -s /bin/false netshot

  6. Create a SSL certificate for the embedded HTTPS server. Of course, if you own a certificate authority, you can use it to sign your certificate. The example below just generates a self-signed certificate (which means you'll get a security alert in your browser when opening Netshot).

    $ /usr/java/default/bin/keytool -genkey -keyalg RSA -alias selfsigned -keystore netshot.jks -storepass password -validity 3600 -keysize 2048

    Simply press Enter when prompted for a password. And move the certificate to the right place.

    $ sudo mv netshot.jks /usr/local/netshot

  7. Prepare files.

    $ sudo cp netshot.jar /usr/local/netshot $ sudo mkdir /usr/local/netshot/drivers $ sudo chown -R netshot /usr/local/netshot $ sudo cp initd-netshot /etc/init.d/netshot $ sudo chown root:root /etc/init.d/netshot $ sudo chmod +x /etc/init.d/netshot $ sudo mkdir /var/log/netshot $ sudo chown -R netshot /var/log/netshot $ sudo cp netshot.conf /etc/netshot.conf $ sudo chown root:root /etc/netshot.conf

  8. Start Netshot.

    $ sudo service netshot start

  9. Manually create the initial Netshot user.

    $ mysql -u root > USE netshot01; > INSERT INTO user (level, local, username, hashed_password) VALUES (1000, 1, 'netshot', '7htrot2BNjUV/g57h/HJ/C1N0Fqrj+QQ');

    Netshot should be now available on https://[your server IP]:8443. Connect with username = netshot, password = netshot and you can start enjoying Netshot.

  10. (Optional) Port translation. If you want Netshot to detect changes from Syslog and/or SNMP messages sent by the devices, you can translate the UDP ports using iptables:

    $ sudo iptables -t nat -A PREROUTING -p udp --dport 162 -j REDIRECT --to-port 1162 $ sudo iptables -t nat -A PREROUTING -p udp --dport 514 -j REDIRECT --to-port 1514 $ sudo service iptables save

  11. (Optional) Start Netshot at boot time.

    $ sudo chkconfig --add netshot