Google Plus

How to Install and configure Nagios in Archlinux

Written by Mel Kham on . Posted in Linux tutorials

Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better.

Nagios was originally designed to run under Linux, but also runs well on other Unix variants. It is free software, licensed under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

First thing  to do  is to  install Lamp on Arck to  activate apache  or php

Download  tarballs from AUR  ArchLinux  (Nagios and  Nagios-plugins)

Download  nagios  from : http://aur.archlinux.org/packages.php?ID=12306

Dwonload nagios-plugins : http://aur.archlinux.org/packages.php?ID=12307


Install developemnt packages

[root@localhost ~]# pacman -S base-devel
Output
:: There are 11 members in group base-devel:
:: Repository core
1) autoconf  2) automake  3) bison  4) fakeroot  5) flex  6) gcc  7) libtool
8) m4  9) make  10) patch  11) pkg-config

Enter a selection (default=all):

Extract nagios  and  nagios plugin   from AUR  and    install them

tar  -zxvf  nagios.tar.gz

Now cd Nagios directory

cd nagios

Install  and  download  nagios ,  download  and  install also  dependencies if  needed

[root@localhost nagios]# makepkg -s --asroot

Output

==> Making package: nagios 3.2.3-1 (Mon Jun 27 19:54:04 GMT 2011)
==> Checking runtime dependencies…
==> Checking buildtime dependencies…
==> Retrieving Sources…
-> Downloading nagios-3.2.3.tar.gz…


After this  step, a new file  will be  generated  in the same  directory : nagios-3.2.3-1-i686.pkg.tar.xz

Install this file using the command:

pacman -U nagios-3.2.3-1-i686.pkg.tar.xz

Now  do  the  same  with  Nagios  plugin

Download , extract   and  install

tar -zxvf nagios-plugins.tar.gz; cd  nagios-plugin
makepkg -s --asroot
pacman -U nagios-plugins-1.4.15-1-i686.pkg.tar.xz

II Nagios Configuration


Copy the sample config files as root:

 cp /etc/nagios/cgi.cfg.sample /etc/nagios/cgi.cfg
 cp /etc/nagios/resource.cfg.sample /etc/nagios/resource.cfg
 cp /etc/nagios/nagios.cfg.sample /etc/nagios/nagios.cfg
 cp /etc/nagios/objects/commands.cfg.sample /etc/nagios/objects/commands.cfg
 cp /etc/nagios/objects/contacts.cfg.sample /etc/nagios/objects/contacts.cfg
 cp /etc/nagios/objects/localhost.cfg.sample /etc/nagios/objects/localhost.cfg
 cp /etc/nagios/objects/templates.cfg.sample /etc/nagios/objects/templates.cfg
 cp /etc/nagios/objects/timeperiods.cfg.sample /etc/nagios/objects/timeperiods.cfg

Make owner/group for all the files to nagios/nagios:

chown -R nagios:nagios /etc/nagios

Create htpasswd.users file with a username and password, eg. admin and  insert  you   chosen password

htpasswd -c /etc/nagios/htpasswd.users admin

change the  owner and group of  this  directorychown -R nagios:nagios /usr/share/nagios


Download SNMP
pacman -S net-snmp
Targets (1): net-snmp-5.6.1-1
Total Download Size:    2.08 MB
Total Installed Size:   13.09 MB
Proceed with installation? [Y/n] y


you can add snmpd to /etc/rc.conf to start with system next time under DAEMON=

Start Nagios


/etc/rc.d/nagios restart

You can add nagios to /etc/rc.conf to start with system next time unde DAEMON=

III Apache Configuration

Edit /etc/httpd/conf/httpd.conf, add the following

# nagios
Include /etc/httpd/conf/extra/nagios.conf 

Add the apache user http to the group nagios, otherwise you will get the following error when using nagios:

Could not open command file '/var/nagios/rw/nagios.cmd' for update!:  

Add user to apache using the command:

# usermod -G nagios -a http
 


 

VI PHP Configuration

Edit /etc/php/php.ini to include /usr/share/nagios in the open_basedir directive.

Example configuration:

open_basedir = /srv/http/:/usr/share/nagios

 

ARE YOU READY


restart apache and nagios
rc.d restart snmpd
rc.d sretart httpd
rc.d restart nagios

Start the browser http://ip/nagios or http://hostname/nagios

and login with your login and password


{module user9-footer}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

cave

|

it can be used to talk or chat through the internet,

it is using strong encryption.

but for example TOR is using some obfuscation because some countrys try to block all outgoing connections which can not be scanned with DPI

And the TOR Project is facing an arms race in obfuscation and encryption detection.

cave

|

You can friend someone if you give him your public Certificate.

both peers must friend each other.

i suggest to not enter a valid e-mail address. it is not necessary, but pgp needs a mail addy. something@something.so fits perfectly… :)

http://redd.it/18vsq5 <– faq, featurelist, todo, howto, useful links to manual wiki etc, …

you can connect to chatservers, which will give you access to chatlobby, where always some people are lurking.

#1 https://www.f2f-fr.net/w2c/en/
#2 http://retrosharechatserver.no-ip.org/w2c/en/

and in this rooms, you can find other people to talk and friend.

cave

|

http://redd.it/18vsq5
please have a look at this link. it is a FAQ, QuickTip, HowTo, etc etc etc …

If you want to make friends, please use the Chatservers.
#1 https://www.f2f-fr.net/w2c/en/
#2 http://retrosharechatserver.no-ip.org/w2c/en/

if you enter your certificate, the chatserver adds you as his friend and shows his certificate too add him to your friends.

After the connection to the chatservers is established, you can join a few chatrooms where the chatserver is lurking.

in this rooms are other people too help you and make first friends and get into the network.

add friends only with wisdom. if you friend some policeman, it will be problematic like in real life.

best is to add only people you trust in real life or trust from other communitys too. and not to add random unkown strangers.

If you have questions, ask them in the chatlobbys, there is always someone to answer them.

please read http://redd.it/18vsq5

or question me here :)

Ladi Oyekanmi

|

Could you please assist in step by step on how to install nagios on solaris

Adhraa

|

Greate tutorial :)

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .