summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-08-20 17:49:09 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-08-20 17:49:09 -0400
commit801adc5df5b99ff9e9f3c06b1a155b36c4000359 (patch)
treeac6bbb49aaf0704884e091e2e7173e29c6cbd03b
parentdbd9fa35e5dd40d33d8be9c899f3d56918aba34f (diff)
add a README and license informationv20170820
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rw-r--r--README.md37
-rwxr-xr-xsystemd.py18
4 files changed, 59 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index eccf758..b59b70a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*.pyc
/systemd.conf
/collectd-*
+/LICENSE
.tmp.*
.var.*
diff --git a/Makefile b/Makefile
index 0aa88a4..336ec15 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ VERSION = 20170820
include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+files.src.gen += LICENSE
files.out.all += systemd.conf
#files.out.all += systemd.types.db
#files.out.all += systemd.py
@@ -25,6 +26,9 @@ $(DESTDIR)$(collectdtypesdir)/systemd.types.db: $(srcdir)/systemd.types.db
$(DESTDIR)$(collectdpythondir)/systemd.py: $(srcdir)/systemd.py
$(INSTALL_PROGRAM) -DT $< $@
+$(srcdir)/LICENSE:
+ wget -O $@ https://www.gnu.org/licenses/gpl-2.0.txt
+
.SECONDARY:
.DELETE_ON_ERROR:
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0f01289
--- /dev/null
+++ b/README.md
@@ -0,0 +1,37 @@
+# collectd-systemd
+
+collectd-systemd is a collectd plugin to read some basic stats from
+systemd. Currently, it reads how many units are in each state
+(inactive/activating/active/reloading/deactivating/failed), how many
+jobs have ever been installed, how many jobs are currently queued, and
+how many jobs have failed.
+
+# Dependencies
+
+ - systemd (obviously)
+ - collectd (obviously), compiled with Python support
+ - python (2 or 3; whichever version collectd was compiled with)
+ - python-dbus
+
+# Installation
+
+The standard GNU process (`./configure --prefix=/usr && make && sudo make install`),
+but instead of running `./configure`, just edit `config.mk` to taste.
+
+To enable it, add `Include "/usr/share/collectd/systemd.conf"` (or
+similar, based on your configured file paths) to your `collectd.conf`.
+
+# License
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/systemd.py b/systemd.py
index 18cdb77..ee4808e 100755
--- a/systemd.py
+++ b/systemd.py
@@ -1,12 +1,28 @@
#!/usr/bin/env python
+# collectd-systemd - systemd.py :
+# A collectd plugin to read systemd unit and job counts
#
+# Copyright 2017 Luke Shumaker <lukeshu@lukeshu.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
# This should be both valid Python 2 and 3, as the collectd Python
# plugin can be either Python 2 or 3 (decided at compile time).
#
# Oddly, the Arch 'collectd' package chose Python 2, despite using
# Python 3 as the default system Python. I assume they have a good
# reason for it, though I can't find it discussed anywhere.
-
import sys
import dbus