> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSStatusMonitor

> Definition of all properties for a status monitor.

Definition of all properties for a status monitor.

## Constructors

### NSStatusMonitor()

```crmscript theme={null}
NSStatusMonitor
```

Initializes a new instance of the NSStatusMonitor class.

## Methods

## GetDefaultTask()

```crmscript theme={null}
Integer GetDefaultTask()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Default task type for this status.

<Note>
  The default task text is in the text table (since it can be long), and may contain template variables
</Note>

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer defaultTask = thing.GetDefaultTask();
```

## GetDefaultTaskText()

```crmscript theme={null}
String GetDefaultTaskText()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Default task text for this status.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String defaultTaskText = thing.GetDefaultTaskText();
```

## GetDeleted()

```crmscript theme={null}
Bool GetDeleted()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Deleted flag, 1 if this record is deleted (never from the database).

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool deleted = thing.GetDeleted();
```

## GetDescription()

```crmscript theme={null}
String GetDescription()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Description of the status monitor.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String description = thing.GetDescription();
```

## GetGenerationStart()

```crmscript theme={null}
DateTime GetGenerationStart()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When was the last regeneration started.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
DateTime generationStart = thing.GetGenerationStart();
```

## GetIsVisual()

```crmscript theme={null}
Bool GetIsVisual()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Should the status be visualized (active) in the client.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool isVisual = thing.GetIsVisual();
```

## GetLastGenerated()

```crmscript theme={null}
DateTime GetLastGenerated()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - When was this status last generated (i.e., statusValue rows created).

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
DateTime lastGenerated = thing.GetLastGenerated();
```

## GetName()

```crmscript theme={null}
String GetName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of status monitor.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String name = thing.GetName();
```

## GetNeedsUpdate()

```crmscript theme={null}
Bool GetNeedsUpdate()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Is the definition dirty, ie., ALL values are invalid until a recalculation; this flag is set when the status DEFINITION is changed, as opposed to the flag on StatusValue.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool needsUpdate = thing.GetNeedsUpdate();
```

## GetNumMatches()

```crmscript theme={null}
Integer GetNumMatches()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of targets that have this status, this should be the number of rows in StatusValue pointing to this definition, and that have isSignalled set to 1

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer numMatches = thing.GetNumMatches();
```

## GetNumNeedUpdate()

```crmscript theme={null}
Integer GetNumNeedUpdate()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of targets that had this status, but have their needsUpdate bit set due to some change.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer numNeedUpdate = thing.GetNumNeedUpdate();
```

## GetOwnerTable()

```crmscript theme={null}
Integer GetOwnerTable()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of table that owns the status monitor.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer ownerTable = thing.GetOwnerTable();
```

## GetPictureId()

```crmscript theme={null}
Integer GetPictureId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of BinaryObject row that contains image for status monitor.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer pictureId = thing.GetPictureId();
```

## GetRank()

```crmscript theme={null}
Integer GetRank()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Priority rank, in case more than one status is signalled. Lowest wins.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer rank = thing.GetRank();
```

## GetStatusMonitorId()

```crmscript theme={null}
Integer GetStatusMonitorId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer statusMonitorId = thing.GetStatusMonitorId();
```

## SetDefaultTask(Integer)

```crmscript theme={null}
Void SetDefaultTask(Integer defaultTask)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  The default task text is in the text table (since it can be long), and may contain template variables
</Note>

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer defaultTask;
thing.SetDefaultTask(defaultTask);
```

## SetDefaultTaskText(String)

```crmscript theme={null}
Void SetDefaultTaskText(String defaultTaskText)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String defaultTaskText;
thing.SetDefaultTaskText(defaultTaskText);
```

## SetDeleted(Bool)

```crmscript theme={null}
Void SetDeleted(Bool deleted)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool deleted;
thing.SetDeleted(deleted);
```

## SetDescription(String)

```crmscript theme={null}
Void SetDescription(String description)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String description;
thing.SetDescription(description);
```

## SetGenerationStart(DateTime)

```crmscript theme={null}
Void SetGenerationStart(DateTime generationStart)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
DateTime generationStart;
thing.SetGenerationStart(generationStart);
```

## SetIsVisual(Bool)

```crmscript theme={null}
Void SetIsVisual(Bool isVisual)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool isVisual;
thing.SetIsVisual(isVisual);
```

## SetLastGenerated(DateTime)

```crmscript theme={null}
Void SetLastGenerated(DateTime lastGenerated)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
DateTime lastGenerated;
thing.SetLastGenerated(lastGenerated);
```

## SetName(String)

```crmscript theme={null}
Void SetName(String name)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
String name;
thing.SetName(name);
```

## SetNeedsUpdate(Bool)

```crmscript theme={null}
Void SetNeedsUpdate(Bool needsUpdate)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Bool needsUpdate;
thing.SetNeedsUpdate(needsUpdate);
```

## SetNumMatches(Integer)

```crmscript theme={null}
Void SetNumMatches(Integer numMatches)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer numMatches;
thing.SetNumMatches(numMatches);
```

## SetNumNeedUpdate(Integer)

```crmscript theme={null}
Void SetNumNeedUpdate(Integer numNeedUpdate)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer numNeedUpdate;
thing.SetNumNeedUpdate(numNeedUpdate);
```

## SetOwnerTable(Integer)

```crmscript theme={null}
Void SetOwnerTable(Integer ownerTable)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer ownerTable;
thing.SetOwnerTable(ownerTable);
```

## SetPictureId(Integer)

```crmscript theme={null}
Void SetPictureId(Integer pictureId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer pictureId;
thing.SetPictureId(pictureId);
```

## SetRank(Integer)

```crmscript theme={null}
Void SetRank(Integer rank)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer rank;
thing.SetRank(rank);
```

## SetStatusMonitorId(Integer)

```crmscript theme={null}
Void SetStatusMonitorId(Integer statusMonitorId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSStatusMonitor thing;
Integer statusMonitorId;
thing.SetStatusMonitorId(statusMonitorId);
```


## Related topics

- [NSSaintAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaintAgent.md)
- [NSStatusMonitorPeriods](/en/automation/crmscript/reference/CRMScript.NetServer.NSStatusMonitorPeriods.md)
- [Regenerate Status Monitor](/en/api/reference/restful/agent/saint_agent/regenerate-status-monitor.md)
- [Save Status Monitor](/en/api/reference/restful/agent/saint_agent/save-status-monitor.md)
- [Regenerate Status Monitors](/en/api/reference/restful/agent/saint_agent/regenerate-status-monitors.md)
- [Get Status Monitor](/en/api/reference/restful/agent/saint_agent/get-status-monitor.md)
