Nagios on Windows: use Cygwin.
Sep. 25th, 2008 10:52 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
(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?
(no subject)
Date: 2008-09-25 10:05 pm (UTC)Chances are, if it's anywhere it'll be exposed through WMI, along with everything else you ever wanted to know and a lot you didn't...
(no subject)
Date: 2008-09-25 10:16 pm (UTC)NSClient(++) seemed to do the three things ex-employer wanted (loadav, disk, pull events from system logger) but the last time I looked the docs were largely self-contradictory.[1]
The Nagios graphing bolt-on is shit, too. Fucking Perl.
Zenoss appears to be less shit, but there are no winders boxes being monitored this time.
[1] However, the Winders mob wouldn't touch it, so the project died. And then I left. Fuck 'em.
(no subject)
Date: 2008-09-25 10:39 pm (UTC)Indeed. But when all you have is a forehead, every problem looks like a soft and comfy brick wall.
(no subject)
Date: 2008-09-25 10:50 pm (UTC)Worked for me. FAVO 'worked'.
(no subject)
Date: 2008-09-26 01:06 pm (UTC)Hack a script out of snmpwalk and Bob is your dad's brother.
(no subject)
Date: 2008-09-26 02:56 pm (UTC)