NSTI 3.0.2
apt install -y python-mysqldb snmptt mysql-server php-mysql python-mysqldb python-dev libmysqlclient-dev libdbd-mysql-perl libdbi-perl python3-storm libexpat1 python3 apache2 apache2-utils ssl-cert libapache2-mod-wsgi
mysql_secure_installation
#Would you like to setup VALIDATE PASSWORD component?
#Press y|Y for Yes, any other key for No: Y
Y
#There are three levels of password validation policy:
#LOW Length >= 8
#MEDIUM Length >= 8, numeric, mixed case, and special characters
#STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
#Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:
0
#Please set the password for root here.
New password:
Re-enter new password:
#Estimated strength of the password: xxx
#Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) :
Y
mysql -u root –pPASSWORDMYSQLROOT
Mysql> create database snmptt;
mysql> GRANT ALL PRIVILEGES ON snmptt.* TO ‘snmpttuser’@’localhost’ WITH GRANT OPTION;
mysql> GRANT PROCESS ON *.* TO 'snmpttuser'@'localhost';
Mysql> Flush privileges;
mysql> SHOW GRANTS FOR 'snmpttuser'@'localhost';
+----------------------------------------------------------------------------------+
| Grants for snmpttuser@localhost |
+----------------------------------------------------------------------------------+
| GRANT PROCESS ON *.* TO `snmpttuser`@`localhost` |
| GRANT ALL PRIVILEGES ON `snmptt`.* TO `snmpttuser`@`localhost` WITH GRANT OPTION |
+----------------------------------------------------------------------------------+
2 rows in set (0,00 sec)
Mysql> quit
systemctl status mysql.service
Cd /home/sources
wget
http://assets.nagios.com/downloads/nsti ... latest.php -O nsti-3.0.2.tar.gz
tar zxvf nsti-3.0.2.tar.gz
cd nsti-3.0.2/
mysql -u snmpttuser -psnmpttpass snmptt < nsti/dist/nsti.sql
vim nsti/etc/nsti.py
#~ Database Configuration Options
#~ Use mysql for MySQL and postgres for PostgreSQL
DB_TYPE='mysql'
DB_HOST='localhost'
DB_PORT='3306'
DB_NAME='snmptt'
DB_USER='snmpttuser'
DB_PASS='snmpttpass'
#~ Page Display Options
TRUNCATE=100
PERPAGE=50
sh install.sh
python -m flask --version
#Python 2.7.18
#Flask 1.1.4
#Werkzeug 1.0.1
cp /etc/httpd/conf.d/nsti.conf /etc/apache2/sites-enabled/
vim /etc/apache2/sites-enabled/nsti.conf
WSGIScriptAlias /nsti /usr/local/nsti/wsgi.py
<Directory /usr/local/nsti>
Require all granted
</Directory>
service apache2 restart
vim /etc/default/snmptrapd
TRAPDOPTS='-Lsd -On -p /run/snmptrapd.pid'
systemctl daemon-reload
systemctl restart snmptrapd.service
chmod 775 /usr/local/nsti -R
chown nagios:nagcmd /usr/local/nsti -R
vim /etc/snmp/snmptrapd.conf
disableAuthorization yes
traphandle default /usr/sbin/snmptthandler
vim /etc/snmp/snmptt.ini
mode = daemon
net_snmp_perl_enable = 1
dns_enable = 1
daemon_fork = 1
daemon_uid = snmptt
pid_file = /var/run/snmptt.pid
spool_directory = /var/spool/snmptt/
log_file = /var/log/snmptt/snmptt.log
mysql_dbi_enable = 1
mysql_dbi_host = localhost
mysql_dbi_port = 3306
mysql_dbi_database = snmptt
mysql_dbi_table = snmptt
mysql_dbi_table_unknown = snmptt_unknown
mysql_dbi_username = snmpttuser
mysql_dbi_password = snmpttpass
unknown_trap_log_enable = 1
unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log
[TrapFiles]
snmptt_conf_files = <<END
/etc/snmp/snmptt.conf
END
systemctl enable snmptrapd
service snmptt restart
service snmptrapd restart