Ad Widget

Collapse

MySql Userparameters for windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NomenNescio
    Member
    • Jan 2009
    • 70

    #1

    MySql Userparameters for windows

    How can I use there commands in windows
    Code:
    #UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
    #UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
    #UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
    #UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
    #UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
    #UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
    #UserParameter=mysql.version,mysql -V
    Is there a windows equivalent for these commands?
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Those work for windows. remove the comment at the beginning of each line. Set the user and password as appropriate, for each line as well. restart the agent.

    In the Zabbix GUI, edit the "Item" then "key" for each one of those statements and make them match the way they are in your example above... ie - mysql.ping is not what is in the GUI. I believe they have brackets around the key like mysql[ping]

    if you do a search on this forum, you will see a lot of discussions regarding this. In fact, here is one of the recent threads - http://www.zabbix.com/forum/showthread.php?t=10710
    Last edited by tchjts1; 10-02-2009, 19:14.

    Comment

    • NomenNescio
      Member
      • Jan 2009
      • 70

      #3
      Grep and cut in windows? Does that only work for mysql or does it also work for other things?

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        My bad.

        For MySql on Windows, you'd be better off downloading the Mysql App template and also using userparameters from the Windows machine. if you take a look at the attached file, you can get a sense of some of the things you can gather metrics on using that method.

        Template download link: http://www.zabbix.com/wiki/doku.php?...trib:templates

        On most Win machines there is a command you can run at DOS to give you the userparamters and syntax that you need:

        Code:
        C:> typeperf -qx > perfcounters.txt
        That will produce a rather large text file you can browse for metrics you'd like to report. You then configure "items" for that particular host using the userparameter through the Zabbix GUI instead of modifying the agent conf file. One of the easiest ways to do it is to clone an existing userparameter and just tailor it to your new key. This thread can give you an idea on doing that - http://www.zabbix.com/forum/showthre...1455#post41455

        Anyway, take a look at the attached file, and if that is what you have in mind, I will be glad to help you further, if needed. There are a ton of Sql metrics you can gather from a Windows mySql machine.
        Attached Files
        Last edited by tchjts1; 10-02-2009, 21:15.

        Comment

        • NomenNescio
          Member
          • Jan 2009
          • 70

          #5
          Thanks tchjts1 for your response.

          What I actually meant was how can I use UserParameters to get information directly from mysql. I've read the part of the manual that explains how I can use perf_counter[] to get the information I need but perf_counter only returns the information Windows gathers on MySql and not directly from MySql.

          But I'll assume that it's not possible, that would explain why the default Linux template comes with apache, mysql, POP3 server items while the Windows default template only comes with the essential windows stuff.

          Edit:
          On a side note, I searched "zabbix windows grep cut" in google, guess what the first his was
          Last edited by NomenNescio; 11-02-2009, 12:21.

          Comment

          Working...