Spi-nagiosclient: Difference between revisions
Appearance
Vijaykumar (talk | contribs) |
|||
| Line 54: | Line 54: | ||
#vim /usr/local/nagios/etc/objects/linux-box.cfg | #vim /usr/local/nagios/etc/objects/linux-box.cfg | ||
===Nagios file configuration=== | |||
Make sure that you make a entry on nagios file( vim /usr/local/nagios/etc/nagios.cfg) | |||
In That file specify the file which you are created and define the host | |||
cgi_file=/usr/local/nagios/etc/objects/linuxbox.cfg | |||
cgi_dir=/usr/local/nagios/etc/service | |||
== Define client details == | == Define client details == | ||
Latest revision as of 11:08, 20 January 2014
Spi Nagios Client Configuration[edit]
Client Configuration[edit]
Install Rpmforge Epelrepo
#mkdir /downloads
#cd /downloads
#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
#rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rp
#wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
# vim /etc/yum.repos.d/remi.repo
enable 1
#yum install nrpe nagios-plugins-all
#vim /etc/nagios/nrpe.cfg allowed_hosts=127.0.0.1, your nagios server ip
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10 command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_disk_space]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -X tmpfs command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z command[check_cpu]=/usr/lib64/nagios/plugins/check_cpu.sh -w 20 -c 60 command[check_zimbra_queue]=/usr/lib64/nagios/plugins/check_zimbra_queue -w 30 -c 60 command[check_mem_avail]=/usr/lib64/nagios/plugins/check_mem_avail -w 20 -c 10 command[check_pop]=/usr/lib64/nagios/plugins/check_pop -w 10 -c 20 command[check_smtp]=/usr/lib64/nagios/plugins/check_smtp -w 10 -c 20 command[check_imap]=/usr/lib64/nagios/plugins/check_imap -w 10 -c 20 command[check_zimbra_lmtp]=/usr/lib64/nagios/plugins/check_smtp -H localhost -p 7025 -e '220 spimail.spi.com Zimbra LMTP server ready'
Note: define all plugin in above given path.
# chown nagios.nagios /usr/lib64/nagios/plugins -R
Now restart nrpe service
Server configuration[edit]
#vim /usr/local/nagios/etc/objects/linux-box.cfg
Nagios file configuration[edit]
Make sure that you make a entry on nagios file( vim /usr/local/nagios/etc/nagios.cfg)
In That file specify the file which you are created and define the host
cgi_file=/usr/local/nagios/etc/objects/linuxbox.cfg cgi_dir=/usr/local/nagios/etc/service
Define client details[edit]
define host{
use linux-server
host_name spimail.spi.com
alias Spi Mail Server
address 64.128.141.50
hostgroups Tetra Clients ; Host groups
}
#cd ../services #vim spimail.spi.com.cfg
define service{
use generic-service
host_name spimail.spi.com
service_description Current Users
check_command check_nrpe!check_users
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Cpu Load
check_command check_nrpe!check_load
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Cpu Utilization
check_command check_nrpe!check_cpu
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Memory Utilization
check_command check_nrpe!check_mem_avail
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Disk Check
check_command check_nrpe!check_disk_space
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Zombie Process
check_command check_nrpe!check_zombie_procs
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Mail Queue
check_command check_nrpe!check_zimbra_queue
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Pop
check_command check_nrpe!check_pop
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Smtp
check_command check_nrpe!check_smtp
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Imap
check_command check_nrpe!check_imap
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Http
check_command check_http_spi // this is not define in client side , check in command.cfg
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
define service{
use generic-service
host_name spimail.spi.com
service_description Lmtp
check_command check_nrpe!check_zimbra_lmtp
contact_groups mailtest
notification_options w,u,c,r
normal_check_interval 3
}
Configuration Of Warning and Critical Mail send by Nagios:[edit]
#Vim /usr/local/nagios/etc/objects/contacts.cfg
DEFINE CONTACT
define contact{
contact_name mailtest ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email test@tetrain.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
define contactgroup{
contactgroup_name client-group
alias Nagios Administrators
members mailtest
}
Note : Now the client have to see only there services not all clients services for that we made new contact group i.e mailtest and now we want that they can wacth there services but do not change any thing for that we do one entry in below :
# vim /usr/local/nagios/etc/cgi.cfg #authorized_for_read_only=user1,user2 authorized_for_read_only=mailtest
Note : Set password for user mailtest
# htpasswd htpasswd.users mailtest
Then check your mail.
TROUBLESHOOTING----------------
1. Check nagios port is open on client server
#nc -z client ip 5666
2. check client server is connected or not
#./usr/local/nagios/libexec/check_nrpe -n -H spimail.spi.com
3. check service
#/usr/local/nagios/libexec/check_nrpe -n -t 50 -H spimail.spi.com -c check_mem_avail