NAGIOS : how to add a bunch of linux machines in nagios (not managed by UCS)

Hi everyone,

I would like to add a bunch (few hundred) of linux machine that are in different subnet to the Nagios instance of my principal UCS. (at least for ping or ssh availlability)

is there an automated way (or a script I could write) to add some 300 machines to the nagios instance ? which method is more efficient to avoid to add them one by one ?

thanks for your directions.

You can use the univention-directory-manager (or its shortcut udm) command-line tool to create, modify and delete any type of object in the LDAP directory, including machines of type “IP managed client” with their Nagios settings.

See udm modules for a list of available modules and udm <modulename> --help for help using said module; for “IP managed clients” the module is computer/ipmanagedclient. See the admin docs for more information about the Univention Directory Manager tool, and search this forum for more usage examples.

thanks Moritz for your indications

It works well to create hosts, is there any way to add these hosts to Nagios in command line ?

If you’re using Univention’s Nagios implementation, Nagios-enabled hosts should be added to the Univention Nagios installation automatically.

If you’re using your own/a third-party Nagios installation, there are no Univention-provided tools to add hosts to them. I don’t know of tools provided by others to do that either; however, that doesn’t mean those don’t exist, of course.

OK,
I have made a script to automatically add all of my hosts into Univention, then selected all and just added to Nagios via the “option” for the hosts.
that fine, it’s just works. thanks for the udm tips.

Oh, you meant to activate the Nagios option via udm? I’m sorry, I seem to have misunderstood you earlier. You could have added that option with --options nagios via udm, too.

Mastodon