Batman to Zabbix Converter
I was using Batman for a few days to track the battery life on my android phone. When i tried visualizing the information stored in those columns of text, it hit me: I already know something that is great at displaying stats: Zabbix. This will convert and send the data to your zabbix-server. If you like this script, let me know!
You need access to a server running zabbix. If you do not have one (or are capable of setting one up), this script is not for you. Sorry 'bout that.
Install Batman on your phone. Don't forget to actually start logging. I tend to forget to start logging after i reboot my phone.
The machine running the conversion needs Ruby 1.9 and a copy of the Zabbix-Agent.
zabbix_host_import.xml on your zabbix server. This should generate a new host called "Your-Device" including some items and graphs. Rename it, if you like.
Have the correct zabbix_sender binary for your platform nearby. It can be either on your path, or you can just place it directly into this project's directory. You can download the Zabbix Sender as part of the Zabbix Agent or from your OS's package-manager.
zabbix_sender.conf. Alter its contents to point to your server and insert your hostname (if you changed it, see above).
You have two possibilities to run the converter/importer:
batman.csv into the project's directory and run
batmanconvert.rb from a terminal and give it the csv's location as parameter like this:
batmanconvert.rb test/batman.01.csv (in case you renamed it)
The program will produce two kinds of output: one is from the conversion (a bunch of timestamps), one is from zabbix_sender (a bunch of "info from server..." lines). A week of logging produces a 5MB CSV and a 28MB Tempfile. The import may take a few minutes.
This is not a huge script or anything out of the ordinary. If you must have a license: I'm triple-licensing it under the following licenses. Please pick the one that suits your needs.