Nagios Basic question

Hi All,

I have Nagios set up and running on my UCS server and I tried to add a linux host to monitor via nrpe.

My understanding is that Nagios needs to be setup on the client side as well, in fact, if I try to add checks via the UCS management console other than simple checks like Ping, they fails because the commands are not configured on the client. That is expected behaviour.

However, I was under the (maybe wrong) impression that the UCS server could do that for me (setting up the client as well). I have read the wiki and it points me to the installation of the package ‘univention-nagios-client’, but it does not tell me how to install such a package.

I have tried, amongst other things, to add the univention sources to my /etc/atp folder but I don’t seem to be able to get that specific package.

Am I missing something really obvious?

Any help much appreciated

Thank you very much.

Regards,
R

Hi,

let me try to explain how to setup nagios integration for

At first, create a linux host object in UMC for the debian host and activate nagios support (open the host object and activate “Nagios support” in the [Options] menu). The debian host should now be available in the nagios webinterface (without any services/checks though).

Next step, adding services (like a ping check) for the debian host. The Univention nagios integration already adds some nagios services like UNIVENTION_PING, see Devices -> Nagios in the UMC webinterface. These services can be assigned to hosts objects (if nagios is activated).

But, there are two kind of services, Non-NRPE checks (executed on the nagios server, the UCS system) and NRPE checks (the nagios plugin is executed on the client via NRPE).

Non-NRPE services - no configuration needed on the client

For example UNIVENTION_PING (as you can see in UMC -> Devices -> Nagios -> UNIVENTION_PING -> Use NRPE is not activated). These services can be used without any configuration on the client (debian host) because they are executed on the nagios server. To add a services to a host, open the host object in the UMC webinterface got to [Advanced Settings] -> Nagios Services and add UNIVENTION_PING. The nagios service should now be activated for the host in the nagios webinterface.

NRPE services

For NRPE services, there is some configuration needed on the client. First, install the (standard debian) package nagios-nrpe-server (some nagios plugin packages are installed automatically with the installation of nagios-nrpe-server). Now configure allowed_hosts in /etc/nagios/nrpe.cfg to the UCS nagios server (e.g. allowed_hosts=master.my.domain) and restart the nrpe service (service nagios-nrpe-server restart).

Next, the nagios NRPE services commands have to be configured on the client. Every NRPE nagios service on the UCS nagios server defines a NRPE command (see /etc/nagios/nrpe.univention.d/ on the UCS nagios server), for example /etc/nagios/nrpe.univention.d/UNIVENTION_DISK_ROOT.cfg. In order to use the UNIVENTION_DISK_ROOT NRPE service, the client needs a appropriate configuration for the UNIVENTION_DISK_ROOT command. So, just copy /etc/nagios/nrpe.univention.d/UNIVENTION_DISK_ROOT.cfg from the UCS nagios server to /etc/nagios/nrpe.d/UNIVENTION_DISK_ROOT.cfg on the debian host and restart the NRPE service.

->  more /etc/nagios/nrpe.d/UNIVENTION_DISK_ROOT.cfg 
command[UNIVENTION_DISK_ROOT]=/usr/lib/nagios/plugins/check_disk -w '25%' -c '10%' -p '/'

Now the UCS nagios server can execute the UNIVENTION_DISK_ROOT on the debian host via NRPE. The client than executes the nagios plugin (check_disk) with the configured parameters. The plugin is a standard nagios plugin and should be available on the debian host after the installation of the nagios NRPE package. To check the setup, run the following command on the UCS nagios server:

/usr/lib/nagios/plugins/check_nrpe -H debian -c UNIVENTION_DISK_ROOT

After all this configuration, you can add the UNIVENTION_DISK_ROOT nagios service to the host object for the debian system.

Please keep in mind:
[ul]
[li] Activate nagios for the host object[/li]
[li] Add nagios services to the host object[/li]
[li] Make sure NRPE service commands are known on the client (e.g. the nagios service UNIVENTION_DISK_ROOT defines a NRPE command in /etc/nagios/nrpe.univention.d/UNIVENTION_DISK_ROOT.cfg on the UCS nagios server, this command has to be configured in the debian client too, /etc/nagios/nrpe.d/UNIVENTION_DISK_ROOT.cfg)[/li]
[li] Make sure the plugin used in the NRPE command (/usr/lib/nagios/plugins/check_disk in case of UNIVENTION_DISK_ROOT) is available on the client[/li][/ul]

More information about nagios in UCS can be found in the documentation http://docs.software-univention.de/manual-4.1.html#nagios::general.

I hope this helps, best regards

Felix Botner

Dear Felix,

Thank you very, very much for the detailed explanation.

This is exactly as I have understood it works.

Maybe some more automation could be obtained with some Ansible magic? I suppose it will still need some action on the client bit.

Again, much appreciated!

Kind regards,

-R

Mastodon