FordCrews: It's still not working, my database is 45gigs, they make us keep logs for a year, we generate a bunch of logs. I keep getting time outs in different places. I have been hopeful if I keep running it, it might make it through at some point. It seems to be getting through more and more each time it's run. I opened a ticket, but they haven't gotten back yet.
Did you upgrade Orion NPM to 9.0 at the same time? The error looks to be with NPM not APM.
Jon, you're looking for a "% disk space used" WMI counter, but I don't think it exists. What I do know is we can write a short little Windows script that runs calculations on the WMI counters to give us a value that is the % disk spaced used. That would then let us set our warning/critical thresholds and get the results that we expect.
Here's a script that does exactly what I just described. It gets the raw percent free WMI counter for the C: instance, and performs the necessary arithmetic to give us the % of used disk space.
Notes:We're using the raw counters here instead of formatted counters to be as backwards compatible as possible -- Windows 2000 doesn't have the snazzy formatted counters of the later OS releases.
Change the strComputer assignment to the IP address of the computer you want to monitor.
If you want to monitor some other logical drive, change the drive letter in the Select statement.
Every script that APM runs has to output the string "Statistic:xxx", where xxx is some value. This is the value that APM uses to determine whether the component has exceeded any thresholds.
strComputer = "127.0.0.1"Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colDisks = objWMIService.ExecQuery _ ("Select * from Win32_PerfRawData_PerfDisk_LogicalDisk Where Name = 'C:'")For Each objDisk in colDisks intBaseValue = objDisk.PercentFreeSpace_Base dblActualUsedSpace = 100 - ((100 * objDisk.PercentFreeSpace) / intBaseValue) WScript.Echo "Statistic:" & Int(dblActualUsedSpace)Next
1. Add an Administrator Credential for the Windows Servera. Click APM Settings, and then click Credential Library.b. Add a credential that has administrator-level access to the Windows server you want to monitor. I named mine "Admin". Whatever you name it, just be sure you can recall it later.
2. Create a Windows Script component monitor in AppBuilder.a. Click APM Settings, and then click AppBuilder.b. Select Windows Script Monitor as your component type, and then click Next.c. Select <Create a new component monitor>, and then click Next.d. Type a descriptive name for this component such as "Drive C: Space Used (%)"e. Select the administrator-level credential for this server from the Credential for Monitoring list.f. Copy and paste the "Used Disk Space" script from this post into the Script Body field.g. Set a sensible warning and critical statistic threshold. I used 50 and 90, respectively.h. Click Next.
3. Make a template from this component monitor so that you can reuse it.a. Click New Application Monitor Template, and type a descriptive name for this template such as "Logical Disk Usage Statistics - WMI"b. Click Next.
4. Assign the template to the server you want to monitor.a. Expand the nodes to locate the server you want to monitor.b. Check the server name, and then click Next.c. Click OK, Create.
5. Check the status and other details of your application monitor.a. Click APM Settings, and then click Component Monitor Library.b. Expand the Windows Script Monitor node.c. Expand the Application Monitors containing Windows Script Monitor node.d. Click the Logical Disk Usage Statistics - WMI monitor for your server to view the details.
The disk is 71% full, and we're in a warning state because we set our warning threshold to 50%.
There are a number of online resources you can use to investigate other methods in which you can use Windows Scripts to query the WMI counters to come up with other derivative statistics. For example, you could subtract the counter for Disk Used from Disk Size to get a Disk Remaining value representing the number of megabytes free on the drive, and then set your thresholds in "MBs free" instead of a percentage.
To start, I would point you to the Microsoft Scripting Clinic article "How's My Driving? Monitoring Performance Using WMI"http://msdn.microsoft.com/en-us/library/ms974615.aspx
I'd also recommend Microsoft's Scriptomatic Tool that can help you create WMI scripts.http://www.microsoft.com/downloads/details.aspx?familyid=09dfc342-648b-4119-b7eb-783b0f7d1178
-Roger
Hi Roger,
Thank you very much for this! I am running into an issue though. I created everything as described, but I keep getting an "Application Status is Down". Specifically, it states "The return code is different than expected. The script returned status code DOWN."
Jon
Can we run the script in Windows instead of APM to see if you still get the same error?
1. Log on to Windows on the computer hosting Orion NPM/APM.2. Open Notepad, copy the above script, and then save it as c:\test.vbs3. Click Start > Run.4. Type cmd in the Open field, and then click OK.5. Type cd c:\ and then press ENTER.6. Type cscript //nologo c:\test.vbs and then press ENTER.
What is the text output from that?
Here are the results from your script:
C:\>cscript //nologo test.vbsStatistic:5
The problem was in my script. I used the method for making a local WMI call instead of a remote WMI call. Sorry about that. I've tested this script here, though, and it works.
Notes:
1. This script requires the following script arguments
Script Arguments: ${IP} ${USER} ${PASSWORD}
2. This script cannot monitor the status of the Orion NPM server itself, because it *only* makes remote WMI calls. You have to use the other script for that.
strComputer = wscript.arguments(0)strUser = wscript.arguments(1)strPassword = wscript.arguments(2)Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")Set objWMIService = objSWbemLocator.ConnectServer (strComputer, "root\cimv2", strUser, strPassword)Set colDisks = objWMIService.ExecQuery _ ("Select * from Win32_PerfRawData_PerfDisk_LogicalDisk Where Name = 'C:'")For Each objDisk in colDisks intBaseValue = objDisk.PercentFreeSpace_Base dblActualUsedSpace = 100 - ((100 * objDisk.PercentFreeSpace) / intBaseValue) WScript.Echo "Statistic:" & Int(dblActualUsedSpace)Next
Thanks a lot Roger! I am now monitoring drive usage succesfully!
Roger,
I have one more question. According to the documentation, it looks like I should be able to use these APM monitors to send alerts via Orion. However, I have not been able to get this to work. Can you point me to some other documentation for setting this up? The documentation that I have found thus far is a little vague in the setup proceedures.
What have you tried?
The Admin Guide has this:
http://www.solarwinds.com/NetPerfMon/SolarWinds/wwhelp/wwhimpl/common/html/wwhelp.htm?context=SolarWinds&file=ApplicationPerformanceMonitorAdministratorGuide.5.34.htm"> http://www.solarwinds.com/NetPerfMon/SolarWinds/wwhelp/wwhimpl/common/html/wwhelp.htm?context=SolarWinds&file=ApplicationPerformanceMonitorAdministratorGuide.5.34.htm
That is what I was looking at, but I cannot figure out how to create the alert. Can you step me through creating an alert for the template that you created to monitor disk usage? I am pretty sure if I can see one example, I can figur eout how to create the others.
On the way, Jon. Need to fact check, then will post it. Gimme 30 mins.
Sure. The first step is to set up the alert trigger conditions, and the second step is to set up the alert trigger actions.
For setting up the alert trigger conditions, I'll use three examples:
To configure a new alert:1. Log on to Windows server hosting Orion NPM.2. Run the Advanced Alert Manager. Start > All Programs > SolarWinds Orion > Advanced Alert Manager.3. Click Configure Alerts. This opens the Manage Alerts window.
An alert to notify you when any component goes to a critical state:
Trigger Alert when all of the following applyComponent Status is equal to Critical
Trigger Alert when all of the following apply
Component Status is equal to Critical
To set up this alert trigger condition:1. Click New in the Manage Alerts window. 2. Type Alert me when a component goes critical in the Name of Alert field.3. Click the Trigger Condition tab.4. Select APM: Component from the Type of Property to Monitor list.5. Click Add, and then click Simple Condition from the shortcut menu.6. Click the first asterisk (*) in the statement * is equal to *.7. Point to APM Component Monitors and then click Component Status in the shortcut menu.8. Click the remaining asterisk (*) in the statement Component Status is equal to *.9. Type Critical in the list box.
To set up the alert trigger action:1. Click the Trigger Actions tab.2. Click Add New Action.3. Select Log the Alert to the NetPerfMon Event Log, and then click OK.4. Type "The component " in the message field, and then click Insert Variable.5. Select APM:Component from the Variable Category list, select ComponentName from the Select a Variable list, and then click Build Selected Variable.6. Type " of node " in the message field, and then click Insert Variable.7. Select General from the Variable Category list, select NodeName from the Select a Variable list, and then click Build Selected Variable.8. Type " is " in the message field, and then click Insert Variable.9. Select APM:Component from the Variable Category list, select ComponentStatus from the Select a Variable list, and then click Build Selected Variable.Note: The full message should read "The component ${ComponentName} of node ${NodeName} is ${ComponentStatus}".10. Click OK to close the Log Alert window.11. Click OK to close the Edit Alert window.
If any of your components go into a critical state, you will now see a line item for it in the Orion NPM Event Log:
By adding more conditions, you can make the alert more specific. Here are the skeletons for the multiple condition alerts that I mentioned earlier. You can build these in the same way as the single condition alert.
An alert to notify you when any component named "Drive C: Space Used %" goes to a critical state:
Trigger Alert when all of the following applyComponent Status is equal to CriticalComponent Name is equal to Drive C: Space Used (%)
Component Status is equal to CriticalComponent Name is equal to Drive C: Space Used (%)
Component Name is equal to Drive C: Space Used (%)
An alert to notify you when the "Drive C: Space Used%" component of the node named "jons-computer" goes to a critical state:
Trigger Alert when all of the following apply Component Status is equal to CriticalComponent Name is equal to Drive C: Space Used (%)Node Name is equal to jons-computer
Component Status is equal to CriticalComponent Name is equal to Drive C: Space Used (%)Node Name is equal to jons-computer
Node Name is equal to jons-computer
You can set up more advanced alerts such as an alert that can be triggered on either a warning or a critical status. For more information on these, see "Creating and Configuring Advanced Alerts" in the Solarwinds Orion NPM Administrator Guide.
http://www.solarwinds.com/NetPerfMon/SolarWinds/wwhelp/wwhimpl/js/html/wwhelp.htm?href=OrionAGManagingAlertsAdvanced.htm
Thank you so much for this! I was able to create the alerts that I need now. BTW, do you know if there are any plans on publishing a tutorial for creating basic and advanced alerts in Orion? I think that it would be a very usfull addition to theexisting documentation.
Thanks Again!
FordCrew, Any luck sorting your issue out?
Buffer latch timeouts are usually caused by slow disk I/O.This is looking like a SQL issue as opposed to an Orion issue.http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q310834
CAUSES:
When your system is under a heavy stress load or when your system has hardware demands that exceed your hardware's ability, your system may produce buffer error messages. Some of the most common causes of a stressed environment are: