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.