Documentations

Using PowerShell generic templates - GLOBAL-PS-Values

On the page

Do you need help?

How the plugin works

The normal operation of the plugin is ensured 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 be UNKNOWN.

Example

PowerShell command

Here we want to calculate how long the file has been unmodified.

The number of days since the last modification is checked.

  • Ordering :
((Get-Date)- ((Get-ItemProperty -Path $filePath).LastWriteTime)) | select-object -Property Days
  • Ouput:

 

The information is not sufficient. The checkpoint will be UNKNOWN.
The column with the name of the value is missing.

We'll generate it in the PowerShell output:

  • Ordering :
((Get-Date)- ((Get-ItemProperty -Path $filePath).LastWriteTime)) | select-object -Property @{Name="$columnName"; Expression = {"$content"}}, Days
  • Example:
((Get-Date)- ((Get-ItemProperty -Path C:UserskerraesDesktopo365.txt).LastWriteTime)) | select-object -Property @{Name="Name"; Expression = {"AntivirusBaseIsLate"}}, Days
  • Output:

 

In the command, the :

@{Name="Name"; Expression = {"AntivirusBaseIsLate"}}

creates a column with the content "Expression" in the output.

Checkpoint configuration

We use the GLOBAL-PS-Values service model

 

In the "Property Name" parameter: the name of the column where the name of the value is located. If the control is Warning or Critical, this value will be the output of the plugin.

In the "Property to be checked" parameter: the name of the column where the value is located.

 

You may also be interested in

Global-Api-Value & Global-Api-Status

word image 10

Using the Global-Plugin-Execution service model

Configure the box to receive traps

en_GB

Welcome to ServiceNav!

Do you need some help? More information about our products? Write to us!
You have taken note of our privacy policy.
We use cookies to ensure the best experience on our site. If you continue to use this site, we will assume that you are satisfied with it.

Reserve your place

You have taken note of our privacy policy.