Package org.netxms.client.ai
Class AiOperatorCheck
java.lang.Object
org.netxms.client.ai.AiOperatorCheck
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 Summary
ConstructorsConstructorDescriptionAiOperatorCheck(int instanceId, String name) Create new standing check definition with default settings (for subsequent creation on server).AiOperatorCheck(NXCPMessage msg, long baseId) Create standing check object from NXCP message. -
Method Summary
Modifier and TypeMethodDescriptionvoidfillMessage(NXCPMessage msg) Fill NXCP message with configuration data for create/modify request.intintintgetId()intintgetName()longintintbooleanbooleanbooleanisLocked()voidsetAction(AiCheckAction action) voidsetCooldown(int cooldown) voidsetDescription(String description) voidsetEnabled(boolean enabled) voidsetInterval(int interval) voidsetLocked(boolean locked) voidvoidsetObjectId(long objectId) voidsetRenotifyInterval(int renotifyInterval) void
-
Constructor Details
-
AiOperatorCheck
Create new standing check definition with default settings (for subsequent creation on server).- Parameters:
instanceId- owning AI operator instance IDname- check name
-
AiOperatorCheck
Create standing check object from NXCP message.- Parameters:
msg- NXCP messagebaseId- base ID for fields
-
-
Method Details
-
fillMessage
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
- Returns:
- the name
-
setName
- Parameters:
name- the name to set
-
getDescription
- Returns:
- the description
-
setDescription
- 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
- Returns:
- NXSL source code
-
setSource
- 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
- Returns:
- action applied when the check fires
-
setAction
- 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
- Returns:
- time of the last run (null if never run)
-
getLastVerdict
- Returns:
- verdict of the last run
-
getLastFire
- Returns:
- time the check last fired (null if never)
-
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
- Returns:
- the creationTime
-
getModificationTime
- Returns:
- the modificationTime
-
getCompileError
- Returns:
- compilation diagnostic if the stored source no longer compiles (empty otherwise)
-