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

How To Install Nagios on Ubuntu

Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.

Download, install and Configure Apache
first we have to install some necessary compliers and Apache to run Nagios.
run the next commands:
# sudo apt-get install build-essential
# sudo apt-get install libgd2-xpm-dev
# sudo apt-get install apache2
# sudo apt-get install php5-common php5 libapache2-mod-php5

Configure Apache to use PHP:

Run in a terminal:
# sudo vi /etc/apache2/apache2.conf
Paste the following into the file:
DirectoryIndex index.html index.php index.cgi

and restart the server with the command
# sudo /etc/init.d/apache2 restart

Download, install, and configure Nagios
Create a user to run the service and a group to run external commands:

# sudo useradd -m nagios
# sudo passwd nagios
# sudo groupadd nagcmd
# sudo usermod -a -G nagcmd nagios
# sudo usermod -a -G nagcmd www-data

Download the current version of Nagios and Nagios Plugins from - http://www.nagios.org/download/

Extract the Nagios tar:
# sudo tar -zxvf nagios-3.1.2.tar.gz
and change to the nagios-3.1.2 directory
# cd  nagios-3.1.2
Now install the Nagios use the flowing commands :
# sudo ./configure --with-command-group=nagcmd
# sudo make all
# sudo make install
# sudo make install-init
# sudo make install-config
# sudo make install-commandmode
# sudo make install-webconf

Add a user for the Nagios interface:
# sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Extract and compile the Nagios-plugins:
# tar -zxvf nagios-plugins-1.4.14.tar.gz
# cd nagios-plugins-1.4.14
# sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# sudo make
# sudo make install

Create a link to start the service:
# sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Verify the config:
# sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Start Nagios:
# sudo /etc/init.d/nagios start

You should now be able to log into the Nagios web interface (http://localhost/nagios) using the nagiosadmin user and password.
Read more >>

How to mount your system with live CD

more then once I was needed to reconfigure my ubuntu grub or change the root password of a certain machine.
If you can't login to the machine or you don't have your root password,
the easy way to do so is to mount the system from a live CD.
I'm using Ubuntu 9.04 live CD:

insert the live CD to your cdrom and restart the computer.
chose the first option of the main menu -
"Try ubuntu whitout any change to your computer"


when it finish loading, open the terminal console and run the next commands.
first we need to find your linux partition
# sudo fdisk -l

than we need to mount into it
# sudo mkdir /mnt/root
# sudo mount -t ext3 /dev/sda1 /mnt/root
# sudo mount -t proc none /mnt/root/proc
# sudo mount -o bind /dev /mnt/root/dev
# sudo chroot /mnt/root /bin/bash

That's it, Now you login the machine as root user, and you can do what ever you want.

for reinstall grub you can use grub-install:
# grub-install /dev/sda1
or
# grub
grub> find /boot/grub/stage1
grub> root (hd?,?)
grub> setup (hd?)
grub> quit

or change the root password with passwd:
# passwd root


Read more >>

Ubuntu 9.04 - Jaunty Jackalope



Every time a new version of my favorite operating system - Ubuntu, comes out,
I invite the original disk for free.
Although I download it straight and updating my ubuntu at home,
I love that I have the original CD - who does not ??

Recently a new version of ubuntu 9.04 - Jaunty Jackalope, comes out.
I ordered the original CD and it just arrived in the mail.

Read more >>