EV Observe - Use GLOBAL-PS-Values Service Template

Last modified on 2023/06/23 16:43

The GLOBAL-PS-Values service template is used to run a PowerShell command that will return one or more objects and compare properties in each object with warning and critical thresholds.

The PowerShell command must include the property containing the name of the object to be processed and the property value to be compared with warning and critical thresholds.

     Open url.png See the service template catalog

Notes

  • If the property containing the name of the object to be processed is missing, the status of the service will be Unknown.

Procedure: How to use the GLOBAL-PS-Values service template

SelectCompanyInCompanyTree_Procedure

1. Go to the Web app.

2. Select the company from the company tree structure.

Notes:

  • The selected company must be associated with a Box.
  • You can create a new company. Open url.png See the procedure

    Company tree structure.png

3. Create a new service.

  • Select Configuration > Services > List in the menu.
  • Click + Add in the Mode: Box tab.

4. Specify the information below.

General information tab
   Global-PS-Values configuration.png

  • Service template: Select the GLOBAL-PS-Values service template.
  • Name: Enter the name of the new service to be created. Its name should correspond to the event to be captured.
     

Availability and checks tab
     Global-PS-Values configuration - Availability and checks tab.png

  • Specify the information specific to the service template.
    • Command: PowerShell command to be run by the service. Open url.png See the example
    • Name property: Property containing the name of the object to be processed.
      Note: If the status of the service is Warning or Critical, this field will contain the control output value.
    • Property to be controlled: Property whose value should be compared with warning and critical thresholds.
    • Warning and critical thresholds.

5. Click Apply.

Example

Deploy a service to calculate the number of days since the last modification of a file.

1. Enter a PowerShell command to check the number of days since the last modification

  • PowerShell command:
((Get-Date)- ((Get-ItemProperty -Path $filePath).LastWriteTime)) | select-object -Property Days
  • Output:

        Global-PS-Values example - Output 1.png

==> Insufficient information because the property containing the name of the value to be processed is missing. The status of the service will be Unknown .

2. Add the property containing the name of the value to be processed in the PowerShell command

  • PowerShell command:
((Get-Date)- ((Get-ItemProperty -Path $filePath).LastWriteTime)) | select-object -Property @{Name="$columnName"; Expression = {"$contenu"}}, Days

==> @{Name="$columnName"; Expression = {"$content"}} is used to create a "Name" column whose output is the content, Expression

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

        Global-PS-Values example - Output 2.png

Tags:
Powered by XWiki © EasyVista 2024