Core: Package request: telegraf

Created on 8 May 2017  ·  44Comments  ·  Source: opnsense/core

Hey,

Would it be possible to add telegraf to the package repo?

Thanks.

feature

Most helpful comment

If you miss a feature in Telegraf just put it here, normally it's quite easy to add ...

All 44 comments

Hi,

telegraf seems a bit heavy on our packages repo. Would you mind building it
from source locally? The steps are easy:

opnsense-code tools ports

cd /usr/ports/net-mgmt/telegraf

make install

Updating the package is easy since it's a go package with all of the dependencies
included (if updates are available):

opnsense-code tools ports

cd /usr/ports/net-mgmt/telegraf

make reinstall

Cheers,
Franco

On 8. May 2017, at 4:47 AM, juggie notifications@github.com wrote:

Hey,

Would it be possible to add telegraf to the package repo?

Thanks.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Hey Franco,

I can do that, If need be. Can I ask why it is a bit heavy if it is optional?

Hi @juggie,

Sure, this is the download list for the package and it's longer than usual:

https://github.com/opnsense/ports/blob/master/net-mgmt/telegraf/distinfo

It's a contained go binary afterwards which is nice though the package is 6MB compressed when built, about 35MB uncompressed. That's 4x 6MB plus extra build time that ends up on the mirrors, which are also used for system upgrades (16.7 -> 17.1 as the first of this type, 17.1 -> 17.7 will follow) which means the extra weight is noticeable in the sets, about 3-5% increase.

I'm not against this, but for only one request this seems too much to deal with. If we have others who want this and/or build a plugin we should take it in of course to make installing trivial. :)

Cheers,
Franco

K sounds good. Let's leave this ticket open for a little bit to see if anyone else wants to make their interest known.

agreed, thanks

@juggie What do you want to achieve with Telegraf?
For me it makes only sense with InfluxDB and Grafana, but I'm interested in your ideas :)

@mimugmail I wanted to use telegraf to collect stats and send them to influxdb. And then graph with grafana. I've got this working with @fichtner instructions above. I am sure there are tons of custom collection agents that could be created as well eg vpn sessions, firewall events, etc.

@juggie Aaah, you only use it as an agent. I was too focused on Influx and Grafana.
Good idea for centralizing all stats!

I'm in for a pkg in the repo 👍

But to be honest I think there are less than 0,001% that will use it, and also only when there's a plugin and a bit promotion.

@mimugmail How else can you use telegraf besides an agent really?

So far grafana is displaying some interesting stats. It would be interesting to write some custom plugins or just exec scripts even to collect more information. I see opnsense has an API that I may be able to collect information from, but I am not able to find ANY documentation on the end points.

@juggie No, when reading telegraf I thought of a complete local installation of Telegraf, Influx and Grafana on OPN itself.

I would be interested to use telegraf to push stats to my external influxdb.

Agreed, I was thinking of doing the same. Guess I'll do it by hand for now, but I'd love a package

will look at this now that 17.7 is out

Quick question though, your instructions for installing manually might be outdated or something.
opnsense-code tools ports says rm: /etc/make.conf: No such file or directory, and /usr/ports still doesn't exist after the download.
Did the way to install ports change ?

@Ulrar what OPNsense version are you on? I remember these bugs in opnsense-code, but that was a few months ago. FWIW, this should "fix" it:

# touch /etc/make.conf
# opnsense-code tools ports

Oh yeah, that fixes it.
I seem to be on 17.1.r1 still, the update doesn't want to apply .. Not sure why, I'll investigate better tonight. Thanks !

@Ulrar uh, 17.1.r1? That shouldn't even exist anymore. You may have missed the upgrade window for this prerelease version. But it can be fixed with a fingerprint fetch and manual upgrade command. I can walk you though it if you want or you can use a newer image + import / install.

Ah ! If I can avoid re-installing that would be great yes, it's my home router so I'd rather avoid risking losing my config and have no internet to figure out the problem.

Ok, when you can, post the output of:

# ls -lah /usr/local/etc/pkg/fingerprints/OPNsense/trusted

.. and check if it's enough to switch the firmware mirror, maybe the old selection is simply not there anymore.

I just tried it again and that's not what the problem is, I get this :

pkg-static: Cannot delete vital package: opnsense!
pkg-static: If you are sure you want to remove opnsense, 
pkg-static: unset the 'vital' flag with: pkg set -v 0 opnsense
Starting web GUI...done.
Generating RRD graphs...done.
***DONE***

Admittedly I haven't looked at the doc, maybe I should just unset the vital flag. I just thought I'd take a look at it later, and clearly forgot it for a few months :)

I'd have to check what was wrong there, maybe a problem in pkg package manager, can't clearly remember. do not unlock the package as it suggest, it'll remove the GUI and leave the box stranded.

Two upgrade later, I'm on the latest version and it seems to work fine. The second upgrade to 17.7 took forever, I was actually plugging the serial usb adapter to check what went wrong when it finished booting.

Anyways, everything's good, thanks for the help ! And sorry for hijacking the thread

This will happen for 17.7.3...

@Ulrar @juggie @tioan Would you mind send me an anonymized copy of your telegraf.conf? With your parameters I'd build a plugin ...

Hey @mimugmail

I'm running pretty much a stock configuration. Nothing special besides being pointed at my influxdb server. The problem w/ telegraf is the configuration options in terms of different output and input plugins are pretty extensive.

@juggie I'd like to see it anyway. With all you 3 conf's I can start with a plugin make all your instances configurable via UI.

Just send it to:
https://github.com/opnsense/plugins/blob/master/net-mgmt/collectd/Makefile

Do you use haproxy and net plugin?
I'm currently adding cpu, disk, diskio, mem, swap, processes and system. You need some more?

There's a plugin in devel available. With the latest 17.7.6 you can install it via cli:
pkg install os-telegraf-devel

But please backup your own config before.

Would be happy to get some feedback/reports.

Hey,

Any way to add a field for https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping ?
I have a new secondary WAN and I'd like to monitor it a bit, make sure it's stable. I'll configure it by hand but I think it'd make sense to have this in the os package.

Sure, how many options do you need/use?

[[inputs.ping]]
   urls = ["8.8.4.4"]
#   # count = 1
#   ## interval, in s, at which to ping. 0 == default (ping -i <PING_INTERVAL>)
#   # ping_interval = 1.0
#   ## per-ping timeout, in s. 0 == no timeout (ping -W <TIMEOUT>)
#   # timeout = 1.0
#   ## interface to send ping from (ping -I <INTERFACE>)
#   # interface = ""

I dont wont to blow it up

Just urls (and count, but I don't think that really matters).
I've tried interface, which would have been great, but it looks like Linux and BSD don't have the same meaning for -I so it doesn't work.

Is this plugin going to move to production?

It has been for several months in 18.1. :)

I do not see it in the UI plugins or packages section. Is it a manual install only?

Wow @fichtner I found it. Completely overlooked it for the last 5 minutes.... Thank you for your patience.

Yay, happy to help! :)

hi,

just wanted to say: thanks for the Telegraf plugin ! We check out, if OpnSense is better than Pfsense and Telegraf is a requirement.

If you miss a feature in Telegraf just put it here, normally it's quite easy to add ...

Hello - nice to have would be having [[inputs.sensors]] - at least for me.

But in the bigger picture - the ability to add custom stuff.

@mimugmail That would be cool but for IPMI. i just want to know regular sensors from motherboard. Like it can be shown on the dashboard

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mimugmail picture mimugmail  ·  6Comments

darkain picture darkain  ·  4Comments

maurice-w picture maurice-w  ·  4Comments

StrikerTwo picture StrikerTwo  ·  8Comments

TransLunarInjection picture TransLunarInjection  ·  7Comments