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”:

#!/bin/sh
HOST="$1"
USER="$2"
PASS="$3"
mysql -h "$HOST" -u "$USER" -p"$PASS" -e \
"SELECT CONCAT(\"SHOW GRANTS FOR '\", \
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.

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

  1. dream league soccer 2016 coins Says:

    Attractive element of content. I just stumbled upon your site and in accession capital to say that I get in fact loved account your weblog posts.

    Any way I’ll be subscribing on your feeds or even I achievement you
    get right of entry to constantly quickly.

  2. www.article-hut.com Says:

    Authenticate Your Lifestyle With A Little VR Porn, Take VR
    Porn Please. Dip In And Enjoy VR Porn Then Be The Expert
    and Just How Many VR Porn Movies Are You Able To Watch?

  3. internet domain Says:

    Also, if you know people who already have domains at any of the above,
    ask them what they think of the domain control panel – having easy access and
    control of your domains is very useful. Regardless of which
    approach you use, it’s important to be careful not to register a
    internet domain name for a product that is already trademarked, as the trademark owner may be able to unilaterally confiscate your domain without compensation.
    On the next page you should see your domain name that you just purchased – you need to click
    on your domain name.

  4. fishing kayak Says:

    fishing kayak

    wally’s blog » Blog Archive » MySQL migrations and generating Zabbix Cisco templates

  5. Korean Fassion Says:

    Hello very cool web site!! Guy .. Beautiful .. Amazing ..
    I will bookmark your web site and take the feeds also?
    I’m happy to search out a lot of helpful information here within the submit, we need develop more strategies on this regard, thank you for sharing.
    . . . . .

  6. Flor Says:

    In other cases, a particular model of a car may be dropping from the market, or perhaps the rates for
    the vehicle are increasing. Extreme Convenience – Buyers with
    bad credit car financing problems can finance and buy a car at the same time, which is time saving as well.

    When someone agrees to co-sign a loan contract he is legally guaranteeing that the signer will pay.

    My site webpage (Flor)

  7. kumpulan foto foto bugil Says:

    Fine way of explaining, and pleasant post to get information regarding my presentation subject
    matter, which i am going to present in school.

  8. Bokepsma.Xyz Says:

    Hi there, You’ve done an incredible job. I will definitely digg it and
    personally recommend to my friends. I’m sure they will be benefited from this site.

  9. fotoartisbugil.xyz Says:

    Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your website?

    My website is in the very same niche as yours and my visitors would certainly benefit
    from a lot of the information you present here. Please let me
    know if this alright with you. Cheers!

  10. ceritasexartis.xyz Says:

    Hi Dear, are you really visiting this website daily, if so
    after that you will definitely obtain good experience.

  11. downloadvideoporn.xyz Says:

    I’ve been exploring for a little bit for any high-quality articles or blog posts in this kind of space .
    Exploring in Yahoo I ultimately stumbled upon this website.
    Reading this info So i’m glad to convey that I
    have a very just right uncanny feeling I discovered exactly what I needed.
    I most certainly will make certain to do not overlook this site and provides it a glance
    regularly.

  12. vitiligo unani treatment Says:

    vitiligo unani treatment

    wally’s blog » Blog Archive » MySQL migrations and generating Zabbix Cisco templates

  13. Stefan Says:

    Usually I don’t learn post on blogs, but I wish
    to say that this write-up very pressured me to take a look at and do so!
    Your writing taste has been surprised me. Thanks, quite great post.

  14. cerita17.xyz 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.

  15. Julieta Says:

    * Flexibility Lastly, find a financing method which provides flexibility
    when it comes to paying your loans. Whenever you go to a second or third dealership attempting to get approved,
    the dealer can see the banks and loan businesses that you have been sent to currently
    and have already been turned down. It is because having your own car is most likely more beneficial
    to you in so many ways than not having one.

    my web-site web page [Julieta]

  16. รับทำเว็บขายของ Says:

    Hey There. I discovered your blog using msn. This is a
    very smartly written article. I will make sure to bookmark it and come back to learn more of your useful information. Thank you for the post.
    I will definitely return.

Leave a Reply