none
Monitor for memory usage for a process

    Pregunta

  • Hi 

    I would like to monitor how much memory a certain process is using on our Citrix servers. We have lots of instances of wfshell.exe running and sometimes there is a memory leak and this process can use upwards of 1GB RAM.

    We would like to have a alert generated when wfshell goes over a threshold that I set so we can respond to it.

    How can i do this in SCOM 2007 R2?

     

    miércoles, 23 de febrero de 2011 15:47

Respuestas

  • Hi.  You might have to fake out the template, by putting in bogus numbers.  For example, one of the things we did was to choose to alert if the process runs for more than 24855 days (the maximum).  I'm pretty sure the server will reboot before that time.  Even if it doesn't, I won't be around to worry about it.  :) 

    You could also try using minimum and maximum numbers, but if there will be more than 100 running processes, it won't work for you.

    It's important to note that there is also a bug in the wizard, that will only allow you to enter 100 MB in the "Generate alert if memory usage exceeds the specified threshold".  The work around is to put in 100, and override the value after the monitor is created.  It's been mentioned in these forums, but Graham blogged about it here, http://systemcentersolutions.wordpress.com/2009/07/24/service-monitor-template-memory-monitoring-bug/.  It's a bug in the process template too.

    I suppose you could also go the WMI route and create a monitor that checks process usage via WMI.  Kevin Holman writes about that here, http://blogs.technet.com/b/kevinholman/archive/2008/07/02/collecting-and-monitoring-information-from-wmi-as-performance-data.aspx.

     

     


    Layne
    • Marcado como respuesta UKZNMCL jueves, 24 de febrero de 2011 21:17
    miércoles, 23 de febrero de 2011 18:39
  • Use the Process template in Ops Mgr R2!

    Authoring pane > MP Templates

     

    Process Working Set is what you need to monitor, then set a limit over which to alert you!

     

    JW


    JW
    • Marcado como respuesta UKZNMCL jueves, 24 de febrero de 2011 21:18
    miércoles, 23 de febrero de 2011 16:23

Todas las respuestas

  • Use the Process template in Ops Mgr R2!

    Authoring pane > MP Templates

     

    Process Working Set is what you need to monitor, then set a limit over which to alert you!

     

    JW


    JW
    • Marcado como respuesta UKZNMCL jueves, 24 de febrero de 2011 21:18
    miércoles, 23 de febrero de 2011 16:23
  • I had a look at that but on the first section is says "generate an alert if the NUMBER of processes is below the minimum value or above the maximum value for longer than the specified duration"

    I do not want to monitor the number of processes, just the memory usage of the processes. If i wanted to ignore this setting what would i enter? 0?

    miércoles, 23 de febrero de 2011 16:28
  • Just leave it as 1 and 1 that way it won't alert on process number.

     

    JW


    JW
    miércoles, 23 de febrero de 2011 16:32
  • Hi,

    I have left it at 1 and unfortunatly it is reporting on the number of processes. Any other ideas as to how i can get it to ignore this and just report on memory usage per process?

     

    miércoles, 23 de febrero de 2011 16:49
  • Hi.  You might have to fake out the template, by putting in bogus numbers.  For example, one of the things we did was to choose to alert if the process runs for more than 24855 days (the maximum).  I'm pretty sure the server will reboot before that time.  Even if it doesn't, I won't be around to worry about it.  :) 

    You could also try using minimum and maximum numbers, but if there will be more than 100 running processes, it won't work for you.

    It's important to note that there is also a bug in the wizard, that will only allow you to enter 100 MB in the "Generate alert if memory usage exceeds the specified threshold".  The work around is to put in 100, and override the value after the monitor is created.  It's been mentioned in these forums, but Graham blogged about it here, http://systemcentersolutions.wordpress.com/2009/07/24/service-monitor-template-memory-monitoring-bug/.  It's a bug in the process template too.

    I suppose you could also go the WMI route and create a monitor that checks process usage via WMI.  Kevin Holman writes about that here, http://blogs.technet.com/b/kevinholman/archive/2008/07/02/collecting-and-monitoring-information-from-wmi-as-performance-data.aspx.

     

     


    Layne
    • Marcado como respuesta UKZNMCL jueves, 24 de febrero de 2011 21:17
    miércoles, 23 de febrero de 2011 18:39
  • Awesome thanks Layne, I will test this tommorow
    miércoles, 23 de febrero de 2011 18:44
  • You could also just target the citrix servers, and use perfmon:

     

    Process \ Private Bytes \ wfshell.exe

    However, if there are multiple instances of wfshell.exe running normally - then this wont work - because the monitor will only inspect the first instance.  You cannot use a wildcard either, like "wfshell*" because this will cause the monitor to flip flop as it parses each instance.

    You can consider the following options:

    1.  Write a script based monitor and have the script inspect each process individually by attaching to WMI for each instance and evaluate the memory consumption of each or all processes.

    2.  Use the new functionality in R2 which specifically is written for this issue:  http://blogs.technet.com/b/momteam/archive/2010/10/04/unit-monitors-for-multi-instance-perfmon-counters.aspx

     

     


    Kevin Holman http://blogs.technet.com/b/kevinholman
    jueves, 24 de febrero de 2011 3:24
    Moderador
  • Tested this today and worked a treat. Thanks for the help guys!!
    jueves, 24 de febrero de 2011 21:18
  • Hi UKZNMCL,

     

    Could you please let me know how you can achieved.

    i hava processor associated with Service, need to monitor the Memory utilization of the process.

    Please let me know how we can do that.

     

    BR/Siva

     

    martes, 11 de octubre de 2011 7:29
  • Hi Shiva,

    Please use the below monitor to achieve your monitoring requirement.

    <UnitMonitor ID="XXXX.XXX.XXX.CLS1.ProcessMemoryUsage.Monitor" Accessibility="Internal" Enabled="true" Target="XXXX.XXX.XXX.CLS1" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="MicrosoftSystemCenterProcessMonitoringLibrary!Microsoft.SystemCenter.Process.ConsecutiveSamplesThreshold.ErrorOnTooHigh" ConfirmDelivery="true">
            <Category>PerformanceCollection</Category>
            <AlertSettings AlertMessage="XXXX.XXX.XXX.CLS1.ProcessMemoryUsage.Monitor_AlertMessageResourceID">
              <AlertOnState>Error</AlertOnState>
              <AutoResolve>true</AutoResolve>
              <AlertPriority>Normal</AlertPriority>
              <AlertSeverity>Error</AlertSeverity>
              <AlertParameters>
                <AlertParameter1>$Data/Context/SampleValue$</AlertParameter1>
              </AlertParameters>
            </AlertSettings>
            <OperationalStates>
              <OperationalState ID="OK" MonitorTypeStateID="SampleCountNormal" HealthState="Success" />
              <OperationalState ID="Error" MonitorTypeStateID="SampleCountTooHigh" HealthState="Error" />
            </OperationalStates>
            <Configuration>
              <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <CounterName>Private Bytes</CounterName>
              <ObjectName>Process</ObjectName>
              <InstanceName>XXXXXX</InstanceName>
              <Frequency>30</Frequency>
              <Threshold>XXXXX</Threshold>
              <NumSamples>1</NumSamples>
            </Configuration>
          </UnitMonitor>

    Thanks

    Vijaykumar IS

    • Editado Vijaykumar IS jueves, 17 de mayo de 2018 9:03 Removed some values
    jueves, 17 de mayo de 2018 8:58