(I'm not here right now, please email a message) ([info]reddragdiva) wrote,
@ 2008-09-25 22:52:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Nagios on Windows: use Cygwin.

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




(Post a new comment)


[info]baljemmett
2008-09-25 10:05 pm UTC (link)
Pretty sure Windows doesn't have anything that maps nicely to a *nix load average -- I'll have a dig into our CPU monitoring stuff tomorrow and check if there are any useful hints there.

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

(Reply to this)


[info]hirez
2008-09-25 10:16 pm UTC (link)
NRPE-NT is utterly f-ing horrible.

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.

(Reply to this) (Thread)


[info]reddragdiva
2008-09-25 10:39 pm UTC (link)
"NRPE-NT is utterly f-ing horrible."

Indeed. But when all you have is a forehead, every problem looks like a soft and comfy brick wall.

(Reply to this) (Parent)(Thread)


[info]hirez
2008-09-25 10:50 pm UTC (link)
http://trac.nakednuns.org/nscp/

Worked for me. FAVO 'worked'.

(Reply to this) (Parent)


[info]sbp
2008-09-26 01:06 pm UTC (link)
Have you tried using an snmp script to look for the load? Try .1.3.6.1.2.1.25.3.3.1.2 which is HOST-RESOURCES-MIB::hrProcessorLoad
Hack a script out of snmpwalk and Bob is your dad's brother.

(Reply to this) (Thread)


[info]reddragdiva
2008-09-26 02:56 pm UTC (link)
Processor load at this particular moment is easily obtained. The trouble is that NT doesn't in itself maintain the 1 minute, 5 minute and 15 minute averages Unix does, and Cygwin claims to but it doesn't work.

(Reply to this) (Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…