Ad Widget

Collapse

Howto Monitoring MySQL Application?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johnnguyen
    Junior Member
    • May 2008
    • 18

    #1

    Howto Monitoring MySQL Application?

    Dear All,

    This is first time I used Zabbix to monitoing system but i have problem wit MySQL Application.

    I Installed Zabbix Server on CenOS5 with DataBase used MySQL. I monitoring my server with Template_Linux and Template_App_MySQL and see as App_MySQL.JPG attached files.

    I uncomment (#) in zabbix_agentd.conf file as follow:

    #UserParameter=system.test,who|wc -l
    ### Set of parameter for monitoring MySQL server (v3.23.42 and later)
    ### Change -u<username> and add -p<password> if required
    UserParameter=mysql.ping,mysqladmin -uroot -ppass ping|grep alive|wc -l
    UserParameter=mysql.uptime,mysqladmin -uroot -ppass status|cut -f2 -d":"|cut -f1 -d"T"
    UserParameter=mysql.threads,mysqladmin -uroot -ppass status|cut -f3 -d":"|cut -f1 -d"Q"
    UserParameter=mysql.questions,mysqladmin -uroot -ppass status|cut -f4 -d":"|cut -f1 -d"S"
    UserParameter=mysql.slowqueries,mysqladmin -u


    How can who help me resolve this problem!

    Thanks,
    John Nguyen
    Attached Files
  • cstackpole
    Senior Member
    Zabbix Certified Specialist
    • Oct 2006
    • 225

    #2
    Will you do me a favor and test the commands?
    zabbix_agentd -t mysql.ping

    Also, are the item types set to active?

    Comment

    • johnnguyen
      Junior Member
      • May 2008
      • 18

      #3
      Thanks for your supported, this is results for zabbix_agentd -t mysql.ping

      [root@zabbix sbin]# ./zabbix_agentd -t mysql.ping
      mysql.ping [t|1]

      I access to Items in Configuration tab and active service but a can't actived it.

      Pls give me your advise to resolve this problem.

      Thanks,
      John Nguyen.

      Comment

      • johnnguyen
        Junior Member
        • May 2008
        • 18

        #4
        Additional infors:

        [root@ sbin]# ./zabbix_agentd -t mysql.uptime
        mysql.uptime [t| 164428 ]
        [root@ sbin]# ./zabbix_agentd -t mysql.threads
        mysql.threads [t| 420 ]
        [root@ sbin]# ./zabbix_agentd -t mysql.threads
        mysql.threads [t| 413 ]
        [root@ sbin]# ./zabbix_agentd -t mysql.questions
        mysql.questions [t| 4339059 ]
        [root@ sbin]# ./zabbix_agentd -t mysql.slowqueries
        mysql.slowqueries [t| 715962 ]
        You have new mail in /var/spool/mail/root
        [root@ sbin]# ./zabbix_agentd -t mysql.qps
        mysql.qps [t| 26.385]
        [root@ sbin]# ./zabbix_agentd -t mysql.ping
        mysql.ping [t|1]
        [root@ sbin]# ./zabbix_agentd -t mysql.version
        mysql.version [t|mysql Ver 14.7 Distrib 4.1.20, for redhat-linux-gnu (i686) using readline 4.3]

        pls give me your ideas and howto resolve it?

        regerds,
        John Nguyen

        Comment

        • cstackpole
          Senior Member
          Zabbix Certified Specialist
          • Oct 2006
          • 225

          #5
          OK, the way I understand it that should be correct. I don't monitor mysql this way but I have other user parameters that I do use.

          I believe that your user parameters are correct. So I think the next thing to look at is your items. However, if you are using the mysql template then you should have no problem as those items appear to be correctly defined.

          Is there anything in your server or agent log file that might point a clue as to why it is not working?

          [Edit] Also, after making the edits to your zabbix agent conf file you did restart the agent correct?
          Last edited by cstackpole; 19-05-2008, 18:02. Reason: another question

          Comment

          • johnnguyen
            Junior Member
            • May 2008
            • 18

            #6
            Thanks for your reply,

            I don't know what is the problem, In Configure-items I saw that "Zabbix Agent not supported". Anyway, maybe i installed Zabbix Agent with options were incorrect? I install Agent with follow:

            ./configure --enable-agent --prefix=/usr/local/zabbix --enable-static

            Pls see the attached file for zabbix-agentd.conf and zabbix-agentd.log.

            Can you give me your advise and howto you monitor mysql?

            Thanks,
            John Nguyen
            Attached Files
            Last edited by johnnguyen; 20-05-2008, 04:30. Reason: attached files

            Comment

            • cstackpole
              Senior Member
              Zabbix Certified Specialist
              • Oct 2006
              • 225

              #7
              OK, looking at your log file I see that you have another problem entirly.

              Code:
              zabbix_agentd [13125]: Warning: ZABBIX semaphores already exist, trying to recreate.
              That is bad.

              Here is the detail explination:


              I would suggest you read it if you want to know more about what the problem actually is.

              If you just want it to work...
              Here is the solution:


              Here are the three steps for what you need to do:
              Code:
              1) edit your start script (under Debian it is /etc/init.d/zabbix_server. I don't know what you are running so it may be different. You set this up on install.)
              
              2) Change the line:
              FROM: start-stop-daemon --oknodo --start --pidfile $PID --exec $DAEMON
              TO: start-stop-daemon --oknodo --start --pidfile $PID [B]--chuid zabbix[/B] --exec $DAEMON
              
              3) Then restart the system (easier then hunting down and killing all the semaphores).
              After you have restarted your server, try again and see how that works out for you.

              Have fun!

              Comment

              • johnnguyen
                Junior Member
                • May 2008
                • 18

                #8
                Thanks cstackpole and 800-HELP.com replied to me, I will read be carefully and doing again.

                I will give you result soon.

                Regards,
                John Nguyen

                Comment

                • johnnguyen
                  Junior Member
                  • May 2008
                  • 18

                  #9
                  I install on CentOS5 so the different with Debian, Can you hepl me how to resolve "zabbix_agentd [13125]: Warning: ZABBIX semaphores already exist, trying to recreate."?

                  Comment

                  • cstackpole
                    Senior Member
                    Zabbix Certified Specialist
                    • Oct 2006
                    • 225

                    #10
                    While I use CentOS all of the time, I don't have a Zabbix server running on CentOS.

                    Did you try looking at the file /etc/init.d/zabbix_server ? I am pretty sure that is the standard place to put it. That is the only file that needs to be edited. Everything else should be the same.

                    If you don't have a /etc/init.d/zabbix_server file then I am not sure where it is. What instructions did you follow to install Zabbix?

                    Have fun!


                    [Edit] I just confirmed that the how-to install guides in the Zabbix wiki for CentOS all have the file you need to edit as /etc/init.d/zabbix_server. So just edit that file with the changes I mentioned before and restart. You should be good to go!
                    Last edited by cstackpole; 21-05-2008, 17:18. Reason: clarification from Wiki

                    Comment

                    • johnnguyen
                      Junior Member
                      • May 2008
                      • 18

                      #11
                      I perform follow this toturials http://www.muck.net/?p=16.

                      I saw in sources and knew that have different between debian and redhat, pls see the attached files.

                      Ofcourse, I will read carefull and doing again. Pls see my attached file and give me your ideas.

                      Regards,
                      John Nguyen
                      Attached Files

                      Comment

                      • cstackpole
                        Senior Member
                        Zabbix Certified Specialist
                        • Oct 2006
                        • 225

                        #12
                        OK, so I was wrong. It looks like the fix I posted doesn't quite work the same way for CentOS. Sorry about that.

                        Here is what I found. Try running:
                        Code:
                        su - zabbix -c "/etc/init.d/zabbix_server start"
                        and tell me what happens.


                        Also, what version of Zabbix are you running?

                        Comment

                        • johnnguyen
                          Junior Member
                          • May 2008
                          • 18

                          #13
                          I running version 1.4.5. I used su - zabbix -c "/etc/init.d/zabbix_server start" to start and stop and give me good results, i not found "abbix_agentd [13125]: Warning: ZABBIX semaphores already exist, trying to recreate." in log file. How to run this command auto when restart server or agent?

                          Now I already view MySQL parameter, I found where is my problem, because have different between command in zabbix_agentd.conf and template in Zabbix so i can't view MySQL parameter.

                          Once again thanks for your support in last times.

                          Regards,
                          John Nguyen

                          Comment

                          • cstackpole
                            Senior Member
                            Zabbix Certified Specialist
                            • Oct 2006
                            • 225

                            #14
                            I am glad you have everything working!
                            I believe that you can put the command:
                            Code:
                            su - zabbix -c "/etc/init.d/zabbix_server start"
                            in your /etc/rc.local file to make sure that it runs on startup.

                            That's the best way I know how to do it.

                            Does anyone have a better method for CentOS?


                            Have fun!

                            Comment

                            • johnnguyen
                              Junior Member
                              • May 2008
                              • 18

                              #15
                              I think, I will write another script with su - zabbix -c "/etc/init.d/zabbix_server start,stop" command to replaced default zabbix_agentd and zabbix_server start, simple script is call this command.

                              Regards, John Nguyen

                              Comment

                              Working...