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:

6 Comment(s)

Add comment

Comments

From: Berry Sizemore at: 2012-11-15 23:46:55

I successfully got Icinga up and running, and I am very pleased to say that this tutorial is pretty much how I did it.   When it came to nrpe, it required a slightly different configure command formation.  I also skipped the sendmail section in favor of Postfix, because it was already configured.  I also used more recent versions of the software used without penalty.  Sometimes things can get crazy if you stray to newer versions, but not in this case at this time.

Thanks for the great work!

From: konsultor at: 2012-12-10 20:00:55

...but the image of the browser is too small to make out the URL that is supposed to reach icinga. A line of text would be enlightening and helpful.

From: Anonymous at: 2013-01-04 07:15:03

Hi, I got stuck at step 5. I guess it is because I am using the latest packages. Xampp 1.8.1 & Icinga 1.8.3. There muct be something I am missing that I can perform anything beyond step 5. Please help.

From: David Downing at: 2014-11-07 20:34:34

Try this article: https://www.rosehosting.com/blog/how-to-install-icinga-network-monitoring-system-on-a-centos-7-vps/, i followed it and installed Icinga successfully.

From: Terver at: 2013-06-13 14:24:37

Hello, Nice and detailed piece of note. I need help ASAP.

 I successfully installed and configured icinga to "step11. Login to check whether Icinga website opens:" and i was unable to open ther website, it gives me the error below. Kindly assist as all other procedures i followed worked fine. Thank you 

 

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Error 500

172.17.15.30
Thu 13 Jun 2013 03:01:58 PM WAT
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

 

From: marco at: 2011-01-24 08:28:45

My best compliment for this article, very useful.

I have some questions:

1) Why do you prefer to use daemon user instead nagios?

2) Why do you preferer to use nsclient instead of nrpe_nt on Windows?

3)  What GUI do you suggest?

4) Could you add some info about how to use mysql (to store events) and how to generate graphs?

 Regards