Zabbix Plugin (Alpha)

I’ve created a Zabbix plugin that provides an interface between Vera and the Zabbix Enterprise Monitoring System (http://www.zabbix.com/). For those not familiar with Zabbix, it is an “all-in-one” data logging, notification, and network management solution. Zabbix is similar to Nagios, and other network monitoring systems, but Zabbix (IMHO) is easier to use and provides a better integrated experience than other solutions.

Documentation and source code for this plugin can be found here:

Hi,

Thanks for great documentation about plugin.

I’m having some problems when importing templates and I don’t get any data from vera. Any ideas how Can I debug what’s wrong with my setup.

Import template returns ERROR: Import failed with
Error in item key: “Invalid item key format.”.

Zabbix server is 2.0.1 and I’m trying zabbix agent (active) check with key mios.upnp[urn:upnp-org:serviceId:Dimming1,LoadLevelStatus]

on vera I get:
cat /var/log/cmh/zabbix_sender.out

zabbix_sender [31844]: DEBUG: answer [{
“response”:“success”,
“info”:“Processed 0 Failed 1 Total 1 Seconds spent 0.000035”}]
info from server: “Processed 0 Failed 1 Total 1 Seconds spent 0.000035”

and no values are updated on zabbix server.

This command is updating values on server OK
/etc/cmh-ludl/zabbix_sender -vv -c /tmp/zabbix_agentd.conf -k ‘mios.upnp[urn:upnp-org:serviceId:Dimming1,LoadLevelStatus]’
-o 4

is zabbix agent/sender on vera using correct key when talking to server?

firmware on vera 1.5.408 and plugin version 0.3

[quote=“heke, post:2, topic:174116”]Hi,

Thanks for great documentation about plugin.

I’m having some problems when importing templates and I don’t get any data from vera. Any ideas how Can I debug what’s wrong with my setup.

Import template returns ERROR: Import failed with
Error in item key: “Invalid item key format.”.[/quote]

Heke,

Thanks for the detailed report. Would you mind sending me your template file (by PM, or just attach it to a post here) so I can see what’s wrong? It might be something specific to your Vera config that causing the problem.

Thanks,
Hugh

Trying to retrieve the templates or the host config from the plugin results in:

No handler

As a result in my browser…
Unfortunately I am running the beta firmware…

[quote=“Zaphod, post:4, topic:174116”]Trying to retrieve the templates or the host config from the plugin results in:

No handler

As a result in my browser…
Unfortunately I am running the beta firmware…[/quote]

Which version of the plugin are you using?

Typically, the “no handler” message means that the plug-in is still initializing after a Vera reload. Wait a couple of minutes after a reload / restart and see if you still get the message.

Hugh

Heke,

Thanks for the detailed report. Would you mind sending me your template file (by PM, or just attach it to a post here) so I can see what’s wrong? It might be something specific to your Vera config that causing the problem.

Thanks,
Hugh

Hugh: Template attached to this message and was on earlier post too. Thanks for looking in to this.

Sorry, I missed it in your original post. (you were one step ahead of me!)

Now that I’ve seen your file, I believe the problem is some extra line breaks that got inserted into your XML file, probably when you saved it from your browser. Because MiOS doesn’t allow me to set the HTTP content type of the file properly, the browser has to “guess” the content type, which can lead to improper XML “re-formatting” when saving the file from the browser.

How it’s handled depends on the browser. For example, if you save from Firefox, by default, it tries to save it as a “text file”, which wraps long lines and messes up the formatting. If you change the type to “All files” before you save, however, it saves it as a raw file which preserves the formatting. There are similar ways to work around this with Safari, IE etc.

So, try saving the file in “raw” format, and then check the XML.

The key’s in the templates file are supposed to look like this:

<key>mios.upnp[urn:upnp-org:serviceId:Dimming1,LoadLevelTarget]</key>

But if you see extra linebreaks like this (from the attached template.xml), something is wrong:

<key> mios.upnp[urn:upnp-org:serviceId:Dimming1,LoadLevelTarget] </key>

Let me know if you have any luck getting this to work.

Hugh

OK, I got the template imported ok to zabbix. Attached templates to host and got items listed ok.

vera is not updating data on zabbix server

zabbix_sender [4154]: DEBUG: answer [{
“response”:“success”,
“info”:“Processed 0 Failed 250 Total 250 Seconds spent 0.004637”}]
info from server: “Processed 0 Failed 250 Total 250 Seconds spent 0.004637”
zabbix_sender [4155]: DEBUG: answer [{
“response”:“success”,
“info”:“Processed 0 Failed 160 Total 160 Seconds spent 0.002183”}]
info from server: “Processed 0 Failed 160 Total 160 Seconds spent 0.002183”

[quote=“heke, post:8, topic:174116”]OK, I got the template imported ok to zabbix. Attached templates to host and got items listed ok.

vera is not updating data on zabbix server

zabbix_sender [4154]: DEBUG: answer [{
“response”:“success”,
“info”:“Processed 0 Failed 250 Total 250 Seconds spent 0.004637”}]
info from server: “Processed 0 Failed 250 Total 250 Seconds spent 0.004637”
zabbix_sender [4155]: DEBUG: answer [{
“response”:“success”,
“info”:“Processed 0 Failed 160 Total 160 Seconds spent 0.002183”}]
info from server: “Processed 0 Failed 160 Total 160 Seconds spent 0.002183”[/quote]

Heke, did you setup your hosts configuration by hand, or did you import the hosts config from the zabbixHostFile URL? (below)

http://IPAddressOfYourVera:49451/data_request?id=lr_zabbixHostFile.xml

The way Vera sends the data to Zabbix assumes there is one host setup on Zabbix for each Vera device. (i.e. each switch, thermostat, etc. on your Vera gets a seperate host on the Zabbix side)

OK. that was the problem. Zabbix is now receiving data with multiple hosts configuration that was imported.

Thanks!

Hi,

Is there any way to adjust interval that zabbix sender transmits data to server? Graph looks terrible because there are too few datapoints available. From graph it looks like door took from 11:00 to 14:00 to open :slight_smile:

If motion sensor is tripped zabbix sender should send first previous value 0 and then new value 1 with different timestamps ofcourse. This would send necessary datapoints to server to graph correctly.

What do you think?

[quote=“heke, post:11, topic:174116”]Hi,

Is there any way to adjust interval that zabbix sender transmits data to server? Graph looks terrible because there are too few datapoints available. From graph it looks like door took from 11:00 to 14:00 to open :slight_smile:

If motion sensor is tripped zabbix sender should send first previous value 0 and then new value 1 with different timestamps ofcourse. This would send necessary datapoints to server to graph correctly.

What do you think?[/quote]

Yeah, you’re right, it doesn’t look that good. As you suggested, I’ve changed the code to send the old value before the new value, which should give some nice straight edges on the graph, instead of the interpolated values.

If you install version 0.4 (which I just posted), you’ll get the new code.

Hugh

Hi,

Zabbix server now receives both previous and new value. Data is received at same timestamp so zabbix calclulates average of those as last received value.

–>Dimmer 100%->0%, zabbix reports 50% usage (light is off)
–>Motion sensors tripper 1->0, zabbix graph shows 0.5 (door is closed)

Any ideas?

I’m unfortunately not having a ton of success with getting this agent to talk to my Zabbix 2.0 server.

I have a Vera 2 running 1.5.346 firmware (can’t go to .408 yet as it would break functionality on my Yale locks).

On the Zabbix server the agent error status is “[111] Connection refused”

The /var/log/cmh/zabbix_sender.out file contains only one line - “Illegal instruction”

I’m really only looking to get details on Vera uptime, memory use, CPU use - the other metrics I can pull through dataMine although they would be useful as well.

[quote=“heke, post:13, topic:174116”]Hi,

Zabbix server now receives both previous and new value. Data is received at same timestamp so zabbix calclulates average of those as last received value.

–>Dimmer 100%->0%, zabbix reports 50% usage (light is off)
–>Motion sensors tripper 1->0, zabbix graph shows 0.5 (door is closed)

Any ideas?[/quote]

Yep, you’re right. I also tried making the timestamp for the previous value a second or two before the next value, but it didn’t help. It looks like avg (average) function on the default graph layout combines values that are very close in time to “smooth” the graph. In this case, it really screws things up.

However, I was able to create a much better looking graph by creating a Zabbix “calculated value function” that periodically “resamples” the current value of the variable into a new variable. Doing so is very easy:

  1. In Zabbix, select the Configuration tab and then Templates
  2. Find the template that contains the variable for which you’d like a more accurate graph (i.e. urn:upnp-org:serviceId:SwitchPower1), and then click the Item link and then the “Create Item” button
  3. Enter a Name for the new item (i.e. “Status” value)
  4. Enter a Key for the value - this is the name of the new value that is created by Zabbix “on the fly” (i.e. “LastStatus - calculated”)
  5. Select “Calculated” as the Type of the value
  6. Enter the Formula for the calculated item: last(“mios.upnp[urn:upnp-org:serviceId:SwitchPower1,Status]”,0)
  7. Select the Update interval (default 30 seconds) - this is how often the original variable, in this case “Status”, is resampled to create the new variable (LastStatus)
  8. Click the Save button

Now, Zabbix will save the contents of “Status” into “LastStatus” every 30 seconds (or however often you configured it to do so). Graphing “LastStatus” will produce a graph that looks much better.

The attached screenshot shows the setup for the example “LastStatus” item.

Hugh

Hi,

Zabbix plugin is working ok, however would you think it would be nice to have some kind of buttons on vera device. You could then download templates / hostfile from those instead of searching urls form this forum.

Also add calculated items to template for switch / dimmer status etc?

So after a battle getting this up and running. I have hosts set up for current cost appliances - but have no way of getting a graph ?

I’ve imported the template and the hosts and can see all the hosts for each vera device, but I don’t have an option to add items when I create a graph. Am I missing something?

Is this plugin abandoned?

Hi,

I’m have been using plugin for quite some time and it’s working just fine.

The plug-in is not abandoned, although I haven’t made any changes in a while. Honestly, I didn’t realize anyone was still using it other than me. There didn’t seem to be a whole lot of interest. :slight_smile:

Anyway, the source code / project page for the plug-in is here, if you want to request any new features or even contribute code:

Hugh