Cool Solution - Monitoring UCC with nagios

From Univention Wiki

Revision as of 14:39, 11 February 2014 by Orrego (talk | contribs) (First draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Produktlogo UCC Version 1.0
Produktlogo UCS Version 3.2

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.


It's relatively easy to use Nagios to monitor UCS servers. The idea here is to show how to integrate Univention Corporate Clients (UCC) into the monitoring set up of an UCS-Nagios server.

We will first install the NRPE packages (Nagios Remote Plugin Executor) in UCC to make the system a Nagios client. As part of the set up we need to manually copy Nagios plugins to UCC.

Finally, the Nagios server has to be aware of this new clients to monitor. For that, we will generate the corresponding Nagios configuration for the UCC hostgroup.

UCC set up (Nagios client)

In some environments would be preferable to perform this steps within the image file before a roll out (by mounting it as described in the UCC Manual).

Install Nagios-NRPE packages (agent and plug-ins):

apt-get install nagios-nrpe-server

Accept monitoring from UCS-Nagios Server:

vi /etc/nagios/nrpe.cfg

Allow the Nagios server in nrpe.cfg:


For this set up it's helpful to use an UCS system that is already being monitored (it has the univention-nagios-client package installed). The idea is to copy the needed plug-ins and files into our UCC system.

Bring Univention Plug-ins from another nagios-monitored client (e.g. UCS slave):

scp* /etc/nagios/nrpe.d/

Note: If working on the UCC image, it could be better to move the files before performing the chroot to it.

Restart NRPE service

service nagios-nrpe-server restart

Note: This wouldn't have any effect if you are modifying an UCC image.

UCS set up (Nagios server)

Next step is to add the UCC host to be monitored, to each of the desired Nagios checks on the server.

Add the computer to the preconfigured check in udm:

udm nagios/service modify --dn cn=UNIVENTION_DISK_ROOT,cn=nagios,dc=example,dc=com --append assignedHosts='cn=ucc-client50,cn=computers,dc=example,dc=com'
udm nagios/service modify --dn cn=UNIVENTION_PING,cn=nagios,dc=example,dc=com --append assignedHosts='cn=ucc-client50,cn=computers,dc=example,dc=com'

Since the Nagios services attribute is not defined for UCC Objects, we will have to create this part manually. I suspect there are simpler ways to do this, but for now let us create a host file and add the new host to a hostgroup file.

Ceate a host for each client:

cd /etc/nagios3/conf.univention.d/hosts/

Example of host file

#manually created
define host {
   check_command           check-host-alive
   max_check_attempts      10
   notification_interval   180
   notification_period     Univention-Predefined-24x7
   notification_options    d,u,r

Create a hostgroup for the clients

cd /etc/nagios3/conf.univention.d/hostgrps/
cp dc_computers.cfg ucc_computers.cfg 
vi ucc_computers.cfg

Example of host group ucc_computers.cfg:

#Manually created
define hostgroup {
   hostgroup_name     ucc_computers
   alias              Hostgroup ucc_computers
   members  ,, 

Restart Nagios service:

service nagios3 restart

Now you should be able to see the ucc_computers hostgroup in your Nagios Web interface. After some minutes the Plug-ins will start returning status information to the Nagios server.


Personal tools