Nagios PDF
Nagios PDF
user
# useradd nagios
# groupadd nagcmd
# cd nagioscore-nagios-4.5.8
# ./configure
# make all
# make install
# make install-init
# make install-commandmode
# make install-config
# make install-webconf
# cd /
To install plugins :-
# wget -o http://nagios-plugins.org/download/nagios-plugins-2.4.12.tar.gz
# cd nagios-plugins-2.4.12
# ./configure
# make all
# make install
NAGIOS
# cd /
# cd /usr/local/nagios/libexec ( some files comes in to this file so my plugins have been done)
# cd /
http://<ip of server>/nagios
# wget https:/wh/github.com/nagios-plugins/nagios-plugins/releases/download/release-2.4.12/nagios-plugins-
2.4.12.tar.gz
# yum install gcc glibc glibc-common make php gd gd-devel wget net-snmp openssl-devel
# useradd nagiosuser
# cd /nagios-plugins-2.4.12
# ./configure
# make all
# make install
#cd /usr/local/nagios/
#cd libexec ( some files will be come in this like green colour)
ma
lsls
# cd /nrpe-4.1.1/
# ./configure
# mak
# make install
# make install-init
# make install-config
Cd /
NAGIOS
# vim /usr/local/nagios/etc/nrpe.cfg ( this is the main file)
# firewall-cmd --reload
fi
Server side :-
# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.1.1/nrpe-4.1.1.tar.gz
# cd nrpe-4.1.1/
# ./configure
# make all
# make install
#make install-init
# make install-config
# cd /
# vim /usr/local/nagios/etc/nrpe.cfg
# firewall-cmd --reload
# vim /usr/local/nagios/etc/objects/192.168.1.212.cfg ( I make file within the object folder for add host or services )
define host{
check_period 24x7
check_interval 5
retry_interval 1
NAGIOS
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
## Default
define host{
# vim /usr/local/nagios/etc/objects/services.cfg
define service {
host_name anjali.example.com
check_command check_local_disk!20%!10%!/
# if > 50 users.
define service {
NAGIOS
host_name anjali.example.com
check_command check_local_users!20!50
define service {
host_name anjali.example.com
check_command check_local_procs!250!400!RSZDT
define service {
host_name anjali.example.com
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
NAGIOS
# Critical if less than 10% of swap is free, warning if less than 20% is free
define service {
host_name anjali.example.com
check_command check_local_swap!20%!10%
# Disable notifications for this service by default, as not all users may have SSH enabled.
define service {
host_name anjali.example.com
service_description SSH
check_command check_ssh
notifications_enabled 0
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service {
service_description HTTP
check_command check_http
notifications_enabled 0
# vim /usr/local/nagios/etc/objects/command.cfg
Line no 231
# vim /usr/local/nagios/etc/nagios.cfg
Cfg_file=/usr/local/nagios/etc/objects/192.168.1.212.cfg
Cfg_file=/usr/local/nagios/etc/objects/service.cfg