Categories
Uncategorized

Install Ubuntu Mate on Ubuntu 16.04.3

apt-get install ubuntu-mate-desktop
apt-get install mate

 

Categories
Uncategorized

Installing Nagios 4.3.2 on Ubuntu 16.04

1.- Install LAMP

2.-Install additional dependencies, can be install when setting up LAMP

[su_note]sudo apt-get install wget build-essential apache2 php apache2-mod-php7.0 php-gd libgd-dev unzip[/su_note]

3.- Download Nagios Core 4.3.2 and Nagios Plugins

[su_note]wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.3.2.tar.gz wget http://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz[/su_note]

4.- Create nagios user and group memberships

[su_note]useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagios,nagcmd www-data[/su_note]

Nagios Core Install:

[su_note]
tar zxvf nagios-4.3.2.tar.gz
tar zxvf nagios-plugins-2.2.1.tar.gz

cd nagios-4-3-2
./configure –with-command-group=nagcmd -–with-mail=/usr/bin/sendmail –with-httpd-conf=/etc/apache2/
[/su_note]

If the above step fails due to error: unrecognized option: `-–with-mail=/usr/bin/sendmail’ , then run

[su_note]./configure –with-command-group=nagcmd –with-httpd-conf=/etc/apache2/
[/su_note]

You should get a summary such as:

*** Configuration summary for nagios 4.3.2 2017-05-09 ***:

General Options:
————————-
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Install ${includedir}: /usr/local/nagios/include/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/init.d
Apache conf.d directory: /etc/apache2/
Mail program: /usr/bin/mail
Host OS: linux-gnu
IOBroker Method: epoll

Web Interface Options:
————————
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP):

Review the options above for accuracy. If they look okay,
type ‘make all’ to compile the main program and CGIs.

…Continue with Install

[su_note]
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

The following step failed
sudo a2ensite nagios
Possible solution is to do: ln -s /etc/apache2/nagios.conf /etc/apache2/sites-available/nagios.conf
then do:
sudo a2ensite nagios.conf
sudo a2enmod rewrite cgi
[/su_note]

You’ll get a message:
To activate the new configuration, you need to run:
service apache2 restart
Wait, don’t run this command yet

[su_note]
sudo cp /etc/init.d/skeleton /etc/init.d/nagios
sudo nano /etc/init.d/nagios

#Add the following lines

DESC=”Nagios”
NAME=nagios
DAEMON=/usr/local/nagios/bin/$NAME
DAEMON_ARGS=”-d /usr/local/nagios/etc/nagios.cfg” PIDFILE=/usr/local/nagios/var/$NAME.lock
[/su_note]

[su_note]
systemctl restart apache2
systemctl start nagios <– This step failed. Working on a solution
[/su_note]

Create a nagios admin account:

[su_note]
htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
[/su_note]

Nagios Plugin installation:

[su_note]
cd /tmp/nagios-plugins-2.2.1
./configure –with-nagios-user=nagios –with-nagios-group=nagios
make
make install
[/su_note]

Verify nagios configuration:

[su_note]
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#you should get
Total Warnings: 0
Total Errors: 0

[/su_note]

Start nagios:
[su_note]/etc/init.d/nagios start[/su_note]

Nagios service setup: The following steps didn’t work. Working on a solution

[su_note]
chkconfig –add nagios
chkconfig –level 35 nagios on
chkconfig –add httpd
chkconfig –level 35 httpd on
sudo update-rc.d nagios defaults

[/su_note]

Login with nagiosadmin
https://servername/nagios

Categories
Uncategorized

Install RT 4 on Ubuntu 16.04

These steps are for setting up a new Request Tracker instance on Ubuntu 16.04, the data is being migrated from another server. Don’t drop the database if you are not migrating data.

First install LAMP, then follow these steps.

  • sudo apt-get install mysql-server libdbd-mysql-perl libapache-dbi-perl
  • sudo apt-get install rt4-apache2 rt4-db-mysql
  • sudo apt-get install request-tracker4 rt4-clients
  • sudo cp /etc/request-tracker4/RT_SiteConfig.pm /etc/request-tracker4/RT_SiteConfig.pm.original
  • sudo nano /etc/request-tracker3.8/RT_SiteConfig.pm
  • if you check /etc/mysql/my.cnf it points to two other files
    • !includedir /etc/mysql/conf.d/
    • !includedir /etc/mysql/mysql.conf.d/  <–Edit the content of this this file
    • sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
      • change max_allowed_packet = 16M to max_allowed_packet=256M
  • Drop existing db, mysql -u root -p
    • DROP DATABASE rtdb;
    • CREATE DATABASE rtdb
  • import rdtbbackup.sql into empty rtdb database
    • #mysql -u root -p rdtb < rtdbbackup.sql

Setup permissions for user rtuser

  • mysql -u root -p
    • find out the hashed password, SELECT PASSWORD(‘mypass’) copy  the hashed password and paste
    • GRANT USAGE ON *.* TO ‘rtuser’@’localhost’ IDENTIFIED BY PASSWORD ‘*longhashpassword’;
    • GRANT ALL PRIVILEGES ON `rtdb`.* TO ‘rtuser’@’localhost’;

Configure Apache:

  • sudo a2enmod rewrite
  • sudo ln -s /etc/request-tracker4/apache2-modperl2.conf /etc/apache2/sites-available/requesttracker.conf
  • a2ensite requesttracker.conf
  • service apache2 restart

Troubleshooting:

1.- Config file /etc/request-tracker/RT_SiteConfig.pm is locked

  • if you haven’t done so, restart mysql.  systemctl restart mysql
  • Also check apache logs, tail /var/log/apache2/error.log
  • Also check the RT_SiteConfig.pm file

2.- Not able to access db with rtuser

  • reset the rtuser password
    • UPDATE mysql.user
      SET authentication_string = PASSWORD(‘mynewpassword’), password_expired = ‘N’
      WHERE User = ‘rtuser’ AND Host = ‘localhost’;
      FLUSH PRIVILEGES;

3.- Able to create new tickets but unable to see any tickets

  • run:sudo /usr/sbin/rt-setup-database –dba root –prompt-for-dba-password –action upgrade
  • restart Apache, then restart mysql
Categories
Uncategorized

LAMP on Ubuntu 16.04 LTS

Install Apache:

  • sudo apt-get update
  • sudo apt-get install apache2
  • sudo nano /etc/apache2/apache2.conf
    • At end of file, add:  ServerName IPAddress
  • sudo apache2ctl configtest
  • sudo systemctl restart apache2

Install Mysql:

  • sudo apt-get install mysql-server mysql-client
  • sudo systemctl status mysql

Install PHP:

  • sudo apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7 php7.0-gd php libapache2-mod-php php-mcrypt php-mysql
  • sudo nano /etc/apache2/mods-enabled/dir.conf and move index.php at the befinning of the text, i.e DirectoryIndex index.php index.html …
  • sudo systemctl restart apache2

Install phpMyAdmin

  • sudo apt-get install phpmyadmin
  • edit, sudo nano /etc/apache2/apache2.conf
    • at the end of the file, add: Include /etc/phpmyadmin/apache.conf
  • sudo systemctl restart apache2