Ad Widget

Collapse

Thirdparty Template MySQL - Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nmz
    Member
    • Jan 2016
    • 69

    #1

    Thirdparty Template MySQL - Error

    I'm using thirdparty template to monitor MySQL database. There's using Zabbix agent and Trapper. I have no idea why I can't get result. Below list are errors results:
    1. Item : MySQL life
    Key : mysql[root,password,life]
    Info : Not supported by agent.
    2. Can't use zabbix_get.

    Waiting help form anyone.

    Best Regards
  • Colttt
    Senior Member
    Zabbix Certified Specialist
    • Mar 2009
    • 878

    #2
    did you read the instructions?
    Also please look to the script, there is some parameters which can be/must be modified for your installation

    my $dsn = "DBI:mysql:mysql;host=127.0.0.1";
    #my $dsn = "DBI:mysql:mysql;mysql_socket=/var/run/mysqld/mysqld.sock";
    my $zabbix_sender = '/usr/bin/zabbix_sender';
    my $agent_config = '/etc/zabbix/zabbix_agentd.conf';
    Also define UserParameter in the zabbix_agent.conf in database side for perl script like this example:

    UserParameter=mysql[*],/opt/mysql_check.pl $1 $2 $3 $4

    Valuemappings:
    MySQL - Status
    0 ⇒ No
    1 ⇒ Yes
    Debian-User

    Sorry for my bad english

    Comment

    • nmz
      Member
      • Jan 2016
      • 69

      #3
      Originally posted by Colttt
      did you read the instructions?
      Of course I read it and changed as he said. As I said just reply agent result item still didn't get trapper result.

      Comment

      • nmz
        Member
        • Jan 2016
        • 69

        #4
        I can send data with this command
        Code:
        zabbix_sender -z <server ip> -s OTRS -k mysql[thread_handling] -o 100 -vv
        In this time I can see this result at web interface.

        Comment

        • Colttt
          Senior Member
          Zabbix Certified Specialist
          • Mar 2009
          • 878

          #5
          ok, if that work, on zabbix-agent site everthing is fine..

          what is exact error-message on zabbix-server side?
          Debian-User

          Sorry for my bad english

          Comment

          • nmz
            Member
            • Jan 2016
            • 69

            #6
            Many hosts and items in my server right now. That's all what I got in the server log
            Code:
             Sending [mysql[db_user,db_pwd,lld ]
            ]
              1724:20160129:095954.105 End of get_values():1
              1724:20160129:095954.105 In DCconfig_get_poller_nextcheck() poller_type:0
              1724:20160129:095954.105 End of DCconfig_get_poller_nextcheck():1454038195
              1724:20160129:095954.105 poller #3 [got 2 values in 0.011214 sec, idle 1 sec]
              1725:20160129:095954.105 get value from agent result: 'ZBX_NOTSUPPORTED'
              1725:20160129:095954.106 End of get_value_agent():NOTSUPPORTED
              1725:20160129:095954.106 Item [OTRS:mysql[{$MYSQL_USER},{$MYSQL_PWD},lld ]] error: Not supported by Zabbix Agent
            And one more question is there's some code I didn't understand in script file. Those are
            Code:
            my $tmp_file = '/tmp/zbx_mysql.status';
            my $zbx_sender_file = '/tmp/zbx_mysql.sender';
            What I have to set in /tmp folder.

            Why I try with zabbix_get in serve I got error such as :
            The program 'zabbix_get' can be found in the following packages:
            * zabbix-proxy-mysql
            * zabbix-proxy-pgsql
            * zabbix-proxy-sqlite3
            * zabbix-server-mysql
            * zabbix-server-pgsql
            When i try to installed those packages, server said already installed and newest version. How can I fix it.
            Last edited by nmz; 29-01-2016, 05:42.

            Comment

            • nmz
              Member
              • Jan 2016
              • 69

              #7
              When I try to run perl script in zabbix server I got those error :
              Code:
              DBI connect('database=DB_NAME;host=Agent_IP','',...) failed: Access denied for user 'zabbix'@'server_ip' (using password: NO) at ./mysql_check.pl line 114.
              Can't call method "prepare" on an undefined value at ./mysql_check.pl line 116.
              I didn't create any database in server_ip and I didn't add anything about zabbix user in host.
              Last edited by nmz; 29-01-2016, 07:06.

              Comment

              • nmz
                Member
                • Jan 2016
                • 69

                #8
                I just suspect is that template support multi host (server and db are separate)?

                Comment

                • Colttt
                  Senior Member
                  Zabbix Certified Specialist
                  • Mar 2009
                  • 878

                  #9
                  Code:
                  my $zbx_sender_file =
                  must set to you zabbix_sender location!

                  try
                  Code:
                  which zabbix_sender
                  and you will see the full path, this must be set for $zbx_sender_file
                  Debian-User

                  Sorry for my bad english

                  Comment

                  • nmz
                    Member
                    • Jan 2016
                    • 69

                    #10
                    Zabbix sender location? Sorry about if I were wrong. As far as I know external script need to setup in server site not in the agent site. If so which sender path should I set in script. Server's zabbix sender path or agent's sender path? I'm using different host for server and agent.
                    Last edited by nmz; 01-02-2016, 09:53.

                    Comment

                    • Joao
                      Junior Member
                      • Feb 2016
                      • 1

                      #11
                      Json

                      My problem with this script is the discovery rules is presenting this message:
                      Value should be a JSON object.
                      I think something is wrong with the results of the script.
                      Any ideas or help with this problem?

                      Comment

                      • nmz
                        Member
                        • Jan 2016
                        • 69

                        #12
                        Actually perl script must place in agent site not in Server. That's log file what I got Run remote command [/opt/mysql_check.pl root password lld ] Result [0] []... and this is error from frontend Received value [] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]. Appreciate any help.
                        Last edited by nmz; 03-02-2016, 09:46.

                        Comment

                        Working...