MIDServerCluster - Global

Finds the MID server clusters for a given MID server and reassigns the jobs if necessary.

If the MID server agent is up, this class gathers all MID servers (including the original agent) in the load balance clusters that the original agent is part of. If the MID server agent is down and the cluster is load balanced, the class gathers the other agents. If the server agent is down, and the cluster is failover, it gathers the next failover agent. The class then randomly returns the MID server in the final list of MID servers.

Use in server scripts to get MID server cluster information.

MIDServerCluster - clusterExists()

Determines if a cluster exists.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Boolean True if a cluster exists; otherwise, false.
var midgr = new GlideRecord("ecc_agent");
midgr.addQuery("name", "al1winmid");
midgr.query();
midgr.next();
 
var mscl = new MIDServerCluster(midgr);
gs.print(mscl.clusterExists());

Output: true

MIDServerCluster - getClusterAgent()

Gets the cluster agent.

Table 3. Parameters
Name Type Description
None
Table 4. Returns
Type Description
String The agent name
// Assuming "mid1" and "mid2" are in a cluster
var midgr = new GlideRecord("ecc_agent");
midgr.addQuery("name", "mid1");
midgr.query();
midgr.next();
 
var mscl = new MIDServerCluster(midgr);
gs.print(mscl.getClusterAgent());

Output: mid2

MIDServerCluster - MIDServerCluster(GlideRecord agent)

Brief description of the method.

Table 5. Parameters
Name Type Description
agent GlideRecord The MID server agent
Table 6. Returns
Type Description
void