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:
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?
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.
[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.
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:
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)
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
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.
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
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.
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)
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.
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:
In Zabbix, select the Configuration tab and then Templates
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
Enter a Name for the new item (i.e. “Status” value)
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”)
Select “Calculated” as the Type of the value
Enter the Formula for the calculated item: last(“mios.upnp[urn:upnp-org:serviceId:SwitchPower1,Status]”,0)
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)
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.
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?
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.
Anyway, the source code / project page for the plug-in is here, if you want to request any new features or even contribute code: