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.

Script to get a list of nodes which have no AlertGroup

Symptoms: 

You experience that you might not get an alert from some of the nodes in SysOrb.

Cause: 

You have a SysOrb server with a large amount of nodes and it might be that you forgot to assign an alert group to some of the nodes. Below script will list which nodes that does not have an alert group assigned.

Resolution: 
// Win32 script to get a list of nodes which have no AlertGroup
//
// Usage:
// cscript /nologo noag.js
//

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

var WshShell = new ActiveXObject("WScript.Shell");
var querycmd = "sysorb-tool -s " + SERVER + " -p " + PORT +" -d " + DOMAIN +
" -l " + USER + " -P " + PASS +
" listnodes -o dNi -r " + "\"" + DOMAIN + "\"";

var oExec = WshShell.Exec(querycmd);
while (!oExec.StdOut.AtEndOfStream) {
  var str = oExec.StdOut.ReadLine();
  var node = str.split("\t");

  var propcmd = "sysorb-tool -s " + SERVER + " -p " + PORT +" -d " + DOMAIN +
" -l " + USER + " -P " + PASS +
" listproperties " + "\"" + node[0] + "\"," + node[1] + " alertGroup";

  lExec = WshShell.Exec(propcmd);
  var res = lExec.StdOut.ReadLine();
  if (res.indexOf("NULL") != -1) {
    WScript.echo(node[1]);
  }
}