How to get up and running

Hi … I have been using icinga 1 for many years and have just installed the latest version onto ubuntu 18 platform. (time to upgrade!)

I have added the director module and am ready to start adding hosts and services… But I have to say the documentation is of very limited use to the newbi .

This needs sorting this out, most will give up long before they arrive here!! all that work for nothing!!

So can someone please give me a step by step basic tuto for director (icinga2 is easier to manually configure than using director which is supposed to simplify the job!! )

I would like to :

1, create a host object (I got that I need to create a host template first ) (I have done this but not sure it’s as it should be )

2, create a service object (do I need a template here also? What is the logic here?)

3, configure a customized check_nrpe calling a script on the remote server (couldn’t fathom how or where to add to $vars ) (I will probably change this in the future but at the moment I have a lot of existing nrpe clients)

Also is there any way to make check_nrpe talk V3 talk to V2 (-2 has no effect) (I’m doing this from the cli as I haven’t figured out how to add this as a service using director)

apply the service to a bunch of hosts (or just 1)

I really need a help to get the basic principles straight and I will put together a idiots guide (in english) once I have understood the way to approach director…

Ps I have seen the book in German but … it’s in German book I can’t even google translate it!

Many thanks

Peter

That’s true for sure, and we are working on changing that. Also, we appreciate community members having profited from help here coming back and improving the documentation. Many leave and never return.

There’s some pre-requisites for the Director to work with, sort of golden rules:

  • Always create host and service templates before. If applicable, add the check_command and other common attributes in there.
  • Define some grouping for these templates, e.g. for windows and linux servers, or database servers, etc.
  • Same goes for service templates, e.g. based on the underlaying transport
  • Don’t re-create commands which are already imported as external commands from Icinga 2 (from the ITL, check the docs).

Having that in mind, configuration follows the same principle:

  • Add a host template, assign hostalive as checkcommand
  • Add a host which imports this template. Decide whether the Icinga 2 agent will be run on, set the agent properties if needed.
  • Specify additional custom vars in the object or template, like “os_type = Linux” and similar.
  • Add a service template, e.g. using the nrpe check_command
  • When it comes to missing command parameters, navigate into the Commands section → external commands → select nrpe, the fields tab. Select the fields to export.
  • Pick an apply rule or service set and specify the command parameters

Do it again, and again, and again. Trying things out is the way it works, I’ve benefited from watching talks and reading the forums quite extensively. And then I’ve fired up the Vagrant box and started playing.

In terms of NRPE itself, I strongly discourage its usage for security reasons. The Icinga Director fully integrates the Icinga 2 client/agent, and as such, best practice is to use it instead of NRPE as transport layer. I don’t know whether v3 nrpe works with v2, I’ve only seen some GitHub issues with discussions about it. Specifically, I don’t care about nrpe, there’s more important issues around. Sounds bold, but I’m honest here.

Cheers,
Michael

Thank you for your quick reply… points me in the right direction… i hope! I will try to look at this again tomorrow … don’t worry i will be back in touch if it is not clear!!
when i get it sorted in my mind I will write some procedures for my users and myself! (i will share them)
As for nrpe i was aware there are issues but i was hoping to test with that first.as it is being used on most of the machines. I have copied the old nrpe plugin across and it works from the command line but i will definitely try out the icinga2 client once i get the basics down.
Thanks again
Peter

Hi again …thanks to your remarks and some playing I made some big progress today ….
I am ok up until the service template
I created a nrpe service template but some of the command parameters seem not to be settable …
I have this in the preview plane( see below) but only nrpe_adress, nrpe_command (appears twice once for commands and once for arguments, duplication of the label!), nrpe_port and nrpe_timeout are available in the custom field dropdown. So how can I set for example "$nrpe_version_2$ ? can I override/set the “vars.nrpe_version_2 = false”

object CheckCommand “nrpe” {
import “plugin-check-command”
command = [ PluginDir + “/check_nrpe” ]
timeout = 5m
arguments += {
“-2” = {
description = “Use this if you want to connect to NRPE v2”
set_if = “$nrpe_version_2$”
}
“-4” = {
description = “Use IPv4 connection”
set_if = “$nrpe_ipv4$”
}
“-6” = {
description = “Use IPv6 connection”
set_if = “$nrpe_ipv6$”
}
“-H” = {
description = “The address of the host running the NRPE daemon”
value = “$nrpe_address$”
}
“-a” = {
order = 1
repeat_key = false
value = “$nrpe_arguments$”
}
“-c” = “$nrpe_command$”
“-n” = {
description = “Do not use SSL”
set_if = “$nrpe_no_ssl$”
}
“-p” = “$nrpe_port$”
“-t” = {
description = “: = :<Check state to exit with in the event of a timeout (default=CRITICAL)>”
value = “$nrpe_timeout$”
}
“-u” = {
description = “Make socket timeouts return an UNKNOWN state instead of CRITICAL”
set_if = “$nrpe_timeout_unknown$”
}
}
vars.check_address = {
arguments = [ ]
deprecated = false
name = “”
side_effect_free = false
type = “Function”
}
vars.check_ipv4 = “$nrpe_ipv4$”
vars.check_ipv6 = “$nrpe_ipv6$”
vars.nrpe_address = “$check_address$”
vars.nrpe_no_ssl = false
vars.nrpe_timeout_unknown = false
vars.nrpe_version_2 = false
}

Many thanks peter.
Ps I have documented the first part I can sent it to you if you send me an address mail … or maybe it’s better to post the pdf somewhere.

Hi,

in terms of nrpe command arguments, you need to navigate to Commands > External > nrpe > Fields and then add the arguments you’ll need in your host/service templates and objects.

Do you have a blog? If not you can also write a howto category (just click on the highlight).

Cheers,
Michael