Icinga2 - Using NSClient++, modify check's parameters

nsclient
graphite
icinga2
icingaweb2

(Alberto Vivanco) #1

Icinga2 - Using NSClient++, modify check’s parameters.

Hi guys, I’m new in this area and I’m raising the Icinga2 monitoring system to monitor approximately 80 different servers, I need your support with an example on how to modify some aspects:

  1. NSClient ++ (nscp-local-disk, how to modify its parameters and filter only the C: / and D: / units?, where is the file to do this?)

  2. An example on how to configure my Hosts and my Services by Zones as well as different conditionals to relate them to each other.

  3. My signed certificates disappear with the passage of time, what could be happening?

I share part of my current structure:

file: /etc/icniga2/zones.conf
///////////////////////////////////////////////////////////////
object Endpoint NodeName {
}

object Zone ZoneName {
endpoints = [ NodeName ]
}

object Zone “global-templates” {
global = true
}

object Zone “director-global” {
global = true
}

object Endpoint “192.168.0.1” {
}

object Zone “192.168.0.1” {
endpoints = [ “192.168.0.1” ]
parent = ZoneName
}
///////////////////////////////////////////////////////////////

file: /etc/icinga2/conf.d/services.conf

apply Service “DiskRemote” {
check_command = “nscp-local-disk”
command_endpoint = host.vars.client_endpoint
vars.nscp_disk_showall = true
vars.nscp_disk_free = false
assign where host.vars.hostgroupvariable == true
assign where host.vars.servicevariable == true
check_interval = 1h
retry_interval = 10m
}

apply Service “ClientService” {
check_command = “nscp-local-process”
command_endpoint = host.vars.client_endpoint
vars.nscp_arguments = [ “process=ClientService.exe” ]
assign where host.vars.hostvariable == true
check_interval = 10m
retry_interval = 10s
}
///////////////////////////////////////////////////////////////

file: /etc/icinga2/conf.d/hosts.conf

object Host “192.168.0.1”{
check_command = “hostalive”
address = “192.168.0.1”
vars.os = “Windows”
vars.client_endpoint = “192.168.0.1”
vars.hostgroupvariable= true
vars.servicevariable = true
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
}
///////////////////////////////////////////////////////////////


(Alberto Vivanco) #2

For future reference, the OS is Debian Linux and the version of Icinga2 and NSClient ++ is 10.2


(Chris) #3

Hi to only monitor the c drive for example you need the parameter “nscp_disk_drive”

For refereece look here:
https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#nscp-local-disk

Here a example with the simular definition to yours:

apply Service “DiskRemote c drive” {
check_command = “nscp-local-disk”

command_endpoint = host.vars.client_endpoint

vars.nscp_disk_showall = true
vars.nscp_disk_free = false
vars.nscp_disk_drive = "c"

assign where host.vars.hostgroupvariable == true
assign where host.vars.servicevariable == true
check_interval = 1h
retry_interval = 10m
}

(Alberto Vivanco) #4

Good afternoon friend.

I appreciate your prompt help, I confirm that the change you mention is correct and at the moment my monitoring system only shows me the unit C: / as I expected, I thank you for the support for this topic.

My Icinga2 is quite slow and takes a long time to see the changes despite restarting it but it works correctly.


(Chris) #5

sure

your welcome

please also mark the solution, that the thread is marked as solved