Ubuntu Monitor Network Usage Part 2




Way of working

Monitoring
The IT staff to configure nagios to monitor components of the IT infrastructure that are important include the metric system, network protocols, applications, services, servers, and network infrastructure.

Alerting
When critical infrastructure components fail, nagios to send warnings and restore it, give notice to the administrator towards the important events. The alarm can be delivered via email, SMS, or special scripts

Response
The IT staff answering an alarm, and begin to solve the problem and investigating the security alarm as soon as possible.

Reporting
Report provide a record or history about outages, events, notifications, and alarms response for the purposes of the inspection. The existence of the report help satisfy SLA (Service Level Agreement).



Maintenance
Scheduled downtime during maintenance alarm prevents a scheduled and upgrading windows.

Planning
Trends and capacity planning graphs and reports allow the user to identify the necessary infrastructure upgrades before the failure occurs.

How to configure Nagios in Ubuntu 12.04 LTS
Here are the neighboring 4 PC monitor in a LANS

1. open the terminal application, type sudo su to get into super user and enter your password
2. It is advisable to check the configuration of apache2 and nagios3 in advance
dpkg -l |grep apache2
dpkg -l |grep nagios3

dpkg -l : to see the list of packages that are already installed on the PC and its versions
|grep : to search for files containing text with the desired criteria

3. If already installed preferably diremove beforehand to ensure no previous configuration so that it does not interfere with the configuration we are going to create.
apt-get remove apache2
apt-get remove nagios3

4. Install apache2 and nagios3
apt get install apache2
apt get install nagios3

5. If the install process is complete it is recommended to update
apt-get update

6. Do the configuration using host localh nano or gedit
gedit /etc/nagios3/conf.d/localhost_nagios2.cfg

7. Under the define local host, add the define host neighbours that will be monitoring and define services cript below. In the "define host", "edit the host name" and "address" in accordance with the name and IP address of each PC. In the "define services", "edit the host name" on the respective description.

If you want to add to the number of PCS that will be monitoring live adds each define.

# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#

define host{
use generic-host ; Name of host template$
host_name jartel1
alias nia
address 172.16.30.38
}

define host{
use generic-host ; Name of host template$
host_name jartel2
alias srik
address 172.16.30.14
}

define host{
use generic-host ; Name of host template$
host_name jartel3
alias siska
address 172.16.30.27
}

define host{
use generic-host ; Name of host template$
host_name jartel4
alias ginting
address 172.16.30.32
}

# 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 servi$
host_name jartel1
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 servi$
host_name jartel1
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 servi$
host_name jartel1
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 jartel1
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}

define service{
use generic-service ; Name of servi$
host_name jartel4
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}

8. then perform host configuration group
gedit /etc/nagios3/conf.d/hostgroups_nagios2.cfg

Change member that had been made on localhost before.
Then add "define hostgroup" to "ping" under the last of the hostgroup hostgrup pre-existing (under define hostgroup ssh)

# Some generic hostgroup definitions

# A simple wildcard hostgroup
define hostgroup {
hostgroup_name all
alias All Servers
members jartel1,jartel2,jartel3,jartel4
}

# A list of your Debian GNU/Linux servers
define hostgroup {
hostgroup_name debian-servers
alias Debian GNU/Linux Servers
members jartel1,jartel2,jartel3,jartel4
}

# A list of your web servers
define hostgroup {
hostgroup_name http-servers
alias HTTP servers
members jartel1,jartel2,jartel3,jartel4
}

# A list of your ssh-accessible servers
define hostgroup {
hostgroup_name ssh-servers
alias SSH servers
members jartel1,jartel2,jartel3,jartel4
}

#A list of your ping-accessible servers
define hostgroup {
hostgroup_name ping-servers
alias ping servers
members jartel1,jartel2,jartel3,jartel4
}

9. After that do configuration on define its service
gedit /etc/nagios3/conf.d/services_nagios2.cfg 

add define services to ping below define the ssh service

#check that web services are running
define service {
hostgroup_name http-servers
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 {
hostgroup_name ssh-servers
service_description SSH
check_command check_ssh
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}

# check that ping services are running
define service {
hostgroup_name ping-servers
service_description ping
check_command check_ping
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified

}

10. Restart nagios3
/etc/init.d/nagios3 restart

11. Setting password
sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin


12. open the browser. Type http://localhost/nagios3
After login with password, appears a pageview nagios.

13. Select MAP to display in other PC monitoring
 Based on the picture above, a host on monitoring there are 4 corresponds to host a neighbor who had been in the previous configuration, namely jartel1, jartel2, jartel3, and jartel4. The fourth host on the monitoring by nagios Admins. Double click on one of the hosts to see in details.

14. Menu Hosts
The status of hosts that are being monitoring on all hosted the group in details ranging from the date checking, length checking, and ping status information on each host.

15. The Menu of Services
Menu services this service displays the status of all hosts in details about current load, current users, http, ssh, and ping are in OK, warning, critical or unknown.

16. Host Groups




Next
Previous
Click here for Comments

0 comments: