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.

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

  1. Hoteluri Veliko Tarnovo Says:

    Hoteluri Mamaia Preturi

    Having read this I thought it was extremely informative.
    I appreciate you spending some time and effort to put this information together.

    I once again find myself personally spending way
    too much time both reading and leaving comments. But so what, it was still
    worthwhile!

  2. social media management Hatfield Says:

    For hottest information you have tto visit web annd on internet I found
    this webb site as a most excellent wweb pae for newest updates.

    My page social media management Hatfield

  3. Potters Bar Aggregates Says:

    Very great post. I just stumbled upon your weblog andd wanted to say that I’ve really loved browsing your blog posts.
    In anyy caqse I will be subscribing in your rss feed and
    I’m hoping you write again very soon!

  4. Carpet Cleaner Kimpton Says:

    Heyy There. I found your blog thhe use of msn. That is a very
    neatloy written article. I’ll be sure too bookmark it and come back to
    learn extea of your useful information. Thank you for the post.

    I’ll certainly comeback.

  5. soza Says:

    The component which is integrated in the room presets an extension of the technique that ensures cool air delivering. Even more, this unit is provided with particular alternatives which most of the instances are controlled through a remote manage. Thanks to these choices, the individual utilizing the ductless air conditioning program can very easily access the swing function to adjust the direction of the air ventilation. As well, the very same remote handle gives the option to adjust the temperature, ionize the air and boost or lower the ventilation. At the bottom line, the ductless air conditioning technique is an straightforward-to-use unit which always ensures a great ambiance. ?? ??

  6. straight line system Says:

    My brother recommended I may like this web site.
    He used to be totally right. This put up actually made my day.
    You cann’t believe simply how sso much time
    I had spent for this information! Thanks!

    Here is myy webpaage straight line system

  7. gutter Installation Langley Says:

    Excellent pieces. Keep writing such kind of info on your
    blog. Im really impressed by it.
    Hi there, You’ve performed a fantastic job. I’ll certainly digg
    it and for my part recommnend to my friends. I am confient
    they will be benefited from this website.

    Take a look at myy page gutter Installation Langley

  8. stickers Says:

    Excellent post. I’m dealing wityh some of these issues as
    well..

    Here iss myy web-site; stickers

  9. Tory Says:

    Cáspitas! Así se agradecen ver las cosas, gracias!

  10. Williams Says:

    Article writing is also a excitement, if you know after that you can write or else it is difficult to write.

  11. Sheryl Says:

    Con el empleo de los juguetes sexuales la pareja se relaja de la presión que puede suponer una sexualidad
    centrada en el coito como meta final.

  12. como curar las varices Says:

    como curar las varices…

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

  13. baby monitor iphone Says:

    baby monitor iphone…

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

  14. just click literategrandeu4.shutterfly.com Says:

    just click literategrandeu4.shutterfly.com…

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

  15. best small washing machines for apartments Says:

    best small washing machines for apartments…

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

  16. http://moneylender-sg.org/ Says:

    I think the admin of this web page is in fact working hard for his web page,
    since here every data is quality based information.

  17. Mohamed Says:

    Stockton, CA is dwelling to SmartStop Self Storage the place we give
    you nice costs and pleasant customer service.

  18. Thelma Says:

    Yes! Finally something about dream league soccer mod.

  19. jamaican holidays Says:

    Very good post. I’m going through some of
    these issues as well..

  20. Denice Says:

    How To Generate Visitors To Your Store – Learn to use social
    media, electronic mail marketing and other advertising
    tactics to obtain free site visitors to your on-line retailer.

  21. how do you prevent leukemia since young Says:

    The major danger associated with most types of cancers is that it does not
    show any symptoms in the earlier stage until when the cancer has spread at an enormous level.

    Even more frightening, the volatile substances in the air because of alcohol or smoking, and alcohol add inappropriate dragon disfigurement and burns caused by the frequent occurrence of
    accidents to the safety of consumers has brought great harm.

    When you have decided that its best for you to outsource, consider using the
    expertise of 3D model artists with a wide range of
    experience in custom 3D modeling and Rendering including
    3D city models.

  22. designing web templates tutorial Says:

    Both authors, begin by focusing on the rules for understanding and designing advanced techniques.

  23. gestapo Says:

    It used to show at the top of my start list until I downloaded google chrome to see what it was all about, I didn’t really like it so I deleted it but now firefox isnt at the top of start. Any ideas?.

  24. Watch Movies Free HD Says:

    Hi there, You have done an incredible job. I’ll definitely digg it and personally suggest to my friends.
    I’m confident they’ll be benefited from this website.

  25. Shayne Says:

    I think that is one of the such a lot significant information for me.

    And i’m happy reading your article. But want to observation on few basic
    things, The site taste is perfect, the articles is really nice
    : D. Just right job, cheers

  26. Pastel Makeup Says:

    If you want to take much from this post then you have to apply such techniques to your won blog.

  27. Rick Says:

    Whichever mannequin you’re following, you’ll want to use the methods coated in our last submit to do competitive research on the web sites you’re discovering to determine their efficiency and uncover the successful methods they’ve used to attain success.

  28. Tanja Says:

    Due to each silver and gold’s softness as a metal, there may
    be usually one other metal mixed with it to make the gold or silver
    extra malleable for jewelry purposes.

  29. best mac security Says:

    Very great post. I just stumbled upon your weblog and wished to say that I
    have really loved browsing your weblog posts. In any case I’ll be
    subscribing to your rss feed and I am hoping you write once more soon!

  30. hack de gta Says:

    So for those of you who want to see how far we got,
    or wish to check out the controller stuff we added,
    and so on, be at liberty to obtain that build
    and have a mess around, but when it doesn’t work, then we can’t enable you to, there isn’t any one working on this anymore.

  31. slotomania free slots games Says:

    Download and experience Vegas Casino іn yourr android gadget fօr free!

  32. apps for download Says:

    This site was… how do you say it? Relevant!!
    Finally I’ve found something that helped me. Thank you!

  33. como conseguir dinero en gta 5 Says:

    You’re a solid indication of what a group of complete dicks the GTA
    ‘community’ are.

  34. Jeannie Says:

    hi!,I like your writing very much! percentage we be in contact extra approximately your post on AOL?
    I need an expert in this area to resolve my problem.
    May be that’s you! Having a look forward to look you.

  35. como conseguir dinero en gta 5 Says:

    This announcement comes after the latest addition of Every Bullet Counts,
    which is a game mode that pits 4 gamers towards one another, armed with only 2 bullets.

  36. Division10 Says:

    For most recent information you have to pay a quick visit web and on internet I
    found this web page as a best web page for latest updates.

  37. sound packs for fl studio Says:

    Hi there to every one, it’s in fact a pleasant for me to go
    to see this web page, it contains valuable Information.

  38. Arielle Says:

    Mother and father who help with a FAFSA are additionally starting the Guardian PLUS
    Mortgage process, which might permit them to take out federal loans on behalf of their students.

  39. princess salon mermaid doris triche Says:

    Free Queen Libby:Our Beloved Pony (Libii) Here comes
    a charming pony, which is a birthday present for Queen Libby.

  40. festa infantil em curitiba Says:

    Algo que alivia bastante a vibe é atrair pessoas que estão
    mais interessadas em curtir uma boa festa do que em cool”
    house e techno.

  41. new.e10bmstu.tmweb.ru Says:

    You may tap “Select” to look at a file explorer
    and browse to get a saved file within your device file system.
    Tap “Share” when you’ve got finished editing the photo details to publish
    the photo in your profile.

    And with this video we covered how to maintain your Instagram account private.
    Click about the bottom right option around the lower bar menu.
    If you wish to log in but have forgotten your password,
    it is possible to reset it employing your Facebook account, provided you connected your Instagram
    account with Facebook and will access the email address contact info listed on your own Instagram account.
    And when you finally do you will notice you’ll find five
    icons throughout the bottom. instagram on mac – new.e10bmstu.tmweb.ru,
    And with this video we covered how to maintain your Instagram account private.
    Click about the bottom right option around the lower bar menu.
    If you wish to log in but have forgotten your password,
    it is possible to reset it employing your Facebook account,
    provided you connected your Instagram account with Facebook and will access
    the email address contact info listed on your own Instagram
    account. And when you finally do you will notice you’ll find five icons throughout the bottom.

  42. Lucie Says:

    I beliedve everything posted was actually very reasonable.
    But, what about this? what iif you wrote a catchier title?
    I ain’t suggesting your content is not good, but
    suppose you added a post title that makes peopl
    desire more? I mean wally

  43. https://sourceforge.net/ Says:

    The web world shouldn’t be devoid of unscrupulous characters.

    My blog post fd (https://sourceforge.net/)

Leave a Reply