0

I am new to Zabbix. I send data from fluentd client to zabbix server port 10050. My question is How should I config Zabbix item to read this data from port and generate graph for it.

My data is like

.{"request":"agent.data","clock":1501499361,"data":
[
{"key":"Type"      ,"value":"INFIO"      ,"host":"flunet1","time":1501499361},
{"key":"Action"    ,"value":"RESET"      ,"host":"flunet1","time":1501499361},
{"key":"RandNumber","value":"47820"      ,"host":"flunet1","time":1501499361},
{"key":"Message"   ,"value":"aavwafkfxwa","host":"flunet1","time":1501499361},
{"key":"Indexer"   ,"value":"10891"      ,"host":"flunet1","time":1501499361}
]}
peterh
  • 4,953
  • 13
  • 30
  • 44
sam
  • 101
  • 5
  • Could you please clarify what you intend to do? The original question says you both send the data, and want Zabbix to read it from somewhere. Note that your data includes `"request":"agent.data"` which looks like Zabbix protocol, but the data is not formed in a proper way for that. If you want to send data to trapper items manually, you might be interested in https://www.zabbix.org/wiki/Docs/protocols/zabbix_sender/3.0 . – Richlv Aug 01 '17 at 06:50
  • @Richlv Thank you. Te data is collected by fluentd agent and forwarded to a zabbix server. I dont know how make zabbix to collect this data from localhost:10050 port and create graphs for it. – sam Aug 01 '17 at 06:53
  • The question is about how Config zabbix to show data.As I mentioned my data is correctly like zabbix template – sam Aug 01 '17 at 08:05

2 Answers2

1

There are two basic approaches to what you want, I beleive.

One is to configure (by template or explicit -- template preferred) which items you will be sending back, specifically and explicitly (i.e. you know exactly how many, and what their names will be). This is the easiest, but not always possible.

The other is to configure the item dynamically by "Low level discovery" i.e. LLD. This lets you use a prototype item(s) and control at run time how many there are, and what they care called (within some limits). This is useful for things like switch interfaces, where you do not necessarily know how many will exist (and indeed with virtual ports it can change).

It is not clear from your posting which you need, but once you determine it, there are numerous examples. Where people often get confused is in treating the two steps similarly. If you need LLD, all it does is create the item definitions; you then still have to get data into them by either a pull (poll some agent for data) or push (zabbix trapper, possibly snmp trapper).

The normal (but not necessary) process is that LLD is infrequent (and usually more processor intensive) and the polling to fill in the data more frequent. In that case separate routines are used. It is also possible to use one routine which returns two sets of data - the JSON data to create the items via LLD (this comes back in STDOUT), and the item data via Zabbix Sender (to the zabbix server port) to populate the created items. Note if you do this the first time (or two) will not populate the items with data as it takes a bit of time for the items to fully be defined and ready, but subsequent calls to send both will work, as the LLD creation of an item that already exists is basically a no-op (I say "basically because if you FAIL to create an item during LLD it becomes eligible for automatic deletion, so you do need to send JSON for all items each time you do LLD).

Again, not completely clear you need LLD from your question; if not just create items for each one, and return them as separate items either from a poll to the agent, or again as zabbix sender (the advantage of "zabbix trapper" items populated by zabbix sender is you can with one remote operation calculate and send data for lots of items at once, as opposed to each item doing its own separate poll).

Linwood
  • 263
  • 1
  • 7
0

It seems that you want to pass custom data to Zabbix. You cannot push any random data to the Zabbix server port (also note that server port is 10051, not 10050), you must use proper format.

Please note that the trapper items must exist for any of the methods above to work.

Richlv
  • 2,354
  • 1
  • 13
  • 18