Icinga (Monitoring Solution) Installation And Configuration On CentOS - Page 4

Configuration of Ubuntu and Win 2008 on the server side

1.

[root@sunil /]# cd /opt/icinga/etc/objects/

2. First we configure the Ubuntu client.

3. Create a cfg file for the same with the following content you can also refer to localhost.cfg present in the same directory:

  [root@sunil ~]# vim /opt/icinga/etc/objects/ubuntu10.cfg
define host{
uselinux-server
host_name ubuntu10
alias ubuntu10
address 192.168.1.40
}
define service{
use local-service
host_name ubuntu10
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service
host_name ubuntu10
service_description Root
check_command check_local_disk!20%!10%!/
}
define service{
use local-service
host_name ubuntu10
service_description Current Users
check_command check_local_users!20!50
}
define service{
use local-service
host_name ubuntu10
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}
define service{
use local-service
host_name ubuntu10
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
define service{
use local-service
host_name ubuntu10
service_description Swap Usage
check_command check_local_swap!20!10
}
define service{
use local-service
host_name ubuntu10
service_description SSH
check_commandcheck_ssh
notifications_enabled 0
}

For grouping of servers you can append this line to ubuntu10.cfg:

definehostgroup{
hostgroup_namelinux-servers ; The name of the hostgroup
alias           Linux Servers ; Long name of the group
memberslocalhost, ubuntu10     ; Comma separated list of hosts that belong to this group
        }

4. For Windows 2008 we will referring to windows.cfg:

define host{
use             windows-server  ; Inherit default values from a template
host_namewin2008 ; The name we're giving to this host
alias           My Windows Server       ; A longer name associated with the host
address         192.168.1.30    ; IP address of the host
        }

define service{
use                     generic-service
host_name               win2008
service_descriptionNSClient++ Version
check_commandcheck_nt!CLIENTVERSION
        }
define service{
use                     generic-service
host_name               win2008
service_description     Uptime
check_commandcheck_nt!UPTIME
        }
define service{
use                     generic-service
host_name               win2008
service_description     CPU Load
check_commandcheck_nt!CPULOAD!-l 5,80,90
        }
define service{
use                     generic-service
host_name               win2008
service_description     Memory Usage
check_commandcheck_nt!MEMUSE!-w 80 -c 90
        }
define service{
use                     generic-service
host_name               win2008
service_description     C:\ Drive Space
check_commandcheck_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }

5. We need to set the password to log into the Windows server:

  [root@sunil etc]# vim objects/commands.cfg
# 'check_nt' command definition
define command{
command_namecheck_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
        }

6. Add your password:

define command{
command_namecheck_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 –s password@123 -v $ARG1$ $ARG2$
        }
[root@sunil objects]# chown -R daemon:daemon /opt/icinga/
[root@suniletc]# vimicinga.cfg
cfg_file=/opt/icinga/etc/objects/ubuntu10.cfg
cfg_file=/opt/icinga/etc/objects/win2008.cfg

Add the two lines.

Stop and start Icinga.

Share this page:

1 Comment(s)