hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : VPS Tutorials : install nagios on centos 64 Bit
Reply

VPS Tutorials Tutorials related to VPS.
Forum Jump

install nagios on centos 64 Bit

Reply Post New Thread In VPS Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-03-2011, 03:31 PM
J Gwynne PC Repair J Gwynne PC Repair is offline
Web Hosting Master
 
Join Date: May 2010
Posts: 610

install nagios on centos 64 Bit


Hi,

i've created a blog post and script to setup nagios on centos
i know how hard it is to setup and configure but it's also very powerful when it's setup

the blog post is here http://www.jgwynne.co.uk/2011/04/nag...-centos-64bit/

don't know if that's allowed but if not the script updates the centos box and installs the rpmforge package then install's nagios (and all the nagios goodies)

uses a custom nagios.cfg file (because we use directories and not individual files specified in the nagios config file)

here's the script

#!/bin/bash
#update all packages
yum -y update
#make sure apache is installed
yum -y install httpd
#setup nagios
wget http://packages.sw.be/rpmforge-relea....rf.x86_64.rpm
rpm -Uhv rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
#install nagios
yum -y install nagios*
#Copy nagios configuration file
cd /etc/nagios
rm -f nagios.cfg
wget http://www.jgwebhosting.co.uk/setup/nagios.cfg
mkdir printers
mkdir switches
mkdir routers
mkdir servers
#setup htpassword file for nagios
echo "enter the nagiosadmin user password below"
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
#restart apache and nagios
service httpd restart
service nagios restart
#check they are set for startup
chkconfig nagios on
chkconfig httpd on
echo "all done you can access nagios by going to http://localhost/nagios"

you will also need to create config files for devices you want to monitor

using the nagios command layout

we monitor our dns server hobbit using the host and service definition below

define host{
use generic-host ; Name of host template to use
host_name hobbit.jgwebhosting.co.uk
address 50.22.22.62
check_command check-host-alive
max_check_attempts 10
notification_interval 30
notification_period 24x7
notification_options d,u,r
contact_groups guest
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description check_users
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_users
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description check_disk
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_disk
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description check_load
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_load
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description check_processes
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_total_procs
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description Ping check
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description DNS check
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_dns!hobbit.jgwebhosting.co.uk
}
define service{
use generic-service ; Name of service template to use
host_name hobbit.jgwebhosting.co.uk
service_description Free RAM check
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_mem
}
this is saved in a filename.cfg and placed in /etc/nagios/servers (you could also put it in switches, routers etc)

you will need to reload/restart nagios everytime you add a new definition file using the command service nagios restart (if nagios fails there's something wrong with your config file)

you will also need to edit /etc/nagios/objects/contacts.cfg
to add your email address (edited in the config file)

i hope this helps someone get nagios setup easily

joe

Reply With Quote


Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
On Xen vps Centos 32-bit, uname -a shows kernel as 64-bit John92 VPS Hosting 15 01-08-2011 10:33 PM
How to install kloxo on 64-bit CentOS erroring Hosting Security and Technology 8 10-07-2010 03:17 PM
How To Install FFMPEG Packages On CentOS 5 64-Bit? isi123 Hosting Security and Technology 8 01-02-2010 08:16 AM
How To Install CentOS 5 64-Bit? - Or Please Provide Me With A Template! - Urgent isi123 VPS Hosting 8 11-06-2009 11:45 AM
install 32 bit pae kernel on centos StackzGaming Hosting Security and Technology 12 04-07-2009 05:15 AM

Related posts from TheWhir.com
Title Type Date Posted
Solar VPS Becomes Official Mirror for Centos and Ubuntu Web Hosting News 2013-04-16 11:03:34
Web Host Rackspace Adds FreeBSD 9, CentOS 6.3 Support to Cloud Servers Web Hosting News 2012-07-30 12:47:10
Web Host ServerPronto Donates Hosting Resources to CentOS Web Hosting News 2012-07-05 14:06:27
Web Host A2 Hosting Launches Customizable VPS Hosting Plans Web Hosting News 2012-06-07 15:11:57
Web Host NetHosting Announces Support for CentOS 6 Web Hosting News 2011-07-05 20:15:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?