Using NSCP to determine server "up" status

We’re using Icinga2 with flat file configurations vs the database backend.

We’re in the early testing stages of rolling our Icinga to our Windows servers using the nsclient. Many of these windows servers block ICMP (ping) packets

I have the nsclient working for the most part including monitoring specific windows services, memory/cpu/disk usage and more.

My main problem is that since these systems don’t permit ICMP, Icinga2 shows them as “down”. Is there a way that Icinga can report the status of the system based on whether or not it is able to communicate with the nsclient?

Does anyone have an example of the configuration file(s) to make that work?

check_command = “dummy”

Antony.

Thanks Anthony

I did see that command, however my understanding is that it automatically always assumes that it is online regardless of actual status.

I’m looking for something that will perform an actual check to verify status

Okay, what check are you able to use? I have no idea what connectivity you
have, or what services are expected to be running, which would qualify as
“server is up” in your environment.

You can use any service check command you like for the host check; if it
returns status 0 or 1 (OK or Warning) the host will be regarded as up, and if
it returns 2 or 3 (Critical or Unknown) the host will be regarded as down.

See https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/
#check-result-state-mapping

Regards,

Antony.

I was thinking something as simple as checking the nscp client version

If Icinga is able to get a response from that, then it’s safe to assume the system is “up”

I’ve looked over that page and attempted to accomplish this, but Icinga continues to report the system as “down” which is why I was hoping for an example functioning code snippet for my configuration.

As Antony said, you can use any command that complies to the standard return values as a host check command as well.

Simply create a host template that defines your desired check command.
Import this template at the host and that should be all.

e.g.

template Host "generic-host-non-icmp" {
    check_command = "thecheckcommandyouwant"
}

I have something like that, but it does not appear to have the desired affect, still resulting in the system showing “down”. Running the same command in a separate “service” it seems to return OK.

template Host "windows-servers" {
  vars.os = "Windows"
  check_command = "nscp"
  vars.nscp_variable = "CLIENTVERSION"
}

For reference, the version of code that works when assigned as a “service”

apply Service "PingAlt" {
  import "generic-service"

  check_command = "nscp"
  vars.nscp_variable = "CLIENTVERSION"

  assign where "noping" in host.vars.hosttype
}

image

image

And how does the host config look like?

The “windows” host template is being applied AFAICT otherwise the services in green wouldn’t be working

object Host "myhost" {
  import "internalgroup-hosts"
  vars.os = "Windows"
  address = "myhost.mydomain"
  vars.hosttype = [ "noping" ]
}

from the windows “defaults” configuration that creates those three green statuses

apply Service "RAM-Usage" {
 import "generic-service"
 check_command = "nscp"
 vars.nscp_variable = "MEMUSE"
 assign where "windows-servers" in host.groups
 vars.nscp_warn = 90
 vars.nscp_crit = 95
}

and in case you ask about the import:

template Host "internalgroup-hosts" {
  import "generic-host"
  vars.type = "internalgrouphost"
  groups = [ "internalgroup" ]
  vars.notification["mail"] = {
    groups = [ "internalgroupadmins" ]
  }
}

Add a import "windows-servers" to your host config after the import "internalgroup-hosts"

Holy smokes! Such an easy miss on my part!

It works now! I’ll seriously buy you a pint! Thank you for your patience and continuing to assist over the past few days! You rock my man!

Just tell me where to send the beer voucher!

Hello @etannehi

Really glad your issue got resolved!
Could you please mark the response that contributed most to fixing it as the “solution”?
This way people have an easier time finding out where to look if they have a similar issue and which topics still need answering :slight_smile:

Thank you very much and have a lovely weekend!
Feu