CUP Usage and memory usage

FrancescFrancesc
Hello,



We're interesting in monitoring the CPU Usage % and memory usage in % to get these values average every month with a SQL query (the Serverscheck is linked with a SQL Server database).



The problems with the rules that monitoring memory and CPU are that the returned value is not in %. And the CPU usage doesn't work with more than 1 cpu and all our servers have more than 1 CPU. So I've wroten a vbs script that looks for via WMI this value and the Script works nice.



But now I want that Serverscheks uses these values to get the SLA and with the external rules, the values are not stored as in the rest of rule types.



How can I do to get these values in the serversCheck?



Greetings,

Francesc

Comments

  • AdministratorAdministrator
    That feature is not available in ServersCheck.
  • FrancescFrancesc
    And which rule could I use to get the % of CPU usage? I think this is a very important value to check of a server.



    With WMI is really simple to do:



    On Error Resume Next

    strComputer = "server_name"

    Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")

    Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)

    For Each objItem in colItems

    Wscript.Echo "LoadPercentage: " & objItem.LoadPercentage

    Wscript.Echo "Name: " & objItem.Name

    Next



    Do you think you could implement this check?



    Greetings,

    Francesc
  • AdministratorAdministrator
    It can be done through performance counters.
  • FrancescFrancesc
    How can I do to save these returned values into the SQL Server database?


  • AdministratorAdministrator
    For the external check this is not possible as explained earlier. As alternative you can use the PERFCOUNT check to monitor individual CPU's.



    ServersCheck calculates the average CPU usage of all CPU's combined when running multiple CPU based systems.
  • FrancescFrancesc
    I'm using the performance counter and it returns the correct value.



    But I'd like to log all the returned values in the SQL Server odbc. I see that only firts rule executed is logged into the database.



    Should I see a database gegister for every rule checked?



    What I want to do is get every month an average of the CPU using a SQL query.



    Maybe my serverscheck is not working properly because it dowsn't insert a register every time that the rule is executed.



    Greetings,

    Francesc
  • AdministratorAdministrator
    It should do it for every check. Have your database administrator check the SQL log for any errors. When running in debug mode you should see the SQL statements it executes.
This discussion has been closed.