4

I log various stats both generic and custom from a lot of different servers using collectd to a single host running a network listener. The setup is pretty simple. All the systems run an instance of collectd. The collection server runs the rrdtool plugin to save the data and runs the network plugin in server mode to keep a port open and collect stuff from everybody else. All the other servers don't have any write plugins and just run the network in client mode to pass on the data they collectd. The nice thing about this setup is that all the data written by rrdtool comes in a nice consistent file structure that is easy to process for graphs and other monitors.

This works great for a simple layout with one hub that everybody can send to. I am now trying to configure a more complex setup. Still using the same central server and clients, the daemon running one of those clients is able to gather stats for several hosts other than itself that are unable to run the collectd daemon itself.

  A
 /|\
B C D
  |\
  E F

I am able to setup the configs on C such that it reports the stats that it gathered from E and F. That much works.

What I can't do is get C to report that data under several different hostnames. All the data it sends is labeled with it's own host, which is incorrect. How can I identify some of the Plugin or Type blocks in the collectd.conf to report themselves as belonging to a different host than the machine running the daemon?

3
  • were you able to get a lead on this eventually ? Commented Jun 18, 2015 at 18:57
  • 1
    @ManishRanjan No I never got an answer on this and still don't have a solution.
    – Caleb
    Commented Jun 18, 2015 at 19:26
  • @ManishRanjan A this point this doesn't look like a "how do I use this" question so much as a feature request; so I have submitted an issue on collectd's bug tracker. You might want to subscribe to and show some interest in that issue so it gets a developer's attention.
    – Caleb
    Commented Jun 19, 2015 at 12:35

2 Answers 2

2

based on my research I found the python plugins are capable of sending tagged data ( Write_tsdb plugin for example) but there is not an easy way to tag system plugin data like cpu , memory etc)

1

Yes; there is a setting in collectd.conf called Hostname; change that to whatever hostname you want.

You'll probably also want to set FQDNLookup to false; otherwise those systems will fail to send data as the FQDN lookup fails.

In the collectd.conf you'd want to add:

Hostname    "some.host.example.com"
FQDNLookup   false
... all your other settings ...

Some settings can be overridden within a plugin; you may be able to get away with changing Hostname in a plugin from the global default.

3
  • 1
    The reason I asked this question is because you can't override hostname on a per plugin basis the way you speculate.
    – Caleb
    Commented Jun 26, 2015 at 2:48
  • The GenericJMX plugin has this support. The write_tsdb plugin also has support for tsdb tags so the plumbing is there, but you'll have to see if the particular read plugins you're using have support for adding different hosts.
    – Sharninder
    Commented Jun 9, 2016 at 11:23
  • instead of hostname can we pass ip address of host on local network ? Commented Nov 3, 2019 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .