check_NT and W2k3

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
cdiaz
Posts: 4
Joined: Mon Nov 26, 2007 5:00 pm

check_NT and W2k3

Post by cdiaz »

I am trying to use check_nt from a FreeBSD box to get values of performance counters on Windows 2003 boxes. I have nagios successfully working on the BSD server and am using check_nt both in nagios and in cacti to check hard drive space, memory and running processes. The problem is when I run check_nt from the command line and use any counter name, I always get a result of 0. I am using this syntax:

../libexec/check_nt -H servername -v COUNTER -l "\\Memory\\Available Bytes"

I tried with multiple counters, even with counters that were obviously misspelled like "\\mem\\ava" and I still get 0 as the result

Any ideas?
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Post by YoMarK »

You could use perl to access WMI/performance counters. You don't need the nagios agent to do this(In fact, I don't like agents on servers since it's not necessary).
Example(look at the windows memory script): http://forums.cacti.net/about12383.html

It's very easy to find other Perfomance Counters using Scriptomatic: http://www.microsoft.com/downloads/deta ... 3b0f7d1178

One more thing: WMI needs authentication. See the thread above for more information.
cdiaz
Posts: 4
Joined: Mon Nov 26, 2007 5:00 pm

Post by cdiaz »

I am trying to access the performance counter data from a FreeBSD box. Aren't the two solutions you posted only from Windows boxes?
YoMarK
Cacti User
Posts: 89
Joined: Fri Feb 02, 2007 8:36 am
Location: Eindhoven/The Netherlands

Post by YoMarK »

Sorry cdiaz, you're right. :(
I allways thought that you could use perl to access WMI from a Linux/BSD machine, but it seems that Win32::OLE does only work on windows.
In that case...why do people use (and install)perl to create scripts and not just vbscript(native)?

Anyway...you could try to install the Win32::OLE under WINE:
http://www.perlmonks.org/?node_id=430194
Or just install a windows box for Cacti(which is probably going to work better anyways). I have cacti graphing about 100 Windows boxes(and a lot of other devices), and it's working just great.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests