Knowledge Base

Knowlegebase articles

Welcome to SysOrb knowledge base. Her you will find detailed explanation on questions regarding SysOrb. The list is under continues development and new articles will be added. You can follow the links below or enter a "key word" to search all of the articles.

How to automatically update alert group on all nodes to “As domain”

Symptoms: 

You would like to automatically update alert group on all nodes to “As domain” instead of doing it manually via the SysOrb web interface.

Cause: 

With SysOrb 3.8 it is possible to set Alert group for an entire domain. The administrator no longer needs to set alert group on each individual node but can set an alert group for an entire domain. This feature ease the configuration of SysOrb significantly and save a lot of time when configuring new domains and nodes.

However existing customers who has upgraded to SysOrb 3.8 from an earlier version of SysOrb will naturally have an alert group assigned to each individually node.
In order to automatically assign the alert group “As domain” to all nodes in a given domain then the following script can be used.

Resolution: 

On windows the script should be place the folder: install-dir\SysOrb Server

// Win32 script to recursively update alertGroup value for all nodes in passed // as a parameter
//   domain and it's subdomains
//
// Usage:
// cscript /nologo agupdate.js "start_domain" group_id
//
//
//
// Example: set alert group for all nodes starting from root domain to value 0.3 //("As Domain"):
//
// agupdate.js "." 0.3
//
// 
// 
//
// 


// arguments for 'sysorb-tool' utility (SysOrb should be running)
var USER="admin"
var PASS="admtest"
var SERVER="localhost"
var PORT="3241"
var DOMAIN="."

if (WScript.Arguments.Count() < 2) {
    WScript.echo("Usage: cscript agupdate.js \"start_domain\" alert_group_id");
  WScript.Quit(-1);
}

var startDomain = WScript.Arguments(0);
var alertGroupId = WScript.Arguments(1);

// Execute 'sysorb-tool' utility
var WshShell = new ActiveXObject("WScript.Shell");
var querycmd = "sysorb-tool -s " + SERVER + " -p " + PORT +" -d " + DOMAIN +
" -l " + USER + " -P " + PASS +
" listnodes -o i -r " + "\"" + startDomain + "\"";
//WScript.echo(querycmd);
var oExec = WshShell.Exec(querycmd);
while (!oExec.StdOut.AtEndOfStream) {
  var node = oExec.StdOut.ReadLine();
  var updatecmd = "sysorb-tool -s " + SERVER + " -p " + PORT +" -d " + DOMAIN +
" -l " + USER + " -P " + PASS +
" update -i " + node + " alertGroup=\"" + alertGroupId + "\"";
WshShell.Exec(updatecmd);
}
WScript.echo("Done.");