Any way to display current performance value as a scalar tile?

Hi,

I know that I can use the performance tile with sparklines set in order to have a line graph with the current value to the right - but is there any way to just have the current value displayed as a scalar value in a tile?

So far as I can see there isn’t an alternative way to do it.

Thanks

Pete

Hi Peter,

 

you could create a task in SCOM and call that task from Squared Up.

With custom labeling you could use if / else and then print the arrows via Unicode:

https://en.wikipedia.org/wiki/Template:Unicode_chart_Arrows

 

Are you looking for a specific perf counter? Let me know if you need ?

 

Ruben

I would use the SQL Scalar tile and try a query to pull the most recent entry from the DB

Here is a query I’ve edited from Kevin Holmans source: https://kevinholman.com/2016/11/11/scom-sql-queries/

select top 1 SampleValue
from PerformanceDataAllView pdv with (NOLOCK)
inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
where path = ‘server’ AND
objectname = ‘LogicalDisk’ AND
countername = ‘Free Megabytes’
order by timesampled DESC

Depending on how you want to use it, you could add it to a perspective.

Thanks for the great suggestions, and apologies for the long delay in replying.

Both options would work but having built an XML fragment that creates the needed SCOM Task I found that the formatting options for that method are far too limiting. There isn’t any means to change the size of the data that is displayed, nor can you center or affect the style in any way. Using the SQL Tile I can at least specify a font size and unit.

Pete

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <TypeDefinitions>
    <ModuleTypes>
      <WriteActionModuleType ID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element name="TimeoutSeconds" type="xsd:int" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
          <xsd:element name="CounterName" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
          <xsd:element name="InstanceName" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
          <xsd:element name="OutputFormat" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int" />
          <OverrideableParameter ID="CounterName" Selector="$Config/CounterName$" ParameterType="string" />
          <OverrideableParameter ID="InstanceName" Selector="$Config/InstanceName$" ParameterType="string" />
          <OverrideableParameter ID="OutputFormat" Selector="$Config/OutputFormat$" ParameterType="string" />
        </OverrideableParameters>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
                <ScriptName>Get-WindowsPerformanceCounterValue.ps1</ScriptName>
                <ScriptBody>
                  &lt;#
                  .SYNOPSIS
                  Community.DataOnDemand performance counter script
                  .DESCRIPTION
                  This script will execute on the targetted server and return the specified performance counter value.
                  .PARAMETER Format
                  Permitted values: text, csv, json
                  .NOTES
                  Copyright
                  #&gt;
                  [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]
                  Param(
                  [string]$CounterName,
                  [string]$InstanceName,
                  [string]$OutputFormat
                  )

                  # build the full path to the counter
                  if ($InstanceName -ne "" -and $InstanceName -ne $null)
                  {
                    [string]$fullCounterName = ("\" + $InstanceName + "\" + $CounterName)
                  }
                  else
                  {
                    [string]$fullCounterName = ("\" + $CounterName)
                  }
                                    
                  # get the counter
                  $counterData = (Get-Counter -Counter "$fullCounterName" -SampleInterval 2 -MaxSamples 1)

                  # and display the correct formatted value (if provided, otherwise just output it)
                  if ($OutputFormat -ne "" -and $OutputFormat -ne $null)
                  {
                  [string]$displayString = ($counterData.CounterSamples[0].CookedValue).ToString($OutputFormat)
                  }
                  else
                  {
                  [string]$displayString = ($counterData.CounterSamples[0].CookedValue).ToString()
                  }

                  # and return the string
                  $displayString | Out-String -Width 4096 | Write-Host

                  # Done. (do not remove blank line following this comment as it can cause problems when script is sent to SCOM agent!)
                </ScriptBody>
                <Parameters>
                  <Parameter>
                    <Name>CounterName</Name>
                    <Value>$Config/CounterName$</Value>
                  </Parameter>
                  <Parameter>
                    <Name>InstanceName</Name>
                    <Value>$Config/InstanceName$</Value>
                  </Parameter>
                  <Parameter>
                    <Name>OutputFormat</Name>
                    <Value>$Config/OutputFormat$</Value>
                  </Parameter>
                </Parameters>
                <TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
              </WriteAction>
            </MemberModules>
            <Composition>
              <Node ID="WA" />
            </Composition>
          </Composite>
        </ModuleImplementation>
        <InputType>System!System.BaseData</InputType>
      </WriteActionModuleType>
    </ModuleTypes>
  </TypeDefinitions>

  <Monitoring>
    <Tasks>
      <Task ID="DataOnDemand.GetWindowsPerformanceCounter" Accessibility="Public" Enabled="true" Target="Windows!Microsoft.Windows.Computer" Timeout="60" Remotable="false">
        <Category>Operations</Category>
        <WriteAction ID="WA" TypeID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter">
          <TimeoutSeconds>60</TimeoutSeconds>
          <CounterName></CounterName>
          <InstanceName></InstanceName>
          <OutputFormat></OutputFormat>            
        </WriteAction>
      </Task>
    </Tasks>
  </Monitoring>

  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter">
          <Name>Data On Demand GetWindowsPerformanceCounter write action</Name>
          <Description>Displays the current value of the specified performance counter.</Description>
        </DisplayString>
        <DisplayString ElementID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter" SubElementID="CounterName">
          <Name>Counter Name</Name>
          <Description>The name of the performance counter to be retrieved.</Description>
        </DisplayString>
        <DisplayString ElementID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter" SubElementID="InstanceName">
          <Name>Instance Name</Name>
          <Description>The name of the instance to be retrieved.</Description>
        </DisplayString>
        <DisplayString ElementID="DataOnDemand.WriteAction.GetWindowsPerformanceCounter" SubElementID="OutputFormat">
          <Name>Output Format</Name>
          <Description>The format string to apply to the output.</Description>
        </DisplayString>
        <DisplayString ElementID="DataOnDemand.GetWindowsPerformanceCounter">
          <Name>Display current Performance Counter value (Data On Demand)</Name>
          <Description>
            Displays the current value of the specified performance counter on the target computer.
          </Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>