Class AiOperatorCheck

java.lang.Object
org.netxms.client.ai.AiOperatorCheck

public class AiOperatorCheck extends Object
Standing check of an AI operator instance - NXSL script run by the server on schedule without LLM involvement. Configuration fields have setters; run state fields are read-only.
  • Constructor Details

    • AiOperatorCheck

      public AiOperatorCheck(int instanceId, String name)
      Create new standing check definition with default settings (for subsequent creation on server).
      Parameters:
      instanceId - owning AI operator instance ID
      name - check name
    • AiOperatorCheck

      public AiOperatorCheck(NXCPMessage msg, long baseId)
      Create standing check object from NXCP message.
      Parameters:
      msg - NXCP message
      baseId - base ID for fields
  • Method Details

    • fillMessage

      public void fillMessage(NXCPMessage msg)
      Fill NXCP message with configuration data for create/modify request.
      Parameters:
      msg - NXCP message
    • getId

      public int getId()
      Returns:
      the id
    • getInstanceId

      public int getInstanceId()
      Returns:
      owning AI operator instance ID
    • getName

      public String getName()
      Returns:
      the name
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
    • getDescription

      public String getDescription()
      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Parameters:
      description - the description to set
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if the check is scheduled
    • setEnabled

      public void setEnabled(boolean enabled)
      Parameters:
      enabled - true to schedule the check
    • isLocked

      public boolean isLocked()
      Returns:
      true if the check is locked against modification by the operator
    • setLocked

      public void setLocked(boolean locked)
      Parameters:
      locked - true to lock the check against modification by the operator
    • isCreatedByModel

      public boolean isCreatedByModel()
      Returns:
      true if the check was created by the operator itself
    • getSource

      public String getSource()
      Returns:
      NXSL source code
    • setSource

      public void setSource(String source)
      Parameters:
      source - NXSL source code to set
    • getInterval

      public int getInterval()
      Returns:
      run interval in seconds
    • setInterval

      public void setInterval(int interval)
      Parameters:
      interval - run interval in seconds (minimum 30)
    • getObjectId

      public long getObjectId()
      Returns:
      ID of object bound as $object (0 = none)
    • setObjectId

      public void setObjectId(long objectId)
      Parameters:
      objectId - ID of object to bind as $object (0 = none)
    • getAction

      public AiCheckAction getAction()
      Returns:
      action applied when the check fires
    • setAction

      public void setAction(AiCheckAction action)
      Parameters:
      action - action to apply when the check fires
    • getCooldown

      public int getCooldown()
      Returns:
      minimum seconds between two action applications
    • setCooldown

      public void setCooldown(int cooldown)
      Parameters:
      cooldown - minimum seconds between two action applications
    • getRenotifyInterval

      public int getRenotifyInterval()
      Returns:
      seconds after which the action is applied again while the check stays fired (0 = edge only)
    • setRenotifyInterval

      public void setRenotifyInterval(int renotifyInterval)
      Parameters:
      renotifyInterval - seconds after which the action is applied again while the check stays fired (0 = edge only)
    • getLastRun

      public Date getLastRun()
      Returns:
      time of the last run (null if never run)
    • getLastVerdict

      public AiCheckVerdict getLastVerdict()
      Returns:
      verdict of the last run
    • getLastFire

      public Date getLastFire()
      Returns:
      time the check last fired (null if never)
    • getLastPayload

      public String getLastPayload()
      Returns:
      JSON payload of the last fired run (title, severity, details) or error of the last failed run
    • getConsecutiveErrors

      public int getConsecutiveErrors()
      Returns:
      number of consecutive failed runs
    • getRunCount

      public int getRunCount()
      Returns:
      total number of runs
    • getCreationTime

      public Date getCreationTime()
      Returns:
      the creationTime
    • getModificationTime

      public Date getModificationTime()
      Returns:
      the modificationTime
    • getCompileError

      public String getCompileError()
      Returns:
      compilation diagnostic if the stored source no longer compiles (empty otherwise)