Nagios
How to configure NAGIOS Monitoring server on Ubuntu
September 3, 2010 by: Qasim Ali
Please run these commands on your server
apt-get update
apt-get upgrade
Now installing NAGIOS
apt-get install nagios3
When asked the Postfix configuration then press ENTER and select the Internet Site and press OK.
System mail name: Type your Domain Name and press OK
Type: Nagios Administration password
Default username is “nagiosadmin” if you like changed the admin username so follow me:
vi /etc/nagios3/cgi.cfg
:% s/nagiosadmin/yourselectedname/g
And affected are 7 lines
cd /etc/nagios3/
Run this command for create password
sudo htpasswd -m htpasswd.users yourusername
Now restart the NAGIOS
/etc/init.d/nagios3 restart
Now open your web-browser and enter the following address
http://domain-name or server-ip/nagios3
Add contact email address on this setup for receiving any warring email, so follow me
This file here is the contact details his already setup only changed the Email address, removed the root@localhost and type your email address.
cd /etc/nagios3/conf.d
sudo vim contacts_nagios2.cfg
Now, you are monitoring Windows machines, Linux/Unix machines, Network Devices and etc…
Open the following file…
vim /etc/nagios3/conf.d/ localhost_nagios2.cfg
Add your machine information for example
define host{
use
generic-host ; Name of host template to use
host_name your-host-name
alias your-host-name
address your-host-IP
}
Add services you want to monitor like Current Load, Current Users, Disk Space, PING, Web Service, SSH, Total Processes and etc…
Add these lines bottom of following file…
vim /etc/nagios3/conf.d/ localhost_nagios2.cfg
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use
generic-service ; Name of service template to use
host_name your-host-name
service_description Disk Space
check_command check_all_disks!20%!10%
}
# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.
define service{
use
generic-service ; Name of service template to use
host_name your-host-name
service_description Current Users
check_command check_users!20!50
}
# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 processes.
define service{
use
generic-service ; Name of service template to use
host_name your-host-name
service_description Total Processes
check_command check_procs!250!400
}
# Define a service to check the load on the local machine.
define service{
use
generic-service ; Name of service template to use
host_name your-host-name
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}
# check that ping-only hosts are up
define service {
host_name your-host-name
service_description PING
check_command check_ping!100.0,20%!500.0,60%
use
generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
# check that web services are running
define service {
host_name
your-host-name
service_description HTTP
check_command check_http
use
generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
# check that ssh services are running
define service {
host_name
your-host-name
service_description SSH
check_command check_ssh
use
generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
Now open your web-browser and enter the following address
http://domain-name or server-ip/nagios3
please let us know in case of any problem…
From http://www.linuxgurru.com/2010/09/how-to-configure-nagios-monitoring-server-on-ubuntu/
Écrire commentaire