Categorieën
Geen categorie

Upgrading Zabbix server from Ubuntu 12.04 to 14.04 (using a MySQL database)

So, I like Zabbix. Sue me 🙂

But upgrading is a whole different ballgame. Zabbix on Ubuntu 12.04 is version 1.8.1 and Zabbix on Ubuntu 14.04 is version 2.2.2. And Zabbix only does an automatic database upgrade from version 2.0 onwards. So, basically, you are on your own and Google does not seem to help either.

So, let me tell you what I did and maybe it works for you too. If not, I am sorry.

In the end I had to checkout the Zabbix sources to find a database patchfile.

So I did:

svn co svn://svn.zabbix.com/trunk

And I found the following directory:  trunk/upgrades/dbpatches/2.0

And it has a “upgrade” script. Don’t bother, it does not work as is. But there is also a “patch” subdirectory with a shitload of sql scripts. They turn out to be just the ticket. So I listed them al in a file, put a mysql command in from of them and, for safety, a “read” between every line and run the script.

So, my logging output in /var/log/zabbix-server/zabbix_server.log changed from:

6033:20140701:133019.785 WEB monitoring: YES
6033:20140701:133019.785 VMware monitoring: YES
6033:20140701:133019.785 Jabber notifications: YES
6033:20140701:133019.785 Ez Texting notifications: YES
6033:20140701:133019.785 ODBC: YES
6033:20140701:133019.785 SSH2 support: YES
6033:20140701:133019.785 IPv6 support: YES
6033:20140701:133019.785 ******************************
6033:20140701:133019.785 using configuration file: /etc/zabbix/zabbix_server.conf
6033:20140701:133019.789 Cannot upgrade database: the database must correspond to  version 2.0 or later. Exiting ...

to:

9446:20140701:151423.638 Starting Zabbix Server. Zabbix 2.2.2 (revision 42525).
9446:20140701:151423.638 ****** Enabled features ******
9446:20140701:151423.638 SNMP monitoring: YES
9446:20140701:151423.638 IPMI monitoring: YES
9446:20140701:151423.638 WEB monitoring: YES
9446:20140701:151423.638 VMware monitoring: YES
9446:20140701:151423.638 Jabber notifications: YES
9446:20140701:151423.638 Ez Texting notifications: YES
9446:20140701:151423.638 ODBC: YES
9446:20140701:151423.638 SSH2 support: YES
9446:20140701:151423.638 IPv6 support: YES
9446:20140701:151423.638 ******************************
9446:20140701:151423.638 using configuration file: /etc/zabbix/zabbix_server.conf
9446:20140701:151423.797 current database version (mandatory/optional):  02010000/02010000
9446:20140701:151423.797 required mandatory version: 02020000
9446:20140701:151423.797 starting automatic database upgrade
9446:20140701:151423.831 completed 0% of database upgrade
9446:20140701:151423.863 completed 1% of database upgrade
9446:20140701:151423.955 completed 2% of database upgrade
9446:20140701:151424.055 completed 3% of database upgrade
9446:20140701:151424.371 completed 4% of database upgrade
9446:20140701:151424.916 completed 5% of database upgrade
9446:20140701:151425.232 completed 6% of database upgrade
9446:20140701:151425.701 completed 7% of database upgrade

etc.
So, before you begin, please make a backup of your database first!

The script I used in the end was this one:

mysql -h mysqlhost -p -D zabbix -pmysqlpassword < acknowledges.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < actions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < alerts.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < applications.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < auditlog_details.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < auditlog.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < autoreg_host.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < conditions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < config.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < dchecks.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < dhosts.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < drules.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < dservices.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < escalations.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < events.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < expressions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < functions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < globalmacro.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < globalvars.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < graph_discovery.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < graphs_items.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < graphs.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < graph_theme.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < groups.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < help_items.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_log.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_str.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_str_sync.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_sync.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_text.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_uint.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < history_uint_sync.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < host_inventory.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hostmacro.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hosts_groups.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hosts_profiles_ext.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hosts_profiles.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hosts.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < hosts_templates.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < housekeeper.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < httpstepitem.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < httpstep.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < httptestitem.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < httptest.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < icon_mapping.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < icon_map.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < ids.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < images.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < interface.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < item_discovery.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < items_applications.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < items.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < maintenances_groups.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < maintenances_hosts.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < maintenances.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < maintenances_windows.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < mappings.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < media.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < media_type.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < node_cksum.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < nodes.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opcommand_grp.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opcommand_hst.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opconditions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < operations.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opgroup.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opmediatypes.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opmessage_grp.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opmessage.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < opmessage_usr.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < optemplate.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < profiles.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < proxy_autoreg_host.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < proxy_dhistory.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < proxy_history.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < regexps.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < rights.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < screens_items.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < screens.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < scripts.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < service_alarms.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < services_links.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < services.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < services_times.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sessions.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < slideshows.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < slides.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmap_element_url.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmaps_elements.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmaps_links.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmaps_link_triggers.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmaps.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < sysmap_url.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < timeperiods.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < trends.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < trends_uint.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < trigger_depends.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < trigger_discovery.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < triggers.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < user_history.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < users_groups.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < users.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < usrgrp.sql
read dummy
mysql -h mysqlhost -p -D zabbix -pmysqlpassword < valuemaps.sql

After the update you are (almost) ready to go. When you get the url to /zabbix working in Apache he hits you with a configurator with lot of questions because he wants a /etc/zabbix/zabbix.conf.php file. Simply answer the questions and install the config file and you are good to go.

Enjoy!

Categorieën
Boeken English LibrePlan

LibrePlan, the missing manual becomes available!

 

Hello people,

It has taken a lot of work, but now the result is there.  “LibrePlan, the missing manual” has become available on lulu.com. And not only that, there now is also a nice manual with training exercises that I use when I give a training at a customer site.

IMG-20140227-WA0002

Now that all the writing is done, it is time to start another kind of writing. Next thing is working towards a new release! I hope to tell more about the features that will be in there soon.

For now, I am just happy with the book. I hope you are too.

Kind regards.

Jeroen Baten

Categorieën
English LibrePlan

LibrePlan number 2 in the list of great Project Management applications!

Hi people,

Recently Robin Muilwijk wrote a story on opensource.com titled “Top 5 open source project management tools in 2014“. And guess what, LibrePlan is ranked at second position!

Robin writes: “This is another full featured tool supporting resource allocation, Gantt charts, financials, and more. These features coupled with a web based application make LibrePlan a great collaboration platform.”

Sofar, nothing new 🙂

Then he continues: “LibrePlan ranks in my personal top 3 favorite open source project management tools because of its modern design and balanced user interface, as well as, good and complete documentation, built in reporting, and professional support.”

To us regular users of LibrePlan this is probably no news, but it is always good to have someone write such nice works about our project.

Behind the scenes we are still working very hard on this project and when there is more news we will sure let you all know about it asap.

Greets, Jeroen.

Categorieën
English LibrePlan

LibrePlan, behind the scenes

It’s been a while since I wrote a blogpost about LibrePlan, but apart from that things have been very busy. There is some behind-the-scenes stuff going on that I hope I can share with you all somewhere in the future. Now I would like to write about the things that have happened since my last post.

It is a lot. I spoke about LibrePlan at the NLUUG conference, at the SPIder foundation meeting, both located in the Netherlands. I just uploaded my presentation to SlideShare so you can all find it here.

I talked with companies (email or conferencecall) in several countries (US, Spain, France,  Netherlands) who are considering to implement LibrePlan and even gave a couple of demo’s using Skype and GotoMeeting.

I talked to a couple of companies who wanted to have some extra functionality build into LibrePlan and we shared some great ideas.

So, simply put, there is a lot going in behind the scenes.

Categorieën
English Language

Scripting in Gimp. The hard and the nice way…

Small problem intro…

I am writing another book. I want to add numbered bullets to a screenshot. All bullets added as images each on a separate layer to easy the moving around. This way I can reference these bullets from the text in my book. Well, why not do some scripting in Gimp to make this happen?

It all sounds harmless enough now, doesn’t it?.

First: the hard way…

I thought: “Well, the script-fu scripting language, as is in use in the excellent GIMP program, has been around for a long time. There should be enough example scripts and I will be out of the woods in minutes.”. Well, you can just forget about that.

It is like the Lisp programming language so you will be writing a lot of “(” and “)”.

To find out more about defining the function and registering it with the Gimp program I direct you to other webpages. There is enough info on that in the script-fu tutorial.

Anyway, at the end of a hard days work, I had a script that worked! It added a layer to an image, it loaded a small image and placed it on the new layer and also gave the new layer a name.

It looks like this (beware of the newlines) :

(script-fu-register
  "script-fu-jb-count"                        ;func name
  "JB count"                                  ;menu label
  "add layers with numbers."                  ;description
  "Jeroen Baten"                              ;author
  "copyright 2013, Jeroen Baten"              ;copyright notice
  "October 10 2013"                           ;date created
  ""                                          ;image type that the script works on
  SF-IMAGE    "Image"         0
)

(script-fu-menu-register "script-fu-jb-count" "/Scripts/JB-Scripts")

(define (script-fu-jb-count theImage )
  (let*
    (
    (new-layer1 nil)
    )

    ; Create a new layer
    (set!  new-layer1  (car (gimp-file-load-layer 1 theImage "piclib/1.png" ) ) )
    ; Give it a name
    (gimp-layer-set-name new-layer1 "Laag 1")
    ; Add the new layer to the image
    (gimp-image-add-layer theImage new-layer1 0)
  )
)

Sofar, so good. Turns out there is (almost) no looping possible in script-fu. Well, there is, but you really don’t want to go there (just sayin’).

Second: the nice way:

So I turned to using the Python-fu stuff (I love python). If you compare the two scripts the differences should be easy to spot:

#!/usr/bin/env python

from gimpfu import *

def insert_numbers(theImage,count) :
    new_layer1 = pdb.gimp_file_load_layer(theImage, "piclib/1.png")
    pdb.gimp_layer_set_name(new_layer1,"Laag 1")
    pdb.gimp_image_add_layer(theImage,new_layer1,0)

register(
    "python_fu_jbcount2",
    "Insert numbers",
    "Add layers to an image with counters in them",
    "Jeroen Baten",
    "Jeroen Baten",
    "2013",
    "JBCount2",
    "*",
    [
        (PF_IMAGE, "img", "Image:", None),
        (PF_STRING, "string", "Aantal", '1'),
    ],
    [],
    insert_numbers, menu="/JBCount2")

main()

In short:

  • In all internal Gimp routine names the “-” is replaced with an “_”.
  • A “pdb.” is placed before all internal Gimp routine names.

Now, adding looping to this should be a walk in the park.

Caveats

Beware if the fact that Script-fu stuff belongs in “~/gimp-2.8/scripts”  and Python-fu scripts belongs in “~/gimp-2.8/plug-ins”.