aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2018-10-19 02:19:24 +0200
committernico <nico@magicbroccoli.de>2018-10-19 02:19:24 +0200
commit8211c0809f64cce4ccea7e44b501c524aea51980 (patch)
tree45a8757722e0121c9080585a893e7c569c9ba4fd
parent6dc39c0a80de3c15451461eba8d2ad72bab834d3 (diff)
Readme and Code Quality
+ added Readme * remove try statement for if condition
-rw-r--r--README.md34
-rwxr-xr-xteamspeak-multi.py4
2 files changed, 36 insertions, 2 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..40c57ee
--- /dev/null
+++ b/README.md
@@ -0,0 +1,34 @@
+# TeamSpeak 3 Munin Multigraph Plugin
+This repository features a basic [TeamSpeak3](https://www.teamspeak.de/) Munin Plugin, which gathers information from the TeamSpeak Telnet.
+
+There are drawbacks to using a multigraph plugin which can be read up here : [Munin-Monitoring.org](http://guide.munin-monitoring.org/en/latest/plugin/multigraphing.html)
+
+## install
+To use these plugin properly some configuration parameters are required to be present inside the plugin-config `/etc/munin/plugin-config.d/munin-node`.
+```
+[teamspeak*]
+username = username
+password = password
+# host and port are not required if the default values are true for your setup
+host = localhost
+port = 10011
+```
+To install these plugins, you just have to symlink those plugins you would like to activate to the munin plugin directory eg. `/etc/munin/plugins/`. Or if you want to use the multigraph plugin only symlink that one the the munin plugin directory.
+
+After this has been done the munin-node needs to be restarted to facilitate the new plugins.
+`systemctl restart munin-node`
+
+##### is everything working correctly
+To check if the plugin is working correctly it is necessary to first instruct the capability multigraph before the `list` instruction.
+```
+telnet localhost 4949 # localhost or IP the munin-node
+cap multigraph
+list
+fetch nextcloud_multi
+```
+The `list` command will return a list of all plugins currently active. This list should feature the newly activated
+teamspeak plugin.
+The `fetch` commands will run the script and return the gathered values. As long as none of them are NaN everything works as expected.
+
+### uninstall
+To remove the plugins from munin remove all symlinked plugins from the directory and restart the node.
diff --git a/teamspeak-multi.py b/teamspeak-multi.py
index e38d6cf..85cdae2 100755
--- a/teamspeak-multi.py
+++ b/teamspeak-multi.py
@@ -149,7 +149,7 @@ class TeamspeakMulti:
def main(self):
# check if first argument is config or autoconf if not fetch data
- try:
+ if sys.argv.__len__() >= 2:
if sys.argv[1] == "config":
for key in self.config().keys():
print('\n'.join(self.config()[key]))
@@ -160,7 +160,7 @@ class TeamspeakMulti:
print('yes')
else:
print('env variables are missing')
- except IndexError:
+ else:
self.run()