| 1 | = SMS Server Tools modem statistics = |
---|
| 2 | |
---|
| 3 | == About == |
---|
| 4 | The [source:smstools_] plugin allows the [http://munin.projects.linpro.no/ munin] monitor to graph modem statistics of the [http://smstools3.kekekasvi.com/ SMS Server Tools] SMS server. The smstools_ plugin specifically charts the following values: |
---|
| 5 | |
---|
| 6 | * Number of rejected SMS |
---|
| 7 | * Number of sucessfully sent messages |
---|
| 8 | * Number of sending failures |
---|
| 9 | * Number of received short messages |
---|
| 10 | * Number of consecutive failures while sending short messages. |
---|
| 11 | |
---|
| 12 | The plugin works by parsing the statistics file generated by the smsd. |
---|
| 13 | |
---|
| 14 | == Screenshot == |
---|
| 15 | [[Image(Images:smstools_GSM1-day.png, nolink)]] |
---|
| 16 | |
---|
| 17 | == Download == |
---|
| 18 | [https://trac.bawue.org/munin/browser/smstools_?format=txt smstools_] |
---|
| 19 | |
---|
| 20 | == Installation == |
---|
| 21 | 1. Copy or link the smstools_ script into your munin-node plugin directory, usually {{{/etc/munin/plugins}}}. This is a wildcard plugin, meaning that depending on the filename of the plugin, different modems are graphed.[BR] |
---|
| 22 | If you have one GSM modem connected to your system you want to chart, create the copy of this script as smstools_''MODEMAME'', e.g. {{{smstools_GSM1}}}. |
---|
| 23 | 1. Configure the smsd to actually write a statistics file every 5 minutes. This is achieved by adding the following to the smsd.conf file, usually located in /etc: |
---|
| 24 | {{{ |
---|
| 25 | stats = /var/log/smsd_stats |
---|
| 26 | stats_interval = 300 |
---|
| 27 | }}} |
---|
| 28 | Make sure, the configured directory exists. |
---|
| 29 | 1. Configure the munin-node to run the smstools_ plugin as user root or another user able to read the statistics file: |
---|
| 30 | {{{ |
---|
| 31 | [smstools_*] |
---|
| 32 | user root |
---|
| 33 | }}} |
---|
| 34 | 1. Configure the munin-node to pass the directory smsd is writing it's statistics file as ''statsdir'': |
---|
| 35 | {{{ |
---|
| 36 | [smstools_*] |
---|
| 37 | user root |
---|
| 38 | env.statsdir /var/log/smsd_stats |
---|
| 39 | }}} |
---|
| 40 | 1. The SMS daemon is writing a new timestamped file every 5 minutes. To prevent your disk from filling up, the smstools_ plugin can delete the statistics file after reading. To enable this, pass the environment variable ''cleanup'' set to ''true'': |
---|
| 41 | {{{ |
---|
| 42 | [smstools_*] |
---|
| 43 | user root |
---|
| 44 | env.statsdir /var/log/smsd_stats |
---|
| 45 | env.cleanup true |
---|
| 46 | }}} |
---|
| 47 | 1. Test the plugin by calling {{{munin-run smstools_GSM1 config}}} and by executing {{{munin-run smstools_GSM1}}}. Both commands should output sensible data without failing. |
---|
| 48 | 1. Restart the munin-node process. |
---|
| 49 | |
---|
| 50 | == Notes == |
---|
| 51 | * Due to the 5min wait time between sampling, the measurement can be somewhat inaccurate. Only established connections during the munin run will be counted. Short-term connections between two runs will not be detected. |
---|
| 52 | * Passing the cleanup variable set to true is highly advisable to prevent your disk from filling up with stale data. |
---|
| 53 | |
---|
| 54 | == License == |
---|
| 55 | The code is available as free software under the [wiki:GPL2 GPL Version 2]. |
---|
| 56 | |
---|
| 57 | == Bugs and Contact == |
---|
| 58 | In case of bugs, please either [https://trac.bawue.org/munin/newticket open a ticket] in this Trac instance or write to <andreas (at) bawue (dot) net>. |