Ad Widget

Collapse

New MySQL monitoring recipe provided

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lgc78
    Member
    • Aug 2010
    • 35

    #61
    Nerfux, i tried what you suggested but still haven't been able to find the template after 'successful import'

    What version of zabbix are you running? Do you have any other suggestions i could try?

    Comment

    • lgc78
      Member
      • Aug 2010
      • 35

      #62
      Turns out my problem was the comments at the top of the template. After i removed them i was finally able to really successfully import the template.

      New problem:

      When I run: rm /tmp/.zabbix_mysql-debug.dtime; php mysql.php daily USERNAME PASSWORD

      I get the following output (see below). I'm using PHP 5.3. Any php developers out there that can help update the mysql.php script to clean up these notices/warnings?

      PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /etc/zabbix/mysql.php on line 156
      Mixed install. Balancing settings
      PHP Notice: Undefined variable: table_cache in /etc/zabbix/mysql.php on line 273
      PHP Notice: Undefined variable: table_cache in /etc/zabbix/mysql.php on line 274
      PHP Notice: Undefined variable: Is_root_remote_login_enabled in /etc/zabbix/mysql.php on line 341
      PHP Notice: Undefined variable: Is_root_without_password in /etc/zabbix/mysql.php on line 342
      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 469
      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 470
      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 471


      There was also a message about ereg being deprecated
      I modified this line $bit64 = ereg("/64/",`uname -m`); to look like this $bit64 = preg_match("/64/",`uname -m`);

      Seems to have eliminated that warning - hopefully it still works as expected.
      Last edited by lgc78; 05-02-2011, 17:33.

      Comment

      • AleSager
        Junior Member
        • Apr 2011
        • 3

        #63
        Template import problem

        If not my mistake or not.

        The zabbix server say to import correctly, the template_mysql_server.4.xml file, but not on the list of templates.

        Thank you very much.

        Comment

        • burgernh
          Junior Member
          • Jan 2011
          • 1

          #64
          template import problem

          same here with zabbix 1.8.4. it says import was successful but then it doesn't show up in the list. furthermore usually with success messages you can expand details about what has been imported. it's not working either. so i assume the xml format is not compatible maybe?

          anyone who run it on an earlier version and upgraded to 1.8.4 who could export the given template and post it?

          Comment

          • AleSager
            Junior Member
            • Apr 2011
            • 3

            #65
            al extraer del archivo .xml, los comentarios al comienzo, importa el archivo, correctamente.

            De todos modos, no esta trabajando todo; el conjunto, bien. Hay algunos problemas aun.

            Desde ya gracias.

            Comment

            • Shriram.Fowkar
              Junior Member
              • Jan 2011
              • 17

              #66
              Hi,

              After importing mysql4 template, I get Imported successfully message, however the template is not visible in templates.

              Comment

              • archang3llo
                Junior Member
                • May 2011
                • 10

                #67
                Importing the template successfully

                Hi Shriram.Fowkar,

                After what i read previously in the posts, i could import the template successfully after :

                - removing the existing mysql template in zabbix
                - deleting the comments at the beggining of the xml file
                - finally, i did had to delete in the xml file the trigger entries duplicated =>
                MySQL: Change the read_rnd_buffer_size on {HOSTNAME}
                MySQL: Root remote login enabled on {HOSTNAME}
                MySQL: Queries require tmp sort table on {HOSTNAME}

                Hope it helps you

                Comment

                • archang3llo
                  Junior Member
                  • May 2011
                  • 10

                  #68
                  Still No values in my Latest Data

                  Hi,

                  Well i tried to read all the posts in this thread, i guess i should have missed something, cause i still has no value in my "Latest Data"

                  Well a summary of what i did :
                  - Got the latest agentd 1.8.5
                  - modify my agentd.conf by adding the 2 needed lines
                  - got my mysql.php ( put the debug as false )
                  - imported my mysql template
                  - got my agentd daemon started

                  The only data i get is => MySQL: Live Controller : 1

                  i tried a command i read in the posts :
                  zabbix_sender -z 127.0.0.1 -p 10051 -s system.hostname -k mysql.Open_tables -o 513

                  the answer i got was :
                  Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000026"
                  sent: 1; skipped: 0; total: 1


                  still nothing on my Lastest data.

                  Can someone help please?
                  Last edited by archang3llo; 12-05-2011, 10:13. Reason: precisions & politeness :P

                  Comment

                  • archang3llo
                    Junior Member
                    • May 2011
                    • 10

                    #69
                    Originally posted by archang3llo
                    Hi,

                    Well i tried to read all the posts in this thread, i guess i should have missed something, cause i still has no value in my "Latest Data"

                    Well a summary of what i did :
                    - Got the latest agentd 1.8.5
                    - modify my agentd.conf by adding the 2 needed lines
                    - got my mysql.php ( put the debug as false )
                    - imported my mysql template
                    - got my agentd daemon started

                    The only data i get is => MySQL: Live Controller : 1

                    i tried a command i read in the posts :
                    zabbix_sender -z 127.0.0.1 -p 10051 -s system.hostname -k mysql.Open_tables -o 513

                    the answer i got was :
                    Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000026"
                    sent: 1; skipped: 0; total: 1


                    still nothing on my Lastest data.

                    Can someone help please?

                    OK i did find the solution,
                    Indeed i missed something on page 6 of the thread.
                    In agentd.conf, any comments should be removed e.g #Server=localhost ,
                    cause myqsl.php seems to read the comments with #
                    Sjust put the recommended line only

                    Concerning my situation i had one more problem as my hostname consisted of 2 words "Zabbix Server" and the zabbix sender couldnt put the commars for me, e.g
                    127.0.0.1 Zabbix server 10051 mysql.Threads_cached 7
                    so i had to put it in single word : Zabbixserver

                    agentd restart and item mysql.live activated on my zabbixserver.

                    Hop values populating =)

                    Comment

                    • Shriram.Fowkar
                      Junior Member
                      • Jan 2011
                      • 17

                      #70
                      Hi,

                      Thanks for all the help. I did all the things you mentioned. Now my template got imported, however no data is captured.

                      In zabbix agent log I get the following :

                      PHP Notice: Undefined offset: 1 in /etc/zabbix/mysql.php on line 599
                      PHP Notice: Undefined offset: 1 in /etc/zabbix/mysql.php on line 38
                      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 469
                      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 470
                      PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 471

                      Comment

                      • peton
                        Junior Member
                        • May 2011
                        • 2

                        #71
                        Hi,

                        I´m having problems with the template MYSQL. All the installation is ok, but no data received in Zabbix Server. I have verified the zabbix_agentd.log and i have:

                        PHP Warning: unlink(/tmp/zabbix_mysql.dat): Operation not permitted in /etc/zabbix/mysql.php on line 582
                        PHP Warning: unlink(/tmp/zabbix_mysql.log): Operation not permitted in /etc/zabbix/mysql.php on line 583
                        PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 51
                        PHP Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 52
                        PHP Warning: mysql_select_db(): A link to the server could not be established in /etc/zabbix/mysql.php on line 52
                        PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 60
                        PHP Warning: mysql_query(): A link to the server could not be established in /etc/zabbix/mysql.php on line 60
                        PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 85
                        PHP Warning: mysql_query(): A link to the server could not be established in /etc/zabbix/mysql.php on line 85
                        PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 94
                        PHP Warning: mysql_query(): A link to the server could not be established in /etc/zabbix/mysql.php on line 94
                        PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /etc/zabbix/mysql.php on line 103

                        I have installed mysql.php in /etc/zabbix/ from client size, verify thta mysql_socket is in /var/lib/mysql/mysql.sock....

                        I ia check in /etc/zabbix:

                        php mysql.php live root %%%%%

                        And receive:

                        PHP Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in /etc/zabbix/mysql.php on line 51
                        PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 458
                        PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 459
                        PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 460
                        PHP Warning: Division by zero in /etc/zabbix/mysql.php on line 462
                        Any idea about this kind of error. I have check that i have no problem to connect by prompt to mysql -u root -p %%%% -h localhost

                        Please could you help me?? Any idea???

                        Comment

                        • mcortinas
                          Junior Member
                          • Oct 2011
                          • 8

                          #72
                          Zabbix server don't collect any data

                          Hi,

                          i'm going to monit our Mysql infrastructue with Zabbix and this template.
                          I couldn't collect data of my agent, i've tried change the item type to "Agent" but this not solve the issue.

                          i've checked from command line that mysql.php live USERNAME PASSWORD returns all of my mysql instance data, this isn't my problem.

                          I suspect that the problem is my item type and agent and agent configuration.
                          Can you help me?

                          Marc

                          Comment

                          • peton
                            Junior Member
                            • May 2011
                            • 2

                            #73
                            Originally posted by mcortinas
                            Hi,

                            i'm going to monit our Mysql infrastructue with Zabbix and this template.
                            I couldn't collect data of my agent, i've tried change the item type to "Agent" but this not solve the issue.

                            i've checked from command line that mysql.php live USERNAME PASSWORD returns all of my mysql instance data, this isn't my problem.

                            I suspect that the problem is my item type and agent and agent configuration.
                            Can you help me?

                            Marc
                            Sorry, but for months ago I have not work anymore with zabbix. In any case i will post you the points that you have to consider if you have problems to take MYSQL data when your zabbix capture is on:

                            IF you take "NO ACTIONS FOUND" please ckech the actions executions privileges.

                            To Export-Import Templates you have to install php-xml of the PHP version taht you have ionstalled.

                            plugin implementation for MYSQL:
                            http://www.zabbix.com/wiki/howto/mon...ng_replication

                            Create user zabbix with selection privileges, which you will put in the userparam in the agentd.conf

                            When the zabbix server it is not in a domain, you will have to put on mysql.php, the ip 127.0.0.1

                            erase all the '#' from agentd.conf, i mean, delete all the comments and put only the parameters that you are going to put in production to capture


                            I will hope that this can help you.

                            Comment

                            • mcortinas
                              Junior Member
                              • Oct 2011
                              • 8

                              #74
                              we must customize mysql.php to run properly in our environment

                              Hi,

                              Thanks Peton for your answer, you has encouraged me to open ths PHP script and fix them. For other hand, we've fix this issues for run properly in our environment.

                              1. fix zabbix_sender adding absolut path cmd call from mysql.php file
                              2. set hostname aprameter in zabbix configuration file
                              2. fix zabbix_sender HOSTNAME with spaces, adding simple quotes in cmd call from mysql.php file
                              3. fix zabbix_sender error parse HOSTNAME from zabbix config file, it was including the string "Hostname="
                              4. fix zabbix_sender error parse SERVERNAME from zabbix config file, "Server="
                              5. fix permison mysql.dat in directory /tmp
                              6. fix owner in /opt/zabbix
                              7. fix SYSTEM variable declaration whose include DEBUG sufix

                              I've attached my PHP script file customized.

                              Thanks ins advance,
                              Marc
                              Attached Files

                              Comment

                              • jeenam
                                Member
                                • Oct 2007
                                • 43

                                #75
                                The mysql.php script in the post above has errors (specifically, duplicate items/triggers). When attempting to import the template(s), you will receive errors about items/triggers already existing. Simply delete the corresponding items/triggers from the xml file and then import!
                                Last edited by jeenam; 09-11-2012, 19:44.

                                Comment

                                Working...