***********************************************************
* HOW TO INSTALL UBUNTU 7.10 NAGIOS 2.11 CENTREON 1.4.2.4 *
***********************************************************
Author: Felipe Ferreira / fferreira(a+)osiatis.es / www.xoroz.com
Date: 17/04/2008
Nagios and Centreon are the perfect Network System Monitoring Solution.
Oreon has became a reference as a Nagios Frontend.
The Centreon/Nagios couple is used by a wide range of users, from novices to skilled users,
even if they didn’t knew Nagios before.
+————–+
| INSTALL OS |
+————–+
1.Install Ubuntu Desktop 7.10
2.Remove OpenOffice (optional)
3.Enable VNC Server, System > Admin > Logon > Remote Logon
Install SSHD
# apt-get install openssh-server
Install Compilers and Libraries (may ask the Ubuntu CD)
# apt-get install libc6-dev g++ gcc
# apt-get install libgd2-xpm libgd2-xpm-dev libjpeg62-dev libgd-tools
Install Zlib, Libpng Required by LibGD and then LibGD
# wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz
# wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.25.tar.gz
# wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
Install Apache
# apt-get install apache
+——————+
| INSTALL NAGIOS |
+——————+
# groupadd nagios
# adduser nagios
# passwd nagios
Check if Nagios User is created
# grep nagios /etc/passwd
Add Webserver user (www-data/apache) and Nagios user (nagios)
# usermod -G nagios nagios
# usermod -G www-data,nagios www-data
Check if the users are the members of the group by
# grep nagios /etc/group
# mkdir /usr/local/nagios
# apt-get install build-essential
# apt-get install libgd2-dev (dosent always find)
# wget http://downloads.sourceforge.net/nagios/nagios-2.11.tar.gz?modtime=1205331081&big_mirror=0
# md5sum nagios-2.11.tar.gz |grep “058c1f4829de748b42da1b584cccc941”
# ./configure –enable-embedded-perl –prefix=/usr/local/nagios –with-cgiurl=/nagios/cgi-bin –with-htmurl=/nagios/ –with-nagios-user=nagios –with-nagios-group=nagios –with-command-group=nagios
Create a Symbolic Link to Perl
# ln -s /usr/lib/libperl.so.5.8.8 libperl.so
Install Nagios
# make all
# make install
# make install-init
# make install-commandmode
# make install-config
# ls -l /usr/local/nagios
You should see five different subdirectories.
SETTING UP THE WEBSERVER
Set the password for the Web Access
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Edit the apache2.conf
# vim /etc/apache2/apache2.conf


     ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
    |Directory "/usr/local/nagios/sbin"|    Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /usr/local/nagios/etc/htpasswd.users
        Require valid-user
    |/Directory|
    Alias /nagios /usr/local/nagios/share
    |Directory "/usr/local/nagios/share"|    Options None
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /usr/local/nagios/etc/htpasswd.users
        Require valid-user
    |/Directory|



Edit cgi.cfg to allow nagiosadmin user
# vim /usr/local/nagios/etc/cgi.cfg
authorized_for_system_information=nagiosadmin
Restart Apache and Nagios
# /etc/init.d/apache2 restart
# /etc/init.d/nagios restart
+————————–+
| INSTALL NAGIOS PLUGINS |
+————————–+
->Install OpenSSL (optional)
# wget http://www.openssl.org/source/openssl-0.9.7m.tar.gz
# tar -zxvf openssl-0.9.7m.tar.gz
# cd openssl-0.9.7m.tar.gz
# mkdir /etc/openssl
# ./config –openssldir=/etc/openssl
# wget http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.11.tar.gz?modtime=1197587122&big_mirror=0
# ./configure –with-openssl=/etc/openssl –enable-perl-modules –prefix=/usr/local/nagios –with-nagios-user=nagios
# make all
# make install
Check if the plugins are here
# ls -l /usr/local/nagios/libexec
Give nagios:nagios permission
# chown nagios:nagios /usr/local/nagios/libexec
+——————————-+
| INSTALL OREON WEB INTERFACE |
+——————————-+
Install MySQL & PHP5
# apt-get install mysql-server
# apt-get install php5
# apt-get install php-db php-date
# apt-get install php5-gd php5-mysql php5-snmp php5-ldap
# apt-get install php-mail php-mail-mime php-net-smtp php-net-socket
# apt-get install php5-xmlrpc
Install PostFix
# apt-get install postfix
Install SendMail,
# apt-get install sendmail
Do a Email Test
# echo “TEST EMAIL” | sendmail -s “testing my first email” youtemail@domain.xxx
check /var/log/mail.log for errors.
RRDtool
# apt-get install rrdtool librrds-perl
Perl Libs
# apt-get install libconfig-inifiles-perl
Snmp
# apt-get install snmp snmpd libnet-snmp-perl
Upgrade PEAR
# pear upgrade pear
# pear install -o -f –alldeps DB_DataObject DB_DataObject_FormBuilder MDB2 Numbers_Roman
Numbers_Words HTML_Common HTML_QuickForm2 HTML_QuickForm_advmultiselect HTML_Table Auth_SASL
HTTP Image_Canvas Image_Color Image_Graph Image_GraphViz Net_Traceroute Net_Ping Validate XML_RPC
# pear install -o -f –alldeps SOAP
Get Oreon (at this time latest is 1.4.2.4 03/03/2008 , 2 should be on its way.
# wget http://download.oreon-project.org/index.php?id=74
# md5sum centreon-1.4.2.4.tar.gz | grep “3c8cdaaf92bd8600e42e1278902222cc”
# bash install.sh
All defaults OK, but these:
Where is installed RRD perl modules [RRDs.pm] ? /usr/lib/perl5/
Where is mail binary ? /usr/sbin/sendmail
Setup the Permissions
# chown www-data:nagios -R /usr/local/nagios/libexec/
# chmod 775 -R /usr/local/nagios/libexec/
Start Configuration
http:///oreon/install/setup.php Oreon Installation is DONE: http:///oreon/ +———-+ | APPENDIX | +———-+ *Common Linux Instalation cmd:
# tar -zxvf gd-2.0.35.tar.gz
# cd gd-2.0.35
# ./configure
# make
# make install
**SETUP SAMBA ROOTSHARE: Note: This will give COMPLETE RW access to you linux server, I do not recomend this in production but for testing only!
# apt-get install samba
# /usr/bin/smbpasswd root
Copy And Paste this Config
# vim /etc/samba/smb.conf
[global]
workgroup = OSX
realm = OSX
server string = %h server
interfaces = eth0
obey pam restrictions = Yes
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
passwd chat = *EntersnewsUNIXspassword:* %nn *RetypesnewsUNIXspassword:* %nn *passwordsupdatedssuccessfully* .
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
panic action = /usr/share/samba/panic-action %d
[ShareRoot]
comment = Root
path = /
username = root
valid users = %S, root
force user = root
read only = No
create mask = 0700
directory mask = 0700
guest ok = Yes
# /etc/init.d/samba restart
In windows cmd:
c: net use p: IPShareRoot /user:root
***ALLOW MYSQL REMOTE ACCESS: MySQL5 – connect from Remote 1. download Navicat 8 (or others MYSQL Win Clients) 2. Login via SSH Edit /etc/mysql/my.cnf with bind-address = 192.168.X.X (localhost IP)
# vim /etc/mysql/my.cnf
# mysql -u root -p mysql
use oreon
GRANT ALL ON ods.* TO root@’192.168.X.X’ IDENTIFIED BY ‘PASSWORD’;
use ods
GRANT ALL ON ods.* TO root@’192.168.X.X’ IDENTIFIED BY ‘PASSWORD’;
# /etc/init.d/mysql restart
Run Navicat to browse MySQL DB Anoteher Option is to install myphpadmin
#apt-get install myphpadmin
http:myphpadmin ****GRAPH USING OREON ODS make sure to start ods s start
Oreon Web Interface – > create a service template > Data Treatment > Process Perf Data (On) Configure ODS Oreon Web Interface – > Options > CentreonDataStorage > Config Be sure that you have the .rrd files created
# find / -name *.rrd
*****Make Nagios Pretty ( Nuvola Style ) First Backup /usr/local/nagios/share/*..html and all stylesheets directory.
# cd /usr/local/nagios/share
# wget http://www.xoroz.com/files/nagiosstyle.zip
# unzip nagiosstyle.zip
Set the permissions
# chown nagios:nagios *.*
# chown nagios:nagios -R side
# chown nagios:nagios -R stylesheet
Edit the config.js with your correct cgi-bin
# /etc/init.d/apache2 restart
*******More cool cmds Get an overview of all hosts (new cmd with nagios 2.11)
# /usr/local/nagios/bin/nagiostats /usr/local/nagios/etc/nagios.cfg -v NUMHOSTS
********Autostart Daemon only with Ubuntu
# /usr/sbin/update-rc.d mysql defaults
*********Install FIREFOX ADD-ON NAGIOS CHECKER https://addons.mozilla.org/en-US/firefox/addon/3607 *********Network Latency Tool Smokeping howto http://howtoforge.com/monitoring_network_latency_smokeping_debian_etch ************Troubleshooting problems If in Oreon monitor does not update itself, its a permission problem related to status.log Read the user nagios emails for problems regarding cron jobs and permissions Check the logs at Oreon > Monitor > Event-logs for any errors

1 thought on “HOW TO INSTALL UBUNTU NAGIOS OREON

  1. Pingback: nagios log file

Leave a Reply

Your email address will not be published. Required fields are marked *