num_consoles()
Return the number of consoles registered to the PATROL Agent or that use the PSL script.
Syntax
Parameter
Parameter | Definition |
---|---|
ALL | optional flag that returns the number of consoles registered with the PATROL Agent. If the ALL flag is omitted, the num_consoles() function returns the number of PATROL Consoles that use the PSL script. |
Description
The num_consoles() function returns a integer representing the number of PATROL Consoles that:
- are registered with the PATROL Agent ( ALL argument)
- use the script in which the num_consoles() function appears (no argument)
The value that the num_consoles() function returns when ALL is omitted can be any positive integer from 0 to the number obtained from the num_consoles(ALL) function, that is, the total number of consoles registered with the PATROL Agent.
The num_consoles() function (no ALL argument) always returns 1 when the PSL script is used as a menu command.
Example
The following example uses the num_consoles() function to return the number of consoles connected to the PATROL Agent, and the number of consoles connected to the PATROL Agent that are running the example script:
scriptrunner = num_consoles();
print("Number of Consoles connected to this Agent : ",connect,"\n");
print("Number of Consoles executing this script : ",scriptrunner,"\n");