We're migrating from Nagios "active" monitoring of Windows services via the check_nt plugin, to "passive" monitoring whereby the client systems will run a script (and issue multiple native NSCP and/or O.S. commands) to gather the service data and post it to the Nagios central server via its NRDP web service.
So I'm looking at the source code for the Nagios check_nt plugin (check_nt.c), and see that the various commands it supports are translated to numbers which are passed to NSClient++ (NSCP).
Here's the mapping -- I've filled in a few that I've figured out by trial and error:
check_nt command name NSClient++ command number NSCP command
====================== ========================= =================
CHECK_CLIENTVERSION 1 checkversion
CHECK_CPULOAD 2 checkcpu (broken in NSCP 0.4.1.105)
CHECK_UPTIME 3
CHECK_USEDDISKSPACE 4
CHECK_SERVICESTATE 5 checkservicestate
CHECK_PROCSTATE 6
CHECK_MEMUSE 7 checkmem, but what type: page/paged/virtual/physical?
CHECK_COUNTER 8 checkcounter
CHECK_FILEAGE 9
CHECK_INSTANCES 10
Does anyone know which NSCP commands these numbers correspond to?
I'd like to implement the same commands, to cause as little disruption as possible in the migration to passive service checks.
For example:
The current active check for a counter executes the following command on the Nagios central server:
/usr/local/nagios/libexec/check_nt -H 1.2.3.4 -s password -p 12489 -v COUNTER -l "\\TCPv4\\Connections Established"
In the new infrastructure, that command will be executed on the client as:
nscp client --query checkcounter "\TCPv4\Connections Established"