Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
I have quite powerfull server for my cacti installation. It is four processor Win2k server. I always wanted to add CPU load graph to cacti. I thought - easy, just add proper SNMP MIB and start monitoring. Unfortunately it turned out that Microsoft does not support more than one processor (!!!). In case of multi-processor environment I can monitor the load but values returned are either 0 or 100.
I decided to write a VBScript code that is able to read load from all of four CPUs (actually it works for 2-way and 8-way as well):
On Error Resume Next
strComputer = "."
strOutput = ""
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
strOutput = strOutput & objItem.LoadPercentage & " "
Next
Wscript.StdOut.Write(strOutput)
Data Input entry looks as follows: "cscript cpumon.vbs //nologo". There are no input arguments and there are four (or other number deppending on number of your CPUs) output values.
Two components are needed to run the script: WSH and WMI. You can download them from MS web site.
I need a bit of help with this script on the first post as I am doing something wrong.
I have created the cpumon.vbs script and copied it to <path_cacti>/scripts
I then created a new 'Data Input Method' with the Input Type of 'Script/Command' and the input string of 'cscript <path_cacti>/scripts/cpumon.vbs //nologo'
I then created two Output fields called CPU1 and CPU2 and saved everything
Next I created a Data Template and selected the newly created Data Input Method
Then I created a very simply Graph Template with my 1 Data Source item
Finally I associated the Graph Template with the device
The problem is that no RRA file gets created and therefore no graph gets produced either. Does anyone have a dummies guide for getting a simply WMI connection working with Cacti?
For Windows installations, have a look at http://www.snmp-informant.com/. The standard version is free and includes counters for memory, processor, logical disk, network interface.
You guys... ...use WMI. Microsoft is putting all their stuff in WMI and are doing it well. I'm doing CPU load on a 4 proc machine and it's perfectly accurate all the time. I posted the scripts on here a long time ago in the scripts directory.
I'm sorry ajeskey, I thought that everyone else who got the WMI stuff to get to run under *nix using nsclient or whatever was a good enough example. Maybe they can hold your hand and spoon you from the left.
As far as this thread, it was posted originally as the person using VBScript and WMI, and has success using it, getting valid values, like most everyone else using it -- who's off base?
I'll take my response to private message, since obviously DevilSun does not know when someone is pointing out faults on software suport and not at the person sending the message.
Ok, so I'm glad we've all come to the agreement that SNMP in Windows sucks.
If you're doing Windows monitoring using Windows, WMI works fine.
If you're doing Windows monitoring using *nix, SNMP-Informant might work better for you unless you *nix guys can find a decent WMI solution that works for you.
I guess I'm just confused as to when this turned into *nix monitoring windows box problem thread, but so be it. Good luck with your monitoring!!