SystemEDGE MIB Extension Configuration Example (with Scripts)

Document ID : KB000056956
Last Modified Date : 23/03/2018
Show Technical Document Details
Introduction:

SystemEDGE allows you to further expand its monitoring capabilities via Extension Scripts.

In short, SystemEDGE will run a custom script each time the MIB attribute defined for that script is polled. SystemEDGE can also be configured to poll an Extension Script itself and check the return value -- and should the value breach the defined threshold, trap accordingly. Here is an example on how to do this (including scripts).

Instructions:

Example Scripts

In the scripts.zip file, there are two scripts. Both scripts:

  • Are written in PowerShell (and therefore are Windows only)
  • Require PowerShell 3.0 (or later)
  • Do the same thing: Monitor if the system running the script can map a drive to a remote host
    • The difference is in how the credentials are stored/passed to the script
  • When run via SystemEDGE, they do not require any parameters to be passed in manually (the agent will take care of the required parameters)
  • Require some minimal configuration that is environment specific (share names, credentials, etc).
  • Return 0 (zero) on success and non-zero on failure or error

 

filesharetester.ps1 -  The shares and credentials are stored within a CSV file. An example is sharelist.csv. To use this script/file, the sharelist.csv needs to have one entry per line in the following format:

index,share,user,password

For example:

10,\\SERVER\SHARE,USER@DOMAIN.COM,P@$$W0RD
20,\\SERVER2\SHARE2,USER2@DOMAIN.COM,P@$$W0RD2

In addition, the full path to the sharelist.csv will need to modified within the filesharetester.ps1 script (currently on line 99):

$file = [IO.File]::OpenText("D:\sharelist.csv")

 

filesharetester-alt.ps1 - The shares and credentials need to be configured within the script (currently starting at line 93). One line per share in the following format:

index { TestShare "share" "user" "password" }

For example:

10 { TestShare "\\SERVER1\SHARE1" "USER@DOMAIN.COM" "P@$$W0RD" }
20 { TestShare "\\SERVER2\SHARE2" "USER2@DOMAIN.COM" "P@$$W0RD2" }

 

In the case of either script, the index must match the configured index that was used to configure the Extension script itself.

 

Configure MIB Extension

To configure the MIB extension through Virtual Assurance for Infrastructure Managers, do the following:

  1. Open the desired policy or template
  2. Go to the Mib Extensions tab
  3. Fill out the form:
    • Index: a unique value that you specify. As noted above, it must match the configured values within the script accordingly
    • Type: In the case of these example scripts, Integer should be used.
    • Extension Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass C:\PATH\TO\SCRIPT.ps1
      • Modify the path to the script accordingly.
      • "-ExecutionPolicy Bypass" may or may not be needed depending on the settings available within the environment
      • As noted above, PowerShell 3.0 or later is required. The "v1.0" referenced in the path above is NOT the version of PowerShell
    • Access Rights: Read Only
  4. Click Add
  5. Click Save Policy

extention.png

 

If configuring via the sysedge.cf directly, the entry would look like this:

extension 100 integer readonly 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass C:\PATH\TO\SCRIPT.ps1'

Again, modify the path to the script accordingly.

 

Configure Threshold (AKA Self Monitor)

Once the MIB Extension has been configured, the respective Threshold can be configured.

  1. Open the desired policy or template
  2. Open the Monitors Tab and Threshold sub-tab
  3. Fill out the form:
    • Index: a unique value that you specify. This one doesn't have to match what was configured with the script/extension, but it makes it easier to keep track of when they do all match.
    • Object Class: extensionGroup
    • Object Attribute: index value of the configured extension. In this example, 100 is used for the extension so 100 must be provided here.
    • Operator: not equal to
    • Value: 1
    • Any other desired values specific for your configuration (Description, Severity, Interval, etc)
  4. Click Save
  5. Click Save Policy

extselfmon.png

 

If configuring via the sysedge.cf directly, the entry would look like this:

monitor oid extensionGroup.100.0 100 0x0 60 absolute != 0 'share test' '' extensionGroup '' '' warning

 

How It All Works Together

  1. The Threshold (AKA Self Monitor) will "poll" the MIB Extension.
  2. When polled, the MIB Extension within SystemEDGE run the configured script and automatically passes in the index number of the MIB Extension. Either script will use the index number to match (either in the csv file, or in the switch statement) the appropriate share to test. The script will run the proper tests to the appropriate share as configured. The results of the test are then populated in the MIB Extensions OID (zero for success, non-zero for failure/error).
  3. The Threshold will evaluate the return code and trap/alert accordingly.
Additional Information:
File Attachments:
TEC1111823.zip