Home  •  Downloads  •  Forums  •  Account  
 
   
 
Main Menu   
 
HomeHome  
    Home
Members  
    Groups
    Members List
    Private Messages
    Profile
    Your Account
Community  
    Forums
    Search
    Supporters
    Surveys
Statistics  
    Statistics
    Top 10
Files & Links  
    Downloads
    Web Links
News  
    News
    Submit News
    Topics
Other  
    Advertising
    Content
    Docs
    FAQ
    Feedback
    NukeSentinel
    Recommend Us
    Stories Archive
    Site Map
    Donations
    Evo UserBlock
    gallery2
Search   
 


Hacker Beware   
 
 You have been warned!
We have caught 160 shameful hackers.

NukeSentinel(tm) 2.5.08
Link to us   
 
www.socalcrew.com

http://socalcrew.com :: View topic - CentOS 5.4 Installing Nagios and Lilac
Forum Index   •  Search   •  Usergroups   •  Edit your profile   •  Members   •  Log in to check your private messages
Ranks   •  Staff   •  Statistics   •  Board Rules   •  Forum FAQ   •  Log in


Search for at
http://socalcrew.com Advanced Search



CentOS 5.4 Installing Nagios and Lilac

 
Post new topic   Reply to topic   printer-friendly view    http://socalcrew.com Forum Index -> Rip's Ramblings
View previous topic :: View next topic  
Author Message
rip




Joined: Jan 24, 2007
Posts: 100


Status: Offline
PostPosted: Fri Jan 08, 2010 7:23 pm Post subject: CentOS 5.4 Installing Nagios and Lilac Reply with quote

Here's a dirty script I wrote to install nagios and Lilac on a clean CentOS 5.4 install.  This script doesn't care about anyone other than itself (it'll change the mysql password for instance) so may not be entirely perfect for your needs.

It does get PHP 5.2 installed and all of Lilacs annoying deps.

Note at the end there are some edits to do to PHP.ini and sudoers:

#Edit Files, I guess I could do this with sed, but bah.

#Edit /etc/php.ini
#magic_quotes_gpc = Off
#memory_limit = 64M  

#Restart httpd fo the php.ini edits take effect
#service httpd restart

#edit /etc/sudoers
#comment out Defaults    requiretty
#add the folowing at the end of the file (no pound signs)
#apache ALL=(ALL) NOPASSWD: /usr/bin/nmap
#apache ALL=(ALL) NOPASSWD: /usr/local/nagios/bin/nagios
#apache ALL=(ALL) NOPASSWD: /etc/init.d/nagios restart
#apache ALL=(ALL) NOPASSWD: /etc/init.d/nagios reload

#go to  http://<yourserver>/nagios/lilac/install.php  and resolve any dependencies
#there should not be any

I guess I could do that with sed or something as stated, if you implement it, send me a copy and I'll add it here.  This is not graceful but does a lot of grunt work easily.



Code:
#!/bin/sh

yum clean all

#As found on socalcrew.com, this installs Nagios and Lilac on a clean
#CentOS 5.4 install.  This is from gleened sources in the comments below.
#This script IS NOT SAFE, it defaults to weak passwords,
#doesn't care how version changes might affect the rest of your system,
#and will change your mysql password if you let it, so you really
#should edit it to you liking first.

#Must be run as ROOT

#The main reason this is handy is getting an updated PHP 5.2 with all the deps
#Since 5.4 doesn't have it.  Tested with 5.4 on various servers, dev on Dell 860 Dual Core

#Let's get up to date and grab utils we'll need.

yum install -y httpd gcc glibc glibc-common gd gd-devel

#Other stuff for lilac not included in CentOS 5.4
#We need nmap and stuff for Lilac later

yum install -y nmap
yum -y install openssl-devel perl-DBD-MySQL mysql-server mysql-devel

#http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/
#Install PHP 5.2.12-1  !!!! HALT !!!! 5.3.1-1 breaks Lilac!  Use 5.2.x
#ask me how I know
#There is no reason update should be needed normally, but I'm anal

rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
wget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webtatic.repo

yum --enablerepo=webtatic --exclude=php*5.3*  install -y php
yum --enablerepo=webtatic --exclude=php*5.3*  update -y php
yum --enablerepo=webtatic --exclude=php*5.3*  install -y php-devel
yum --enablerepo=webtatic --exclude=php*5.3*  update -y php-devel
yum --enablerepo=webtatic --exclude=php*5.3*  install -y php-xml php-pear php-mhash php-mcrypt php-mysql php-pdo php-gd php-posix
yum --enablerepo=webtatic --exclude=php*5.3*  update -y php-xml php-pear php-mhash php-mcrypt php-mysql php-pdo php-gd php-posix
yum --enablerepo=webtatic --exclude=php*5.3*  install -y php-process
yum --enablerepo=webtatic --exclude=php*5.3*  update -y php-process

#disable all other repos for Troubleshooting if needed
#yum --disablerepo=* --enablerepo=webtatic --exclude=php*5.3*  update php

service httpd restart

useradd -m nagios
echo 'password' |passwd --stdin nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

#Let's grab Nagios from Sourceforge
cd /usr/local/src
#reference: http://sourceforge.net/projects/nagios/
wget -nc http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.0/nagios-3.2.0.tar.gz?use_mirror=ufpr
cd /usr/local/src/
tar -zxvf nagios-3.2.0.tar.gz

#rm -f nagios-3.2.0.tar.gz

cd /usr/local/src/nagios-3.2.0/
./configure --with-command-group=nagcmd

#Compile Nagios

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

#Name the Nagios login
htpasswd -nb nagiosadmin password > /usr/local/nagios/etc/htpasswd.users
service httpd restart

#Grab the Nagios Plugins
#Reference: http://nagiosplugins.org/

wget -nc  http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.14/nagios-plugins-1.4.14.tar.gz?use_mirror=ufpr
cd /usr/local/src/
tar -zxvf nagios-plugins-1.4.14.tar.gz

#rm -f nagios-plugins-1.4.14.tar.gz

cd /usr/local/src/nagios-plugins-1.4.14

#Compile the plugins
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

chkconfig --add nagios

#Make sure Nagios is ON, and stays on
service nagios start
chkconfig nagios on

#Make sure MySQL is on and stays on
service mysqld start
chkconfig mysqld on

#Make sure Apache is on and stays on
service apache start
chkconfig apache on

#Let's grab Lilac and install it.
#this isn't pretty, but works

cd /usr/local/src/
wget -nc http://lilacplatform.com/trac/downloads/5
cp 5 lilac-1.0.3.tar.gz
rm -f 5
cp lilac-1.0.3.tar.gz /usr/local/nagios/share/lilac-1.0.3.tar.gz
cd /usr/local/nagios/share
tar -zxvf lilac-1.0.3.tar.gz
mkdir lilac
cd lilac-1.0.3
cp -r * /usr/local/nagios/share/lilac
cd /usr/local/nagios/share
rm -rf lilac-1.0.3
rm -f lilac-1.0.3.tar.gz
cd /usr/local/nagios/share/lilac
chmod 0777 includes

#You really should edit this and all other password fields
/usr/bin/mysqladmin -u root password password

#Edit Files, I guess I could do this with sed, but bah.

#Edit /etc/php.ini
#magic_quotes_gpc = Off
#memory_limit = 64M  

#Restart httpd fo the php.ini edits take effect
#service httpd restart

#edit /etc/sudoers
#comment out Defaults    requiretty
#add the folowing at the end of the file (no pound signs)
#apache ALL=(ALL) NOPASSWD: /usr/bin/nmap
#apache ALL=(ALL) NOPASSWD: /usr/local/nagios/bin/nagios
#apache ALL=(ALL) NOPASSWD: /etc/init.d/nagios restart
#apache ALL=(ALL) NOPASSWD: /etc/init.d/nagios reload

#go to  http://<yourserver>/nagios/lilac/install.php  and resolve any dependencies
#there should not be any
#user=nagiosadmin pass=password
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:
Post new topic  Reply to topic   printer-friendly view http://socalcrew.com Forum Index ->  Rip's Ramblings All times are UTC - 8 Hours [DST enabled]
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum




Powered By: phpBB © 2001 - 2007 phpBB Group
DAJ Glass Theme Conversion By: RealmDesignz.com | DAJ Glass (1.0.5) Template By: Dustin Baccetti


DAJ_Glass phpbb2 style by Dustin Baccetti | PHP-Nuke theme by www.nukemods.com
 
     
     

Banner 
Spambot Killer
Site Map

[News Feed] [Forums Feed] [Downloads Feed] [Web Links Feed] [Validate robots.txt]


PHP-Nuke Copyright © 2006 by Francisco Burzi.
All logos, trademarks and posts in this site are property of their respective owners, all the rest © 2006 by the site owner.
Powered by Nuke-Evolution.

[ Page Generation: 0.60 Seconds | Memory Usage: 5.64 MB | DB Queries: 44 ]

.