Telegraf

Questions to IPFire Addons.
Post Reply
poli4
Posts: 2
Joined: May 1st, 2019, 8:40 pm

Telegraf

Post by poli4 » May 1st, 2019, 9:15 pm

Hi guys,

It would be nice to have a telegraf addon, I was able to install it manually and it is running fine for 2 weeks now :

https://dl.influxdata.com/telegraf/rele ... d64.tar.gz

Cheers

User avatar
Arne.F
Core Developer
Core Developer
Posts: 8481
Joined: May 7th, 2006, 8:57 am
Location: BS <-> NDH
Contact:

Re: Telegraf

Post by Arne.F » May 2nd, 2019, 7:50 am

According the documetation Telegraf is written in "go". IPFire has no "go" compiler support yet and we don't include binary packages. All has to built from source.

Also i have not found a source download an the license. We add only software that we are allowed to ship (often crude licenses forbid this even if the source code are published.)
Arne

Support the project on the donation!

Image

Image

Image
PS: I will not answer support questions via email and ignore IPFire related messages on my non IPFire.org mail addresses.

poli4
Posts: 2
Joined: May 1st, 2019, 8:40 pm

Re: Telegraf

Post by poli4 » May 2nd, 2019, 7:46 pm

Hello,

Shame for the compiler, I believe it is open source under MIT License :

https://github.com/influxdata/telegraf

ummeegge
Community Developer
Community Developer
Posts: 4942
Joined: October 9th, 2010, 10:00 am

Re: Telegraf

Post by ummeegge » May 5th, 2019, 2:09 pm

Hi all,
@Arne
since GCC-7.3.0 do supports Go already should it be that easy -->

Code: Select all

diff --git a/lfs/gcc b/lfs/gcc
index 5aac2d382..f3bf40479 100644
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -67,7 +67,7 @@ ifeq "$(ROOT)" ""
        --enable-threads=posix \
        --enable-__cxa_atexit \
        --enable-clocale=gnu \
-       --enable-languages=c,c++ \
+       --enable-languages=c,c++,go \
        --disable-bootstrap \
        --disable-nls
   EXTRA_MAKE =
@@ -100,7 +100,7 @@ ifeq "$(PASS)" "1"
        --without-headers \
        --without-ppl \
        --without-cloog \
-       --enable-languages=c,c++
+       --enable-languages=c,c++,go
   EXTRA_MAKE = 
   EXTRA_INSTALL = 
 else
@@ -116,7 +116,7 @@ ifeq "$(PASS)" "2"
        --prefix=$(TOOLS_DIR) \
        --with-local-prefix=$(TOOLS_DIR) \
        --with-native-system-header-dir=$(TOOLS_DIR)/include \
-       --enable-languages=c,c++ \
+       --enable-languages=c,c++,go \
        --disable-libstdcxx-pch \
        --disable-libgomp
   EXTRA_MAKE = 
? I fear probably not :) ?!

Best,

UE
Image
Image

Hellfire
Posts: 672
Joined: November 8th, 2015, 8:54 am

Re: Telegraf

Post by Hellfire » September 1st, 2019, 7:56 pm

Hi,

Is there already a possibility for running telegraf? I'm currently replacing my Librenms smtp monitoring solution and I'm stuck with IPFire.

Would be fine if some could provide a version for IPFire!

Michael
Image

ummeegge
Community Developer
Community Developer
Posts: 4942
Joined: October 9th, 2010, 10:00 am

Re: Telegraf

Post by ummeegge » September 2nd, 2019, 5:10 pm

Golang comes with the next Core update --> https://git.ipfire.org/?p=ipfire-2.x.gi ... e6ffadffc7

UE
Image
Image

Hellfire
Posts: 672
Joined: November 8th, 2015, 8:54 am

Re: Telegraf

Post by Hellfire » September 2nd, 2019, 6:34 pm

This means for Telegraf? Compile it myself? Doubt I will ever get this done ::) Or probably there I will be a Telegraf addon?

Michael
Image

ummeegge
Community Developer
Community Developer
Posts: 4942
Joined: October 9th, 2010, 10:00 am

Re: Telegraf

Post by ummeegge » September 3rd, 2019, 6:10 am

Don´t know what this means for Telegraf since i´ am currently not interested in it but if others wants to try a build in IPFire dev environment they need to wait until they can compile it. Ever checked the binaries --> https://github.com/influxdata/telegraf/releases -->

Code: Select all

# root @ ipfire in /tmp/telegraf/usr/bin [8:04:25] 
$ ./telegraf -h             
Telegraf, The plugin-driven server agent for collecting and reporting metrics.

Usage:

  telegraf [commands|flags]

The commands & flags are:

  config              print out full sample configuration to stdout
  version             print the version to stdout

  --aggregator-filter <filter>   filter the aggregators to enable, separator is :
  --config <file>                configuration file to load
  --config-directory <directory> directory containing additional *.conf files
  --plugin-directory             directory containing *.so files, this directory will be
                                 searched recursively. Any Plugin found will be loaded
                                 and namespaced.
  --debug                        turn on debug logging
  --input-filter <filter>        filter the inputs to enable, separator is :
  --input-list                   print available input plugins.
  --output-filter <filter>       filter the outputs to enable, separator is :
  --output-list                  print available output plugins.
  --pidfile <file>               file to write our pid to
  --pprof-addr <address>         pprof address to listen on, don't activate pprof if empty
  --processor-filter <filter>    filter the processors to enable, separator is :
  --quiet                        run in quiet mode
  --section-filter               filter config sections to output, separator is :
                                 Valid values are 'agent', 'global_tags', 'outputs',
                                 'processors', 'aggregators' and 'inputs'
  --sample-config                print out full sample configuration
  --test                         gather metrics, print them out, and exit;
                                 processors, aggregators, and outputs are not run
  --test-wait                    wait up to this many seconds for service
                                 inputs to complete in test mode
  --usage <plugin>               print usage for a plugin, ie, 'telegraf --usage mysql'
  --version                      display the version and exit

Examples:

  # generate a telegraf config file:
  telegraf config > telegraf.conf

  # generate config with only cpu input & influxdb output plugins defined
  telegraf --input-filter cpu --output-filter influxdb config

  # run a single telegraf collection, outputing metrics to stdout
  telegraf --config telegraf.conf --test

  # run telegraf with all plugins defined in config file
  telegraf --config telegraf.conf

  # run telegraf, enabling the cpu & memory input, and influxdb output plugins
  telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb

  # run telegraf with pprof
  telegraf --config telegraf.conf --pprof-addr localhost:6060
?

UE
Image
Image

Hellfire
Posts: 672
Joined: November 8th, 2015, 8:54 am

Re: Telegraf

Post by Hellfire » September 3rd, 2019, 7:17 am

ummeegge wrote:
September 3rd, 2019, 6:10 am
Ever checked the binaries --> https://github.com/influxdata/telegraf/releases -->
So which binary did you choose for IPFire? When installing Telegraf on my Raspberry Pi, I just had to add the Telegraf repository and install it with command

Code: Select all

sudo apt-get- install telegraf[/code

IPFire uses pakfire and I bet I cannot add a different repository that is fully integrated and can be used in a similar way? Hence, I guess I need to know which binary does fit for my AMD processor: amd64 seems to be perfect but which platform would be suitable, simply Linux?

Thanks,
Michael
Image

ummeegge
Community Developer
Community Developer
Posts: 4942
Joined: October 9th, 2010, 10:00 am

Re: Telegraf

Post by ummeegge » September 3rd, 2019, 12:19 pm

Image
Image

Hellfire
Posts: 672
Joined: November 8th, 2015, 8:54 am

Re: Telegraf

Post by Hellfire » September 8th, 2019, 5:06 pm

Hi,

may I com back to this topic since I'm not the most experienced Linux user? After downloading the binary, to the local ./tmp directory on IPfire and unpacking the archive into ./tmp, I got many sub directories which I guess should have been unpacked elsewhere, like /etc or /var and so on. At least the names of the unpacked folders point me into this direction.

Would it be better to unpack the telegraf archive to the correct places right from the beginning or may I leave them in /tmp and start my test?
Also there is an init.sh and a telegraf.service file, availabl in ./tmp/telegraf/usr/lib/telegraf/scripts, are those files responsible for starting the (correctly) installed telegraf binary as a service when copied to the correct location in my IPFire?

I just need some thoughts on how to proceed. I'm running already an instance of telegraf on a Synology NAS using a docker container but IPFire is totally different...

Thx,
Michael
Image

ummeegge
Community Developer
Community Developer
Posts: 4942
Joined: October 9th, 2010, 10:00 am

Re: Telegraf

Post by ummeegge » September 8th, 2019, 6:35 pm

Hi,
i think the compiler flags has been set according to the directories so the files should be placed like already shown in the package. The initscript looks like a Systemd one since there is no start-stop-daemon nor the needed init-functions on IPFire you need to rewrite it to SysVinit (examples can be found under /etc/rc.d/init.d <-- check the symlinks under rc.*) .

UE
Image
Image

Post Reply