ServiceNav offers several solutions to allow you to create your own Powershell service model: GLOBAL-PS-STATUT and GLOBAL-PS-Values.
We will focus here on the GLOBAL-PS-STATUT model.
Using the GLOBAL-PS-STATUT model
This model allows the launch of a Powershell command returning one or more objects.
For each of the returned objects, it checks the value of a property (specified as a parameter) and changes state according to this value.
The mapping between the value and the status of the control is configurable. It is possible to restrict the objects to be controlled via a whitelist/blacklist applying to a second property which is also configurable.
Prerequisites for configuration :
Windows supervision account with the right to run the command.
Model Parameter :
- The PowerShell command,
- A property corresponding to the name of the object,
- A property corresponding to the controlled value,
- A property on which filters, white list, black list are applied,
- Value/status mapping,
- The text to be displayed when all objects are OK,
- The type of remote connection to be used (winrm or RPC).
Use case - Check if an Exchange database is installed
From your Exchange server
In your Exchange console, check your order.
The result is this.
Now you just need to implement it in a ServiceNav service model.
Create a new template MS-Exchange-Mounted-Database-Status.
In the configuration module / Services menu / Templates
Click on add
Note : It is best to create your new template at the highest level of the tree structure to allow for inheritance across all your customers or sites.
1) Complete the general information
2) Add availability information
3) Select the verification command in the "Analysis properties" section. check_ps_status
Then fill in the fields to create your own service model.
Note : Some PowerShell scripts need a console to run. In our case of use it is therefore necessary to fill in the PS Console field with the Exchange console.
Caution Do not put " ; "at the end of the Powershell command...
Once the fields are filled in, click on the button Validate.
Instanciation of this new model in supervision
Now that the template has been created it can be used in your ServiceNav monitoring tool.
Configuration Module / Services Menu / Lists
Click on the Add
Choose Service Model
Instanciate fields if necessary
Add this service on your Exchange server in the relationship tab.
Click on Valider and reload your configuration.
Verification of this new model in supervision
Supervision / Technical Operation Module
Look for your checkpoint and check its operation.