| 1 | <!--startmeta |
| 2 | custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/health/notifications/kavenegar/README.md" |
| 3 | meta_yaml: "https://github.com/netdata/netdata/edit/master/src/health/notifications/kavenegar/metadata.yaml" |
| 4 | sidebar_label: "Kavenegar" |
| 5 | learn_status: "Published" |
| 6 | learn_rel_path: "Alerts & Notifications/Notifications/Agent Dispatched Notifications" |
| 7 | keywords: ['Kavenegar'] |
| 8 | message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE" |
| 9 | endmeta--> |
| 10 | |
| 11 | # Kavenegar |
| 12 | |
| 13 | |
| 14 | <img src="https://netdata.cloud/img/kavenegar.png" width="150"/> |
| 15 | |
| 16 | |
| 17 | [Kavenegar](https://kavenegar.com/) as service for software developers, based in Iran, provides send and receive SMS, calling voice by using its APIs. |
| 18 | You can send notifications to Kavenegar using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more. |
| 19 | |
| 20 | |
| 21 | <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> |
| 22 | |
| 23 | ## Setup |
| 24 | |
| 25 | |
| 26 | ### Prerequisites |
| 27 | |
| 28 | #### |
| 29 | |
| 30 | - The APIKEY and Sender from http://panel.kavenegar.com/client/setting/account |
| 31 | - Access to the terminal where Netdata Agent is running |
| 32 | |
| 33 | |
| 34 | |
| 35 | ### Configuration |
| 36 | |
| 37 | #### Options |
| 38 | |
| 39 | The following options can be defined for this notification |
| 40 | |
| 41 | <details open><summary>Config Options</summary> |
| 42 | |
| 43 | |
| 44 | |
| 45 | | Option | Description | Default | Required | |
| 46 | |:-----|:------------|:--------|:---------:| |
| 47 | | SEND_KAVENEGAR | Set `SEND_KAVENEGAR` to YES | YES | yes | |
| 48 | | KAVENEGAR_API_KEY | Set `KAVENEGAR_API_KEY` to your API key. | | yes | |
| 49 | | KAVENEGAR_SENDER | Set `KAVENEGAR_SENDER` to the value of your Sender. | | yes | |
| 50 | | [DEFAULT_RECIPIENT_KAVENEGAR](#option-default-recipient-kavenegar) | Set `DEFAULT_RECIPIENT_KAVENEGAR` to the SMS recipient you want the alert notifications to be sent to. You can define multiple recipients like this: 09155555555 09177777777. | | yes | |
| 51 | |
| 52 | <a id="option-default-recipient-kavenegar"></a> |
| 53 | ##### DEFAULT_RECIPIENT_KAVENEGAR |
| 54 | |
| 55 | All roles will default to this variable if lest unconfigured. |
| 56 | |
| 57 | You can then have different SMS recipients per role, by editing `DEFAULT_RECIPIENT_KAVENEGAR` with the SMS recipients you want, in the following entries at the bottom of the same file: |
| 58 | ```text |
| 59 | role_recipients_kavenegar[sysadmin]="09100000000" |
| 60 | role_recipients_kavenegar[domainadmin]="09111111111" |
| 61 | role_recipients_kavenegar[dba]="0922222222" |
| 62 | role_recipients_kavenegar[webmaster]="0933333333" |
| 63 | role_recipients_kavenegar[proxyadmin]="0944444444" |
| 64 | role_recipients_kavenegar[sitemgr]="0955555555" |
| 65 | ``` |
| 66 | |
| 67 | The values you provide should be defined as environments in `/etc/alertad.conf` with `ALLOWED_ENVIRONMENTS` option. |
| 68 | |
| 69 | |
| 70 | |
| 71 | </details> |
| 72 | |
| 73 | |
| 74 | |
| 75 | #### via File |
| 76 | |
| 77 | The configuration file name for this integration is `health_alarm_notify.conf`. |
| 78 | |
| 79 | |
| 80 | 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 |
| 81 | Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory). |
| 82 | |
| 83 | ```bash |
| 84 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 85 | sudo ./edit-config health_alarm_notify.conf |
| 86 | ``` |
| 87 | |
| 88 | ##### Examples |
| 89 | |
| 90 | ###### Basic Configuration |
| 91 | |
| 92 | |
| 93 | |
| 94 | ```yaml |
| 95 | #------------------------------------------------------------------------------ |
| 96 | # Kavenegar (Kavenegar.com) SMS options |
| 97 | |
| 98 | SEND_KAVENEGAR="YES" |
| 99 | KAVENEGAR_API_KEY="XXXXXXXXXXXX" |
| 100 | KAVENEGAR_SENDER="YYYYYYYY" |
| 101 | DEFAULT_RECIPIENT_KAVENEGAR="0912345678" |
| 102 | |
| 103 | ``` |
| 104 | |
| 105 | |
| 106 | ## Troubleshooting |
| 107 | |
| 108 | ### Test Notification |
| 109 | |
| 110 | You can run the following command by hand, to test alerts configuration: |
| 111 | |
| 112 | ```bash |
| 113 | # become user netdata |
| 114 | sudo su -s /bin/bash netdata |
| 115 | |
| 116 | # enable debugging info on the console |
| 117 | export NETDATA_ALARM_NOTIFY_DEBUG=1 |
| 118 | |
| 119 | # send test alarms to sysadmin |
| 120 | /usr/libexec/netdata/plugins.d/alarm-notify.sh test |
| 121 | |
| 122 | # send test alarms to any role |
| 123 | /usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE" |
| 124 | ``` |
| 125 | |
| 126 | Note that this will test _all_ alert mechanisms for the selected role. |
| 127 | |
| 128 |