gocollect

module
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: GPL-3.0

README

|GoCollect|
===========

|bettercodehub| |goreportcard|

GoCollect collects various pieces of system info and publishes them to a
central server.

The intent of GoCollect is to create a map of your servers with slow and
never changing data items. Where you may use Zabbix for semi-realtime
monitoring of integer values like current CPU usage, *you use GoCollect
to collect values like hard drive serial numbers, IPMI IP-addresses and
versions of installed OS packages.*


Installing
----------

::

    make && make install
    cp /etc/gocollect.conf.sample /etc/gocollect.conf
    # edit /etc/gocollect.conf
    # then start/restart gocollect using your favorite init method

You may need to set up a go path first::

    mkdir -p ~/go
    export GOPATH=~/go

And check this out inside that::

    git clone https://github.com/ossobv/gocollect \
      $GOPATH/src/github.com/ossobv/gocollect

And install prerequisites::

    go get github.com/ossobv/go-getopt

Possibly set env to old style module handling::

    # go.mod file not found in current directory or any parent directory...
    go env -w GO111MODULE=off  # sets ~/.config/go/env: GO111MODULE=off


Packaging for Debian
--------------------

Prerequisites:

.. code-block:: console

    $ sudo apt-get install git-buildpackage dh-make dh-systemd

Optional:

.. code-block:: console

    $ cat > .git/gbp.conf << EOF
    [DEFAULT]
    upstream-branch=main
    debian-branch=debian

    [buildpackage]
    upstream-tag = v%(version)s
    EOF

Running:

.. code-block:: console

    $ git checkout debian
    $ gbp buildpackage -sa \
        --git-debian-branch=debian --git-upstream-tag='v%(version)s'

Note that release candidate versions must be tagged as ``v1.2_rc3``.
gbp-buildpackage rewrites the underscore to a debian-style tilde.
Pre-release development versions shall be called ``v1.3_dev`` which
sorts before ``v1.3_rc1``, which in turn sorts before ``v1.3``.


Packaging a tarball
-------------------

To to create a tarball with the latest version, including a config file,
do this:

.. code-block:: console

    $ cd gocollect-client
    $ TGZ_CONFIG=/path/to/gocollect.conf make tgz
    ...
    Created: gocollect-v0.4~rc6+1.g83d4-md5conf-c0f48c3.tar.gz

You can then extract and run that archive on the target machine like
this:

.. code-block:: console

    $ cat gocollect-v0.4~rc6+1.g83d4-md5conf-c0f48c3.tar.gz | sudo tar -xzvC /
    $ sudo /etc/init.d/gocollect start

You may need to install additional dependencies first to get all
collectors to work properly. For example ``smartmontools`` or
``ipmitool``.


Golang notes to self
--------------------

- https://golang.org/doc/code.html
- http://openmymind.net/
- https://jamescun.com/golang/binary-size/


License
-------

The source code is licensed according to the GNU GPLv3+;
see `LICENSE
<https://github.com/ossobv/gocollect/blob/main/LICENSE>`_.

The artwork |--| the GoCollect logo |--| is licensed according to the
*Attribution-NonCommercial-ShareAlike 4.0 International* Creative Commons
license (CC BY-NC-SA 4.0);
see `LICENSE.CC.BY-NC-SA.4-0.txt
<https://github.com/ossobv/gocollect/blob/main/artwork/LICENSE.CC.BY-NC-SA.4-0.txt>`_.



.. |GoCollect| image:: https://raw.githubusercontent.com/ossobv/gocollect/main/gocollect.png
    :alt: GoCollect
.. |bettercodehub| image:: https://bettercodehub.com/edge/badge/ossobv/gocollect
.. |goreportcard| image:: https://goreportcard.com/badge/github.com/ossobv/gocollect
    :target: https://goreportcard.com/report/github.com/ossobv/gocollect
.. |--| unicode:: U+2013   .. en dash

Directories

Path Synopsis
GoCollect daemon, collects data through supplied scripts, writes data to a central server.
GoCollect daemon, collects data through supplied scripts, writes data to a central server.
collectors
Package collectors (gocollect) makes builtin collectors available.
Package collectors (gocollect) makes builtin collectors available.
collectors/core.foo
Package builtincollector (gocollect) is a builtin collector.
Package builtincollector (gocollect) is a builtin collector.
collectors/core.meta
Package builtincollector (gocollect) is a builtin collector.
Package builtincollector (gocollect) is a builtin collector.
data
Package data (gocollect) holds the collected data to make it ready for submittal.
Package data (gocollect) holds the collected data to make it ready for submittal.
log
Package log (gocollect) holds the GoCollect daemon logger.
Package log (gocollect) holds the GoCollect daemon logger.
runner
Package runner (gocollect) is the core of the GoCollect daemon.
Package runner (gocollect) is the core of the GoCollect daemon.
sanejoin
Package sanejoin implements Join() like filepath.Join(), except when later arguments are absolute, in which case it wipes the previous path components.
Package sanejoin implements Join() like filepath.Join(), except when later arguments are absolute, in which case it wipes the previous path components.
shcollectors
Package shcollectors (gocollect) makes shell-script plugins available for collection.
Package shcollectors (gocollect) makes shell-script plugins available for collection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL