Trainning@sandhar-nagios
Appearance
Auto-generated from the uploaded PDF Trainning@sandhar-nagios.pdf. This is an extracted-text rendering for searchability; see the original PDF for exact formatting, diagrams, tables, and images.
Nagios Server Important files
Contact.cfg
Template.cfg
Command.cfg
Linuxbox.cfg
Contact.cfg
This File is use to define the contact and contact groups for the mailing
perspective.
Ex: define contact{
contact_name oracleadmin
use generic-contact
alias Ashish Awathi Oracle Admin
email ashish.awasthi@sandhar.in
}
Ex: define contactgroup{
contactgroup_name oracle
alias Oracle Team to get Information
members oracleadmin,oracleadmin1,dba-group
}
We use contact groups for the mailling but for that must have to define contact.
Template.cfg
This file is use to define the templates to be used for the contacts, host, service and to define hostgroups.
Ex: define service{
name generic-service ; The 'name' of this service template
use srv-pnp
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major
performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
Command.cfg
This file is used to define the specific commands to be
called with nrpe or directly by its name, it can be a
command for the remote client as well as for the local
also.
Ex: define command{
command_name check_oracle_health_modified
command_line
/usr/local/nagios/libexec/check_oracle_health_shell
--mode $ARG1$ --connect $ARG2$ --user $ARG3$
--password $ARG4$ --warning $ARG5$ --critical
$ARG6$ }
Linuxbox.cfg
This is the main configuration file from where all the information
from different respective file were called to produce the output
on dashboard.
Ex: define host{
use linux-server
host_name stl-BItest
alias stl-BItest
address 172.17.16.19
hostgroups sandhar-oracle-server
}
Service defination dir
The directory service is the place where all the required service to be
visible on dashboard were defined in a single file of the respective
host.
Ex: define service{
use generic-log-service
host_name stl-proddb1
service_description Oracle Database status
contact_groups oracle
notification_options w,u,c,r
check_command check_nrpe!check_databases
}
Client Configuration file
Nrpe.cfg
This is the only file responsible to generate the
query as a command and give the output from
the client server to nagios server via
nrpe/nsclient++
Ex:
command[check_load]=/usr/local/nagios/libexe
c/check_load -r -w 10 -c 15
Monitoring Perspective
This is the main Overview of Dashboard.
Explaination
In the Dash Board Everything which is red is
the visual symbol of Critical either host or
service.
Yellow is the visual Symbol of Warning level.
Green is the symbol of OK.
We must work on warning level so that issue
not raised to critical level.
Explaination
The mail alerts of all the host and respective
service will generated on the bases of warning,
critical, unknown and recovery.
If seeing and critical or warning service on the
dash board acknowledge it which also generates
a mail of acknowledgment which reflects that the
issue is being taken care by monitoring team and
it will not generate any further critical or warning
mail until the issue got recovered, once it recover
generate the recovery mail.
Explaination
Acknowledgment process.
Explaination
Click on Hammer.
Explaination
Write a Comment and save the Acknowledgment
Installation & Configuration of npre
on client machine
On solaris server.
Install the package SYMCnrpe-sparc-1.4.15b.pkg.gz
Copy the /usr/local/nagios to /tmp/
Remove the nrpe package.
Now copy the /tmp/nagios to /usr/local/
Enter the below entries
allowed_hosts=127.0.0.1,172.17.16.3
To run nrpe as standalone process
/usr/local/nagios/bin/nrpe -n -c /usr/local/nagios/etc/nrpe.cfg -d
To restart pkill nrpe;
/usr/local/nagios/bin/nrpe -n -c /usr/local/nagios/etc/nrpe.cfg -d
Installation & Configuration of npre
on client machine
On Windows
Install nsclient++.exe
Look for allowed host put the information of nagios
server. 172.17.16.3.
Restart the nsclient.
To Add SNMP device
On nagios side.
Run snmpwalk to check whether snmp device is
able to listen or not
snmpwalk -v2c -c public 172.17.17.23
snmpwalk -vversion -c string host-address.
Check for the available up links.
To Add SNMP device
Now map the up link status as already defined command in command.cfg.
/usr/local/nagios/libexec/check_ifoperstatus -H $HOSTADDRESS$ -C
$ARG1$ -k $ARG2$
Use the parameter accordingly in the service file of the required host like.
define service{
use generic-service
host_name Switch-172_17_17_23
service_description Link status Interface 2
check_command check_ifoperstatus!public!2
}
Above is defined to check the status of link 2.
THANKS
Amit Srivastava
Linux Engineer L2
Feel free to call or drop mail for any clarification or Issue on
service@tetrain.com
011-47521743/44/45