Viewing post

MySQL migrations and generating Zabbix Cisco templates

What a week. What a month. What a year.

So much has happened, far more than I could or should ever write about.

Recently we’ve been migrating MySQL servers from one hardware to another – for anyone (me!) that finds this useful in the future, firstly “Hello, and I hope the future is better than the current ‘past’!”, and secondly “I hope this does what you need”:

mysql -h "$HOST" -u "$USER" -p"$PASS" -e \
user,\"'@'\",host,\"'\;\") FROM mysql.user;" -B -N | \
mysql -h "$HOST" -u "$USER" -p"$PASS" | egrep -v "^Grants"

That small bash script accepts 3 arguments, HOSTNAME, USERNAME and PASSWORD. Executing it will output “CREATE USER” statements for all users on the MySQL instance.

While migrating the MySQL servers, we took the opportunity to setup a new monitoring solution – Zabbix. I’ve used it a couple of times in the past, and in my most humble opinion it’s failing is it’s flexibility. It’s just so flexible!

We have a fair number of Cisco switches and routers at our disposal here in the office, and setting up Zabbix templates for each is not high on my bucket list. Why do something by hand that can be done automagically by a computer?

Thus this (very hacky, PHP) script which automatically generates Cisco (SNMP) templates for Zabbix.

Simply run “show snmp mib ifmib ifindex” on your Cisco device of choice, and shove the output into the script’s STDIN. Hey-presto, out comes a Zabbix template!

Modifying the default options in the template is very easy; just edit what you like after line 34.

Tagged as: , , ,

This entry was posted on Wednesday, December 7th, 2011 at 11:03 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

11 Responses to “MySQL migrations and generating Zabbix Cisco templates”

  1. Says:

    An outstanding share! I have just forwarded this onto a
    colleague who was conducting a little homework on this.
    And he actually bought me breakfast due to the fact that I stumbled upon it for him…
    lol. So allow me to reword this…. Thanks for the meal!!
    But yeah, thanx for spending the time to discuss
    this issue here on your blog.

  2. posicionamiento web Precios Says:

    Estaba buscando esa informacion hace espacio, te lo agradezco,
    estoy de concierto con tu punto de vista y alimento igual.
    Despues de buscar mucho por Internet encontre lo que buscaba.
    Genial!!! muchas gracias

  3. Buying_Nfl_Merchandise Says:

    Definitely believe that that you said. Your favorite justification appeared to be at
    the internet the easiest thing to take into accout of. I say to you, I certainly get annoyed whilst other folks think about issues that they plainly do not
    recognize about. You managed to hit the nail
    upon the top and defined out the whole thing with no need
    side-effects , people can take a signal. Will probably be back to
    get more. Thank youBuying_Nfl_Merchandise

  4. cheap nfl jerseys Says:

    What’s up colleagues, how is all, and what you would like to say regarding this paragraph, in my view its really
    awesome designed for nfl jerseys

  5. cheap nfl jerseys Says:

    I’m gone to tell my little brother, that he should also visit this weblog on regular basis to obtain updated from most up-to-date nfl jerseys

  6. wholesale nfl jerseys Says:

    I’m amazed, I must say. Seldom do I encounter a blog that’s equally educative and
    amusing, and let me tell you, you have hit the nail on the head.
    The issue is something that too few folks are speaking intelligently about.

    Now i’m very happy that I found this in my search for something relating to this.wholesale nfl jerseys

  7. oma sexfilme Says:

    Gratis Pornofilme auf http: blog teen-bekommt-facial-besamung-nach-dem-hardcore-sex-mit-oralsex zeigen, dass notgeile Luder eben nicht lange fackeln wenn es um das harte Bumsen geht.

  8. behaarte frauen bilder Says:

    Ich musste sie mit dem Stuhl erschlagen …!!!!

  9. amtliche verlautbarung Says:

    Klar, dass ein gutes Hotel auch darauf achtete, dass es bereits beim Entree etwas fürs Auge bietet.Ich hatte gar nicht gemerkt, dass die zwei Stunden schon um waren, die mir der Meister der Werkstatt prophezeit hatte.

  10. nuetzlicher link Says:

    Beim Sexcam Free Treffen mit geilen Ladyboys ist mir das noch nicht passiert aber dein Poloch war einfach eng und geil, da konnte ich mein Sperma nicht innehalten.

  11. cheap converse shoes online Says:

    It’s enormous that you are getting ideas from this piece of writing as
    well as from our dialogue made at this place.

Leave a Reply