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.
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
@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.
@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:
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.
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.