Ad Widget

Collapse

Having problems with agent2 plugins

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elyograg
    Member
    • Aug 2021
    • 37

    #1

    Having problems with agent2 plugins

    I'm trying to set up monitoring with three templates that talk to the version 2 agent on Linux. I have installed packages from the Zabbix Ubuntu repository on Ubuntu Server 20.04.

    MySQL by Zabbix agent 2
    SMART by Zabbix agent 2
    Website certificate by Zabbix agent 2

    I did manage to get the MySQL one working after a lot of head-scratching, but the other two are being problematic. The third template is one that I downloaded from the zabbix website, the others came preinstalled.

    For the third template, when I look at the items, "Cert: Get" shows not supported, with message "Unknown metric web.certificate.get"

    For the second template, "SMART: Get attributes" says it's not supported, with message "Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value.."

    The third template's error sounds like the WebCertificate plugin is not installed in my zabbix agent, which is weird because the docs say that plugin is enabled out of the box. The second template's error is completely mystifying. I did notice that I got a ton of alerts from my server saying that the zabbix user was trying to use sudo to run smartctl, which was blocked. I added a file to /etc/sudoers.d to fix that, but it didn't help.

    I don't see "web.certificate.get" or "WebCertificate" anywhere in the zabbix source code, so maybe the docs saying that plugin is available out of the box are incorrect.

    Does anyone have ideas for getting this working, or at least for further troubleshooting steps?

    I ran "jsonlint-php" on the output of "smartctl --scan -j" (the command my security alerts say was being denied) and it says it's valid json.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    What is the detailed version of Zabbix Agent 2 you are using? web.certificate.get will be implemented in Agent 2 of Zabbix 5.4.4. At the moment, I think that it is not supported unless it is the pre-release version of 5.4.4rc1.

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      The agent2 plugin is almost finished: https://support.zabbix.com/browse/ZBXNEXT-6708

      There is also a request to implement it as functionality accessible from a server/proxy: https://support.zabbix.com/browse/ZBXNEXT-5931

      Comment

      • elyograg
        Member
        • Aug 2021
        • 37

        #4
        I was running a 5.4 version. I don't recall which specific version, but my server was running 5.4.3, so the agent probably was the same. I saw that the repo had a 5.5 version folder, so I updated the repo and now this is the version I have installed:

        Code:
        elyograg@smeagol:/opt/solr$ dpkg -l | grep zabbix-agent2
        ii zabbix-agent2 1:6.0.0~alpha1-1+ubuntu20.04 amd64 Zabbix network monitoring solution - agent
        Now the "web.certificate.get" key works. Once I worked out the right options on zabbix_get for PSK encryption, I was able to test it. And after waiting the 15 minutes for the template to actually get the value, the items in Latest Data are now populated.

        Comment


        • Atsushi
          Atsushi commented
          Editing a comment
          The 5.5 directory is for the development version. It's meant for anyone who wants to try the next version before it's officially released. Since it is under development, there is no guarantee that it will operate normally.
          If Zabbix server version is 5.4, Zabbix agent should also be 5.4. Now you can use 5.4.4. Zabbix agent is not guaranteed to work with newer major versions than Zabbix server.
          Last edited by Atsushi; 03-09-2021, 02:55.

        • elyograg
          elyograg commented
          Editing a comment
          Both the server and the agents are now running the alpha version of 6.0.0. Upgrading fixed the web.certificate.get key, but broke the mysql.db.size key. The other mysql-related keys are still working, so I'm not hugely concerned with the fact that I can't get the DB sizes. Of course I would like to get it working ... I expect that when 6.0.0 is actually released, it WILL be working.
      • elyograg
        Member
        • Aug 2021
        • 37

        #5
        I did have the MySQL template working, but now (I think since the upgrade to 6.0.0 alpha) it's not getting the database sizes. The error is weird, mentions TLSConnect which is in my zabbix_agent2.d directory, but not for MySQL.

        Click image for larger version

Name:	zabbix_mysql_size_not_supported.png
Views:	9375
Size:	107.3 KB
ID:	430891

        Comment

        • elyograg
          Member
          • Aug 2021
          • 37

          #6
          I tried the mysql.db.size key with zabbix_get and it throws the same error: 'ZBX_NOTSUPPORTED: Invalid parameters: "TLSConnect" cannot be passed as a key parameter.'

          So I'm betting that the mysql template for zabbix agent2 needs some changes to work with v6.

          I gave up on the SMART template, but it is something I would like to get working if I can.

          Comment


          • Atsushi
            Atsushi commented
            Editing a comment
            It seems to be a bug in 5.0.15 and 5.4.4 that mysql.db.size[] cannot be obtained due to a "TLSConnect" error.

            ZBX-19912 : After upgrading to Zabbix 5.0.15, item "mysql.db.size" is not available.

          • elyograg
            elyograg commented
            Editing a comment
            Thanks for the issue info. I'm seeing this on 6.0.0. alpha, and commented on the issue to let them know it affects that version too.

          • elyograg
            elyograg commented
            Editing a comment
            Server and agent updated to 6.0.0alpha2 today. No change - still get the error about TLSConnect.
        • Tomohide
          Junior Member
          • Sep 2021
          • 4

          #7
          In the first place, is mysql.db.size[<commonParams>,database] where <commonParams> is session_name style, not "URI,User,Password" style working?

          I have the same issue on 5.4.4 agent2 and 5.4.4 server.
          I have not been using session_name style until 5.4.4. So I changed my zabbix_agent2.conf to use session_name style on 5.4.4, and I faced the same issue.
          I tried on 5.4.3 agent which did not have problems with "URI,User,Password" style and not have no TLS support on MySQL.

          MySQL plugin git page(https://git.zabbix.com/projects/ZBX/...Frelease%2F5.4) says to support mysql.db.discovery[<commonParams>], mysql.db.size[<commonParams>,database], mysql.ping[<commonParams>], mysql.replication.discovery[<commonParams>], mysql.replication.get_slave_status[<commonParams>], mysql.get_status_variables[<commonParams>], and mysql.version[<commonParams>].

          With 5.4.4 Server and 5.4.3 agent2, All but mysql.db.size[<commonParams>,database] where <commonParams> is session_name style look like to work.

          mysql.db.size[<commonParams>,database] where <commonParams> is session_name style says 'ZBX_NOTSUPPORTED: Invalid parameters: second parameter "User" cannot be passed along with session.'

          Comment


          • Atsushi
            Atsushi commented
            Editing a comment
            For the argument, check the manual or template "MySQL by Zabbix agent 2".

          • Tomohide
            Tomohide commented
            Editing a comment
            Thank you for the suggenstion.
            I rechecked the zabbix_agent2.conf and host macros. Then I found {$MYSQL.USER} and {$MYSQL.PASSWORD} are not empty.
            Under {$MYSQL.USER} and {$MYSQL.PASSWORD} are empty( or not defined locally) on 5.4.4 Server and 5.4.3 agent2, supported keys above work.
            So, There is the problem only on 5.4.4 agent2 and key is mysql.db.size[<commonParams>,database] where <commonParams> is session_name style.
            I apologize for my misleading on my misconfiguration.
        • elyograg
          Member
          • Aug 2021
          • 37

          #8
          I can reproduce the issue with this command. Running it on the zabbix server:

          Code:
          zabbix_get -s 127.0.0.1 --tls-connect psk --tls-psk-identity elyograg.org --tls-psk-file /etc/zabbix/secret.psk -k 'mysql.db.size["tcp://localhost:3306","zbx_monitor","REDACTED","performance_schema"]'
          Everything updated to 6.0.0alpha3 today and it still doesn't work.

          I tried mysql.version with a very similar zabbix_get command and that works.
          Last edited by elyograg; 21-09-2021, 00:44.

          Comment

          • lmonasterio
            Member
            • May 2021
            • 34

            #9
            Hi! I have the same problem. All my host with MySQL and agent 2 are not getting "mysql database size". Do you know the solution? Thank you very much!

            Comment


            • Atsushi
              Atsushi commented
              Editing a comment
              Check out the post above. It has been reported as a bug and a fixed version has not yet been released.
          • lmonasterio
            Member
            • May 2021
            • 34

            #10
            Ok Atsushi, thanks!

            Comment

            Working...