PMON Crash Actions Script

PMON searches for a "crash actions" CTRL script called "pmonActions" (either .ctl or .ctc) and will start it on PMON startup.

The previously used shell/batchfile will still be used.

PMON will trigger system events called "pmon", which a user can sysConnect() to.

Anmerkung: Note that this new "pmon" event is only available in a script running inside the PMON. Other managers cannot create a "pmon" event.
main()
{
  sysConnect("callback", "pmon"); // The event is "pmon"
}

callback(string event, mapping data)
{
  DebugN(event, data);

  if ( data.contains("idx") )
  {
    int idx = data["idx"];
    DebugN(pmonGetName(idx), pmonGetNum(idx), pmonGetOptions(idx));
  }
}

The callback function has the arguments:

callback(string event, mapping data)

Tabelle 1.
Parameter Description
event The event is "pmon".
data Data has the following entries, where the keys are always of type string:

"type" ... the type of event.

This can be either "logFileChanged" when a log file reached its max.size or one of the strings for the crashAction script in Monitoring of managers, e.g. RESTART_ALL etc.

When the "type" is "logFileChanged" there will also be two mapping entries:

"oldName" and "newName" passing the logfile names before and after the switch of the file.

In all other cases the mapping will contain the "idx" key which passes the index of the manager which can then be used for all the pmonGet* functions in CTRL, pmonGetPID(idx), pmonGetName(idx), etc.

Anmerkung:

Note that PMON is not a manager, e.g. it has no connection to DATA or EVENT manager and therefore cannot act on datapoints. PMON does not recognize any DP or manager related functions (e.g. dpSet() etc. and calling them will lead to "function not defined" errors).