Check_nt or NSclient++

Hello,

Previously we were using Nagios for monitoring our Windows servers, where we installed NSclient++ software on Windows servers and fetched the different services status using check_nt!SERVICESTATE command in Nagios.

CheckMK has a completely different approach, but I know this is built on top of Nagios so I guess there is a way to implement this same check_nt commands/checks in CheckMK.

This was the command we used in old Nagios:

check_nt -H IPADDRESS -p 12489 -v SERVICESTATE -d SHOWALL -l W3SVC (for IIS status)

Is there any way to use this same kind of command in CheckMK?

Any input would be appreciable, thanks :slight_smile:

Hi,

with MRPE you can use this check in checkmk as well. Please take a look at the manual: https://checkmk.com/cms_agent_linux.html#Executing%20plug-ins%20over%20MRPE

Best Regards

Anastasios

Maybe this is better: https://checkmk.com/cms_active_checks.html#Integrating%20other%20Nagios-compatible%20plug-ins

If the plugin is already stored in ~/lib/nagios/plugins/ you need one rule set.
Otherwise you need to place check_nt in ~/local/lib/nagios/plugins/ and then create the WATO Rule

1 Like

@athomaidis gave already information you need. But i would strongly recommend to remove the old nsclient++ and replace it with the CMK agent.
NSClient is security risk in modern environments as it is possible to start every process you want from remote without strong security.

3 Likes

As @andreas-doehler said: Use the checkmk agent on Windows, it has Windows Service monitoring builtin.

1 Like

@andreas-doehler - I’m looking to remove that NSclient++ and replace with CheckMk agent, but not sure how to run these same commands in CheckMK for the hosts.

@athomaidis - Thanks for these details, much helpful. I’ve gone through local/lib/nagios/plugins/ and it has that check_nt plugin.

  • I’ve copied it over to local/lib/nagios/plugins/check_nt
  • Went to “Classical active and passive Monitoring checks” ruleset

In CLASSICAL ACTIVE AND PASSIVE MONITORING CHECKS section:

  • Added a Service description
  • Command like:

check_nt -H $HOSTADDRESS$ -v SERVICESTATE -d SHOWALL -l W3SVC

  • Added a Host tag condition, but when I save I’m getting an error: Please specify at least one condition or this rule will never match.

The condition set in Host tag section, but this message is keep coming in. Any idea?

Also, I’ve three more doubts:

  • Do I have to save this check_nt file in “C:\ProgramData\checkmk\agent\mrpe” folder and configure any checks in check_mk.user config file?
  • How does that $HOSTADDRESS$ variable take the correct Host IPs?

Any input on above would be appreciated, thanks :slight_smile:

Hi @fasal,

I would recommend to copy check_nt only on your checkmk Server, if the network of the IP’s

is reachable. If you have special nagios checks for certain hosts, then you can use

But if you already use check_nt at every WIndows Host, then you can use The MRPE Mechanism at every Windows Host.

Therefore, please take a look at the manual: Monitoring Windows - The new agent for Windows in detail

If you use check_nt on your checkmk Server, its much easier because of $HOSTADDRESS$

In the condition field of the rule you can specify a WATO-Folder, or a certain Host, or a Tag. The rule will apply on all host where the condition is matching.

Please send us a screenshot of the rule. I think that you’ve forgotten to choose a condition.

You can learn more about rules here Rules or https://www.youtube.com/watch?v=iRgKXuaTj0g&t=546s

Best Regards

Anastasios

2 Likes

Hi @athomaidis - Thanks for all the good info, but I wasn’t able to achieve what I needed. But I made a batch script to check the status of services that I want and put it in local folder which works fine for me.

However, I’ve one more doubt with Windows agent. In this agent output, there are many checks being done which are not needed on our environment. For eg:

  • logwatch
    • ps
    • wmi_webservices
    • services
    • winperf

The above checks are not required, so I put it under the _disabled_sections: section in check_mk.user.yml file and commented out from _sections: section. Restarted the agent, but still these checks are appearing on agent output. Is there anything I’m missing out?

Why? The CheckMK agent already give you all needed information.

I strongly recommend to avoid all types of MRPE scripts or checks on your Windows machine they are not needed anymore.

Please read again the description → if a section starts with “_name” then it is ignored, to be used a section name must be “name” without underscore.

If you really want to use the Windows agent and also CMK as your monitoring solution you should start with a Windows agent without any extra scripts and inspect the output and what you checked before with your NSClient. You will see that the “naked” CMK agent already has all the information included what you had before with check_nt and NSClient.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.