Retrieve Janus port's statistics into string
Note: Many $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $JpStat function.
This function allows retrieval of a specific Janus port into a string.
The $JpStat function accepts two arguments and returns a string made up of an error code, the port name, and returned statistics.
%string = $JpStat(statList, portName)
|%string||A string that might be a combination of binary and character string data. For details, see the "Usage notes," below.|
|statList||A string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of four bytes. This facilitates the use of $StatD with the returned string. For more information about available statistics, see the SirMon M204wiki pages.|
|portName||The Janus port name for which data is to be returned.|
-5 Required parameter not specified -12 Invalid parameter -14 Result string would be longer than 255 bytes
The data returned by $JpStat is a string that might be a combination of binary and character string data:
- If exactly four bytes are returned, the bytes contain a binary number that is an error code; these are described above. Otherwise, the first four bytes contain the unsigned binary number of milliseconds since the Online region was brought up. This provides a convenient number for calculating rates for the statistics.
- The next 30 bytes (that is, starting at byte number 5) contain the port name.
- The next 2 bytes (that is, starting at byte number 35) contain the binary number 1.
- The port name is followed by the result statistics, starting at byte number 37. Statistics that have string values are returned as eight bytes, left justified, blank filled. Numeric statistics are returned as four-byte binary values.
The following program displays some totals for the port named
B %data is string len 255 %data = $jpStat('ACTIVE STATUS', 'DATA.INFO') if $len(%data) = 4 then print '$jpStat error... rc = ' with $unbin(%data) stop end if print 'Name = ' with $substr(%data, 5, 30) print 'Active = ' with $unbin( $substr(%data, 5 + 32, 4) ) print 'Status = ' with $substr(%data, 5 + 32 + 4, 8) end