Nagios on Windows: use Cygwin.
Sep. 25th, 2008 10:52 pm(non-geeks won't care about this)
The solution to my Nagios plugins on Windows problem: Cygwin. You can use anything that can be done in a GNU environment as a plugin. It also somewhat emulates Linux /proc, which is most useful. We have Cygwin on all our Windows boxes and it's the best idea ever (apart from getting rid of Windows).
Nagios Exchange has any number of easily bodged shell scripts (or Perl or Python!), or you can write your own. It just has to terminate with exit 0 for OK, exit 1 for warning, exit 2 for critical or exit 3 for state unknown.
For practice, write the following as c:\test.exe and do chmod a+x /cygdrive/c/test.exe on it:
#!/usr/bin/bash echo "Hello world!"
Now open a cmd.exe window and do:
c:\cygwin\bin\bash.exe -l -c "/cygdrive/c/test.exe"
You'll see it echo Hello world! as it should.
Your nrpe.cfg line for a swap-checking shell script plugin at c:\nrpe\bin\checkntswap.exe will look something like:
command[check_swap]=C:\cygwin\bin\bash.exe -l -c "/cygdrive/c/nrpe/bin/checkntswap.exe -w 85 -c 95"
Unfortunately, cat /proc/loadavg will give you a line of zeroes. This is an annoying bug in Cygwin's Linux emulation. Does anyone know of how to get Windows load averages reliably?