Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, October 11, 2016

Setting up Nagios Core 4 on Ubuntu 16.04

Setting up Nagios Core 4 on Ubuntu 16.04


Nagios XI is the Enterprise version of Nagios with lots of features (comes with a price) compared to Nagios Core 4.  There is a free licence for Nagios XI but limited to small environment.

Nagios XI installations with a free license are limited to monitoring seven (7) hosts (nodes). There is no limitation on the number of services that can be monitored with a free license.

Here are the steps based on [1] and [2] references:
 
Preparation: Install the required packages 
sudo apt-get install apache2 libapache2-mod-php5 build-essential libgd-dev
 
1) Prepare accounts (user nagios and group nagcmd & nagios) 
sudo -s
/usr/sbin/useradd -m -s /bin/bash nagios
passwd nagios
/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd www-data
 

2) Download source codes
mkdir ~/downloads
cd ~/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.2.1.tar.gz
wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz#_ga=1.209680983.439473619.1475788765
(The one in the Ubuntu Quickstart is outdated) 
 
3) Untar, Compile and install
cd ~/downloads
tar xzf nagios-4.2.1.tar.gz
cd nagios-4.2.1
./configure --with-command-group=nagcmd

make all
make install
make install-init
make install-config
make install-commandmode
 
4) Customise email address and other configurations
vi /usr/local/nagios/etc/objects/contacts.cfg 
 

5) Configure the web interface
make install-webconf (Makefile was somehow not updated for Ubuntu from RedHat for this option)
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
/etc/init.d/apache2 reload
 
6) Compile and install the plug-ins
cd ~/downloads
tar xzf nagios-plugins-2.1.2.tar.gz 
cd nagios-plugins-2.1.2/
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl 
make
make install
 
7) Configure startup and start Nagios
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
 
8) Login to Web Interface
http://localhost/nagios/ 

Reference:
[1] https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickstart-ubuntu.html
[2] https://www.digitalocean.com/community/tutorials/how-to-install-nagios-4-and-monitor-your-servers-on-ubuntu-14-04
[3] https://assets.nagios.com/handouts/nagiosxi/Nagios-XI-vs-Nagios-Core-Feature-Comparison.pdf

Friday, July 20, 2007

Ubuntu 6.06:
Implementing quota on /home

1] sudo aptitude install quota
2] edit /etc/fstab placing the usrquota,grpquota on the filesystem you want quota implemented.
3] sudo touch /home/quota.user /home/quota.group

4] sudo chmod 600 /home/quota.*

5] sudo mount -o remount /home

6] sudo quotacheck -avugm

7] sudo quotaon -avug

8]Edit quota for a user

sudo edquota <username>

e.g sudo edquota user1

9] report the quota usage

sudo repquota <device name>

e.g. repquota /dev/sda10


----
Ubuntu 6.10
Implementing quota on the /

1] sudo aptitude install quotatool
2] edit /etc/fstab placing the usrquota,grpquota on the filesystem you want quota implemented.
3] sudo touch /quota.user /quota.group

4] sudo chmod 600 /quota.*

5] sudo mount -o remount /

6] sudo quotacheck -avugm

7] sudo quotaon -avug


Reference:

http://www.debianadmin.com/implement-and-manage-disk-quotas-in-linux.html

Monday, July 02, 2007

maradns on ubuntu

1] Install maradns

sudo aptitude install maradns


2] Check if its running

pgrep maradns

3] Edit mararc to be recursive

sudo vi /etc/maradns/mararc

4] Have this settings:

bind_address = "192.168.2.231"
recursive_acl = "192.168.2.0/24"
random_seed_file = "/dev/urandom"
root_servers["."] = "osrc"
root_servers = {}

5] link /etc/mararc to your /etc/maradns/mararc

ln -s /etc/maradns/mararc /etc/mararc

6] Restart maradns

sudo /etc/init.d/maradns restart


To troubleshoot the error you can execute:
a] touch /var/log/maradns
b] nohup maradns >> /var/log/maradns &

Sunday, May 27, 2007

Locking Firefox in XP and Linux

A)Linux (tested on Ubuntu from http://kirksblog.steffensenfamily.com/archives/category/ubuntu/)

1] Backup you original configuration found at /usr/lib/firefox/firefox.cfg to firefox.cfg.old
2] Create a new firefox.cfg
//
lockPref("app.update.enabled", false);
lockPref("network.proxy.autoconfig_url","http://172.16.8.1/proxy.pac");
lockPref("network.proxy.type", 2);
lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 172.16.8.0/21");
lockPref("network.proxy.share_proxy_settings", true);
lockPref("browser.startup.homepage","http://www.adzu.edu.ph");
----here is another example-----
//
lockPref("app.update.enabled", false);
lockPref("network.proxy.type", 1);
lockPref("network.proxy.share_proxy_settings", true);
lockPref("network.proxy.http", "192.168.2.31");
lockPref("network.proxy.http_port", 3128);
lockPref("browser.startup.homepage","http://www.lxer.com | ");

3] Restart firefox.

B) Windows XP (from http://ilias.ca/blog/2005/03/locking-mozilla-firefox-settings/)

1] Create mozilla.txt and begin the first line with two forward slashes.
2] Put all the settings you would like to lock. Example:
//
lockPref("network.proxy.autoconfig_url","http://172.16.8.1/proxy.pac");
lockPref("network.proxy.type", 2);
lockPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 172.16.8.0/21");
lockPref("network.proxy.share_proxy_settings", true);
lockPref("browser.startup.homepage","http://www.adzu.edu.ph");

3] Convert the file to mozilla.cfg using this and save it at location where firefox.exe which is usually at C:\Program Files\Mozilla Firefox

4] In C:\Program Files\Mozilla Firefox\greprefs\ there’s a file called all.js.
Open all.js in a text editor, and add the following line at the end of it:

pref("general.config.filename", "mozilla.cfg");


To determine the things to lockdown type about:config at the location bar of firefox.

Original posted: March 4, 2007

Thursday, March 15, 2007

Mirror copy of ftp site hourly

Creating a mirror copy of an internal website:

1] sudo aptitude install vsftpd
2] cd /etc/cron.daily
3] Create file named mirror with content
#Mirrors the 172.16.14.143 ftp server
cd /home/ftp
/usr/bin/wget -nH --mirror ftp://172.16.14.143 -o /root/mirror.log
4] chmod +x mirror

Thursday, March 08, 2007

Resizing Xserver screen to a larger size in Ubuntu

1] Edit /etc/X11/xorg.conf

2] Look for the line

SubSection "Display"
Depth 16
Modes "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "800x600" "640x480"
EndSubSection

3] Add the "1024x768" phrase. Example

SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection


Thats my quick fix. :) Sorry never tried dpkg-reconfigure. :)

Sunday, March 04, 2007

Ubuntu 6.10 Server Minimal Installation

Install without LAMP or DNS server.

1] Install the xserver
sudo aptitude install xserver-xorg

3] install the fonts and xterminal
sudo apt-get install xfonts-* xterm

4] Edit /etc/apt/sources.list to use internet or local apt-proxy server enabling the universe repository for icewm commenting out the CDROM part.

5] install the icewm (the minimal windows manager), firefox browser and openoffice.org 2.0
sudo aptitude install icewm firefox openoffice.org2

Monday, February 19, 2007

VMWare after updating/upgrading Ubuntu

Need to do the following:
1] re-install VMWare server by running the script:

sudo ./vmware-install.pl

2] Install the C Header files with

sudo aptitude install linux-headers-`uname -r`

3] Specify the location at

/lib/modules/<>/build/include

:)