Sep. 25th, 2008

reddragdiva: (Default)

(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?

reddragdiva: (party)

Life is doing its sitcom trick again. Though [livejournal.com profile] redcountess has the new Metallica album, which is surprisingly not a horrendous sewer of fail. More importantly, Freda absolutely loves it. She sits headbanging in her high chair. [livejournal.com profile] arkady is going to try her on her Iron Maiden collection.

Lovely evening down t' pub on Sunday with [livejournal.com profile] nyecamden. We hope to make Vagabonds on Saturday.

This is a message in a bottle. I haven't read my friends list properly in weeks. I still love you all!

March 2022

S M T W T F S
  12 345
6789101112
13141516171819
20212223242526
2728293031  

Style Credit

Expand Cut Tags

No cut tags