Shell script to create a group from a pattern

Use Sysload Web Services API to define Monitored Objects with a regular expression and add them in a group

Script 'sld-add-group-from-pattern.ps1', version '1.0', date '30/10/2015'
MS host : localhost
MS name is 'sldmgts'
MS TCP port is '9900'
MS user: admin
MS password: xxx
MO Group Class is empty
sld-add-group-from-pattern.ps1 [-ms_host (default:localhost])
             [-service name_of_MS_service (default:sldmgts)]
             [-port (default:9900)]
             [-user (default:admin)] [-password (default:sysload)]
             -class class_name -group group_name
             [-pattern_type (*|regular expression)]
             [-pattern_mo (*|regular expression)]
             [-pattern_instance (*|regular expression)]
             [-update yes|no (default:no)
             [-show yes|no (default:no)]
             [-desc ""]

  class : zone|system|role|category
  pattern_type : pattern for agent type
                 Wildcard character (*) and regular expressions (/pattern/) are accepted
                 Examples: NT OBAS_NT UNIX /^s.+a$/ N*
  pattern_mo : pattern for Monitored Object name (same syntax)
  pattern_instance : pattern for instance name (same syntax)
  update : yes to force update if group already exists
  show : yes to list Monitored objects matching pattern in database, and in group if it already exists
  desc : description text to add to group definition

Script written in Powershell 3.0
Validated with Sysload 5.80 Web services API

Screenshots

Platform


Operating Systems


Versions

Created by....

Michael Checler

Michael Checler


Email:
michael.checler@automic.com


Login to View or Leave Comments