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
I'm using Centreon which provides the perl script check_centreon_snmp_traffic.
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!
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...
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.
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:
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.