| 1 | <!--startmeta |
| 2 | custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/opensips/README.md" |
| 3 | meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/opensips/metadata.yaml" |
| 4 | sidebar_label: "OpenSIPS" |
| 5 | learn_status: "Published" |
| 6 | learn_rel_path: "Collecting Metrics/Collectors/Applications" |
| 7 | keywords: ['opensips', 'sip', 'voice', 'video', 'stream'] |
| 8 | message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" |
| 9 | endmeta--> |
| 10 | |
| 11 | # OpenSIPS |
| 12 | |
| 13 | |
| 14 | <img src="https://netdata.cloud/img/opensips.png" width="150"/> |
| 15 | |
| 16 | |
| 17 | Plugin: charts.d.plugin |
| 18 | Module: opensips |
| 19 | |
| 20 | <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> |
| 21 | |
| 22 | ## Overview |
| 23 | |
| 24 | Examine OpenSIPS metrics for insights into SIP server operations. Study call rates, error rates, and response times for reliable voice over IP services. |
| 25 | |
| 26 | The collector uses the `opensipsctl` command line utility to gather OpenSIPS metrics. |
| 27 | |
| 28 | This collector is supported on all platforms. |
| 29 | |
| 30 | This collector supports collecting metrics from multiple instances of this integration, including remote instances. |
| 31 | |
| 32 | |
| 33 | ### Default Behavior |
| 34 | |
| 35 | #### Auto-Detection |
| 36 | |
| 37 | The collector will attempt to call `opensipsctl` along with a default number of parameters, even without any configuration. |
| 38 | |
| 39 | #### Limits |
| 40 | |
| 41 | The default configuration for this integration does not impose any limits on data collection. |
| 42 | |
| 43 | #### Performance Impact |
| 44 | |
| 45 | The default configuration for this integration is not expected to impose a significant performance impact on the system. |
| 46 | |
| 47 | ## Setup |
| 48 | |
| 49 | |
| 50 | ### Prerequisites |
| 51 | |
| 52 | #### Install charts.d plugin |
| 53 | |
| 54 | If [using our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed. |
| 55 | |
| 56 | |
| 57 | #### Required software |
| 58 | |
| 59 | The collector requires the `opensipsctl` to be installed. |
| 60 | |
| 61 | |
| 62 | ### Configuration |
| 63 | |
| 64 | #### Options |
| 65 | |
| 66 | The config file is sourced by the charts.d plugin. It's a standard bash file. |
| 67 | |
| 68 | The following collapsed table contains all the options that can be configured for the opensips collector. |
| 69 | |
| 70 | |
| 71 | <details open><summary>Config options</summary> |
| 72 | |
| 73 | |
| 74 | |
| 75 | | Option | Description | Default | Required | |
| 76 | |:-----|:------------|:--------|:---------:| |
| 77 | | opensips_opts | Specify parameters to the `opensipsctl` command. If the default value fails to get global status, set here whatever options are needed to connect to the opensips server. | fifo get_statistics all | no | |
| 78 | | opensips_cmd | If `opensipsctl` is not in $PATH, specify it's full path here. | | no | |
| 79 | | opensips_timeout | How long to wait for `opensipsctl` to respond. | 2 | no | |
| 80 | | opensips_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 5 | no | |
| 81 | | opensips_priority | The charts priority on the dashboard. | 80000 | no | |
| 82 | | opensips_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no | |
| 83 | |
| 84 | |
| 85 | </details> |
| 86 | |
| 87 | |
| 88 | |
| 89 | #### via File |
| 90 | |
| 91 | The configuration file name for this integration is `charts.d/opensips.conf`. |
| 92 | |
| 93 | The file format is POSIX shell script. Generally, the structure is: |
| 94 | |
| 95 | ```sh |
| 96 | OPTION_1="some value" |
| 97 | OPTION_2="some other value" |
| 98 | ``` |
| 99 | You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the |
| 100 | Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory). |
| 101 | |
| 102 | ```bash |
| 103 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 104 | sudo ./edit-config charts.d/opensips.conf |
| 105 | ``` |
| 106 | |
| 107 | ##### Examples |
| 108 | |
| 109 | ###### Custom `opensipsctl` command |
| 110 | |
| 111 | Set a custom path to the `opensipsctl` command |
| 112 | |
| 113 | ```yaml |
| 114 | #opensips_opts="fifo get_statistics all" |
| 115 | opensips_cmd=/opt/opensips/bin/opensipsctl |
| 116 | #opensips_timeout=2 |
| 117 | |
| 118 | # the data collection frequency |
| 119 | # if unset, will inherit the netdata update frequency |
| 120 | #opensips_update_every=5 |
| 121 | |
| 122 | # the charts priority on the dashboard |
| 123 | #opensips_priority=80000 |
| 124 | |
| 125 | # the number of retries to do in case of failure |
| 126 | # before disabling the module |
| 127 | #opensips_retries=10 |
| 128 | |
| 129 | ``` |
| 130 | |
| 131 | |
| 132 | ## Alerts |
| 133 | |
| 134 | There are no alerts configured by default for this integration. |
| 135 | |
| 136 | |
| 137 | ## Metrics |
| 138 | |
| 139 | Metrics grouped by *scope*. |
| 140 | |
| 141 | The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. |
| 142 | |
| 143 | |
| 144 | |
| 145 | ### Per OpenSIPS instance |
| 146 | |
| 147 | These metrics refer to the entire monitored application. |
| 148 | |
| 149 | This scope has no labels. |
| 150 | |
| 151 | Metrics: |
| 152 | |
| 153 | | Metric | Dimensions | Unit | |
| 154 | |:------|:----------|:----| |
| 155 | | opensips.dialogs_active | active, early | dialogs | |
| 156 | | opensips.users | registered, location, contacts, expires | users | |
| 157 | | opensips.registrar | accepted, rejected | registrations/s | |
| 158 | | opensips.transactions | UAS, UAC | transactions/s | |
| 159 | | opensips.core_rcv | requests, replies | queries/s | |
| 160 | | opensips.core_fwd | requests, replies | queries/s | |
| 161 | | opensips.core_drop | requests, replies | queries/s | |
| 162 | | opensips.core_err | requests, replies | queries/s | |
| 163 | | opensips.core_bad | bad_URIs_rcvd, unsupported_methods, bad_msg_hdr | queries/s | |
| 164 | | opensips.tm_replies | received, relayed, local | replies/s | |
| 165 | | opensips.transactions_status | 2xx, 3xx, 4xx, 5xx, 6xx | transactions/s | |
| 166 | | opensips.transactions_inuse | inuse | transactions | |
| 167 | | opensips.sl_replies | 1xx, 2xx, 3xx, 4xx, 5xx, 6xx, sent, error, ACKed | replies/s | |
| 168 | | opensips.dialogs | processed, expire, failed | dialogs/s | |
| 169 | | opensips.net_waiting | UDP, TCP | kilobytes | |
| 170 | | opensips.uri_checks | positive, negative | checks / sec | |
| 171 | | opensips.traces | requests, replies | traces / sec | |
| 172 | | opensips.shmem | total, used, real_used, max_used, free | kilobytes | |
| 173 | | opensips.shmem_fragment | fragments | fragments | |
| 174 | |
| 175 | |
| 176 | |
| 177 | ## Troubleshooting |
| 178 | |
| 179 | ### Debug Mode |
| 180 | |
| 181 | |
| 182 | To troubleshoot issues with the `opensips` collector, run the `charts.d.plugin` with the debug option enabled. The output |
| 183 | should give you clues as to why the collector isn't working. |
| 184 | |
| 185 | - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on |
| 186 | your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. |
| 187 | |
| 188 | ```bash |
| 189 | cd /usr/libexec/netdata/plugins.d/ |
| 190 | ``` |
| 191 | |
| 192 | - Switch to the `netdata` user. |
| 193 | |
| 194 | ```bash |
| 195 | sudo -u netdata -s |
| 196 | ``` |
| 197 | |
| 198 | - Run the `charts.d.plugin` to debug the collector: |
| 199 | |
| 200 | ```bash |
| 201 | ./charts.d.plugin debug 1 opensips |
| 202 | ``` |
| 203 | |
| 204 | ### Getting Logs |
| 205 | |
| 206 | If you're encountering problems with the `opensips` collector, follow these steps to retrieve logs and identify potential issues: |
| 207 | |
| 208 | - **Run the command** specific to your system (systemd, non-systemd, or Docker container). |
| 209 | - **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. |
| 210 | |
| 211 | #### System with systemd |
| 212 | |
| 213 | Use the following command to view logs generated since the last Netdata service restart: |
| 214 | |
| 215 | ```bash |
| 216 | journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep opensips |
| 217 | ``` |
| 218 | |
| 219 | #### System without systemd |
| 220 | |
| 221 | Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: |
| 222 | |
| 223 | ```bash |
| 224 | grep opensips /var/log/netdata/collector.log |
| 225 | ``` |
| 226 | |
| 227 | **Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. |
| 228 | |
| 229 | #### Docker Container |
| 230 | |
| 231 | If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: |
| 232 | |
| 233 | ```bash |
| 234 | docker logs netdata 2>&1 | grep opensips |
| 235 | ``` |
| 236 | |
| 237 |