Documentation

Documentation.Interface-StatusReport-3-3 History

Hide minor edits - Show changes to output

July 14, 2022, at 12:59 PM by 109.99.227.30 -
Changed line 43 from:
to:
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#sr_list_identifiers|sr_list_identifiers]]
February 10, 2022, at 04:52 PM by 109.99.227.30 -
Changed lines 40-42 from:
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc9|sr_get_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc10|sr_list_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc11|sr_list_reports]]
to:
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#sr_get_status|sr_get_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#sr_list_status|sr_list_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#sr_list_reports|sr_list_reports]]
February 10, 2022, at 04:41 PM by 109.99.227.30 -
Added lines 43-50:


----
[[#code_identifiers]]
!!!! Events

The SR framework raises an event each time the status of a Status/Report identifier changes. See the [[https://www.opensips.org/Documentation/Interface-CoreEvents-3-3#E_CORE_SR_STATUS_CHANGED|E_CORE_SR_STATUS_CHANGED event]] for more details.
February 10, 2022, at 04:02 PM by 109.99.227.30 -
Added lines 1-66:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-3-3|Manual 3.3]] -> Status/Report Interface
(:title Management Interface - 3.3:)
----
(:allVersions Interface-MI 3.3 :)

\\

|| %color=#185662%[+'''Status/Report Interface v3.3 '''+]%% ||

||[[Interface-CoreStatistics-3-3|Prev]] || [[Interface-Binary-3-3|Next]]||
----


The '''Status/Report''' (or '''SR''') is an OpenSIPS framework that allows different components of OpenSIPS (like modules, parts of the core) to publish their status (in terms of readiness) and reports (logs) relevant to their activities. \\
This framework is intended to be used in operational activities, to check the readiness of OpenSIPS when starting up, to monitor its status at runtime and to trace back its operations via the logs/reports.

!!!! Overview

The base element in the '''Status/Report''' framework is the ''identifier'' - an status and some reports may be attached to an identifier. All the identifiers do exist within a '''Status/Report''' group. So, a group is a set of identifiers - a module or a core may be such groups. For example the ''drouting'' module publishes the ''drouting'' group where each routing partition is an ''identifier''. \\
As there are cases where the group (the modules) do not need multiple identifiers, there is a default ''main'' identifier - such identifier may be referred only by the name of the group.

The information attached to an identifier is:
* '''status''' as integer value, translating if the identifier is ready for operation or not; a strict negative value means not-ready, while a strict positive value means it is ready; a zero value is not accepted.
* '''status details''' is a optional text to the status, providing some human friendly (or details) information in regards to the current status.
* '''reports''' is a fix-size array (rather a queue discarding the oldest records) of logs produced by the identifier. Each report/log is produced with a timestamp also.

I most of the cases, the status and reports of an identifier are internally produced by the OpenSIPS code - the '''Status/Report''' interface just gives you access to the status / report information from outside the code, for monitoring purposes.

----
[[#scripting]]
!!!! Scripting functions

The SR Interface provides a script function to check the readiness status of an identifier (or of an entire group), see the [[https://www.opensips.org/Documentation/Script-CoreFunctions-3-3#sr_check_status|sr_check_status( group, [identifier])]] function.

----
[[#mi]]
!!!! MI functions

The SR Interface provides multiple functions to check/list the status of one/multiple identifiers and to list their reports:
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc9|sr_get_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc10|sr_list_status]]
* [[https://www.opensips.org/Documentation/Interface-CoreMI-3-3#toc11|sr_list_reports]]

----
[[#code_identifiers]]
!!!! Core identifiers

The OpenSIPS core provides the '''core''' group, with a "main" (default) identifier. The available status are:
* STATE_NONE (-100) - OpenSIPS just started
* STATE_TERMINATING (-2) - OpenSIPS is shutdown sequence
* STATE_INITIALIZING (-1) - OpenSIPS in startup sequence
* STATE_RUNNING (1) - OpenSIPS fully up and running

----
[[#module_identifiers]]
!!!! Modules identifiers

The OpenSIPS modules may or may not provide their own groups and identifiers. For this you need to check the module's documentation.

----
[[#scripting_identifiers]]
!!!! Scripting identifiers

The [[https://opensips.org/docs/modules/3.3.x/status_report.html|status_report]] allow the creation of custom SR identifiers from script level. Even more, it is possible to set the status or to publish a report from script for such custom identifiers.


Page last modified on July 14, 2022, at 12:59 PM