Using the Generic Powershell Template – Global-PS-Values

How the plugin works

Successful operation of the plugin is assured when the output of the PowerShell command has the following structure:

  • a column with the name of the value to be processed
  • a column with the value to be compared to the thresholds

If, in the output of the PowerShell command, there is only the column with the value. the checkpoint will return the UNKNOWN status.


PowerShell command

Here we want to calculate how long since a file was last modified.

We check the number of days since the last modification.


((Get-Date) – ((Get-ItemProperty -Path $ filePath) .LastWriteTime)) | select-object -Property Days


The information is not enough and the check status will be in UNKNOWN.

The column is missing with the name of the value.

Instead we will generate it in PowerShell:


((Get-Date) – ((Get-ItemProperty -Path $ filePath) .LastWriteTime)) | select-object -Property @ {Name = “$ columnName”; Expression = {“$ content”}}, Days


((Get-Date) – ((Get-ItemProperty -Path C: \ Users \ kerraes \ Desktop \ o365.txt) .LastWriteTime)) | select-object -Property @ {Name = “Name”; Expression = {“AntivirusBaseIsLate”}}, Days


In the command…

@ {Name = “Name”; Expression = {“AntivirusBaseIsLate”}}

allows us to create the needed column with the content “Expression” in the output.


Template configuration

We use the ‘GLOBAL-PS-Values’ service template

In the “Property Name” filed: enter the name of the column containing the metric name

(If the check is Warning or Critical, this value will be shown in the plugin output)

In the “Property to check” field: enter the name of the column holding the value.




UK ServiceNav Product Development Manager; my priority is to be needful of the particular requirements of all ‘English-speaking’ markets where ServiceNav is sold. I have over 20 years experience of the IT monitoring field - covering a wide variety of products and technologies.