0

As per this question I want to monitor the network utilisation of my Windows Servers using Nagios (not Cacti).

Does anyone have any guidance on querying the WMI counters using NSClient or via SNMP so that rrd data can be collected by nagios for graphing using pnp4nagios?

Or does anyone have a plugin that does this?

Thanks

Dan
  • 852
  • 1
  • 8
  • 28

5 Answers5

1

I'm using Centreon which provides the perl script check_centreon_snmp_traffic.

lg.
  • 4,649
  • 3
  • 21
  • 20
1

Solved this by using the check_bandwidth3 plugin for Nagios and checking it over SNMP. I don't know why I didn't think of checking it via SNMP first as that's how I collect the stats for my cisco kit!

Dan
  • 852
  • 1
  • 8
  • 28
  • 1
    Just a word of warning--this won't work for 1Gpbs interfaces or faster since Windows only has 32-bit counters which rapidly overflow on fast uplinks http://serverfault.com/questions/205785/windows-network-snmp-traffic-overflow – Ryan Horrisberger Mar 18 '13 at 17:30
  • I've actually authored my own check plugin for Nagios for this exact reason! http://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_interfaces_wmi/details – Dan Apr 03 '13 at 11:20
0

WMI will work even for fast interfaces. SNMP won't work well for >=1Gbps interfaces since 64-bit counters aren't available on Windows and 32-bit counters overflow, nor will Performance Monitor Counters since they are only rates (bytes/sec) and not absolute counters [1]). You mention you have nsclient which can easily query WMI, so you could do this:

check_nrpe -H <host> -c CheckWMIValue -a 'Query=select BytesReceivedPersec, BytesSentPersec from Win32_PerfRawData_Tcpip_NetworkInterface where name = "<interface-name>"' Check:BytesReceived:=BytesReceivedPersec Check:BytesSent:=BytesSentPersec

Despite the name BytesReceivedPersec this is a 64-bit counter (Total Bytes) and not a rate (Bytes/sec).

[1] - Anything that is already in a rate form (bytes/sec) like the perfmon counters will not work well. For instance if you do your checks every 5 min, imagine you check an idle interface and get 0 BytesReceived/sec, then for 3 minutes you d/l a huge file and max out the interface, then it goes back to idle for the next min. When you poll for BytesReceived/sec you will get 0 again, even though for most of the time you were pulling a lot of data. You need an absolute counter of Bytes Sent/Received so you can subtract the first check from the second and divide by the time interval.

  • As per my other comment, you can now use my plugin at http://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_interfaces_wmi/details – Dan Apr 03 '13 at 11:21
0

The standard Nagios plugins should include an SNMP plugin that can check the bandwidth usage of a NIC just fine. I've never bothered to use WMI when SNMP was much more interoperable in a mixed environment. I try not to use NRPE or NSClient as it means more work to maintain the plugins if you make a change or update them.

As for being able to use RRD tools to graph the data from Nagios, you will have to setup a script that will collect the performance data from the Nagios check execution and use that to populate your RRD data files. There is nothing that comes stock with Nagios to do this. Groundwork OpenSource Monitor which is based on Nagios does provide some functionality to do this. In our environment we use Nagios for monitoring and Cacti for graphing... ie- use the right tool for the job...

Jeremy Bouse
  • 11,341
  • 2
  • 28
  • 40
0

I'm using Opsview which does this out of the tin. I spent alot of time researching this area and IMHO I couldn't find anything as good as Opsview.

hulbs9nw
  • 336
  • 1
  • 2
  • 8
  • Currently trying this on Debian Lenny - Fingers x'd looks like everything I need wrapped up in a nice meta-package. As long as it works and can let me see the trends I need then I'm happy. – Dan Aug 25 '09 at 15:13
  • Have installed OpsView, Am impressed by it's user interface, but I'm still struggling to get it to display the actual bandwidth, rather than the RTA and packetloss values which I have already. – Dan Aug 26 '09 at 13:55