Ad Widget

Collapse

zabbix server + agent + modbus ->> not supported

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bricka
    Junior Member
    • Jun 2018
    • 23

    #1

    zabbix server + agent + modbus ->> not supported

    Hello

    I'm new in linux. Just installed fresh debian9 and zabbix.

    Zabbix server log:
    476:20180614:194412.792 using configuration file: /etc/zabbix/zabbix_server.conf
    476:20180614:194412.820 loaded modules: libzbxmodbus.so
    476:20180614:194428.400 server #0 started [main process] libzbxmodbus: loaded version: 0.7

    Zabbix agent log:
    436:20180614:194411.606 using configuration file: /etc/zabbix/zabbix_agentd.conf
    436:20180614:194411.842 loaded modules: libzbxmodbus.so
    436:20180614:194412.011 agent #0 started [main process] libzbxmodbus: loaded version: 0.7

    At http://localhost/zabbix I've created new item with key: modbus_read[tcp://x.x.x.x:17122,0,1068,1]. The status of item is 'not supported'

    I've did everything like here: https://github.com/v-zhuravlev/libzbxmodbus

    Can someone help with that problem?

    Thank's
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by bricka
    Hello

    Can someone help with that problem?

    Thank's
    Hello

    From the link above:
    Any libmodbus error returned including CRC errors would lead to Unsupported Item in Zabbix, so minimizing 'Refresh unsupported items' parameter in Zabbix is recommended because CRC could be common in RS-485 env.
    Testing Modbus connectivity is easy with modpoll command utility.
    You may try to grab some modbus registers with it before you try to do it with Zabbix.
    http://www.modbusdriver.com/modpoll.html
    If using libzbxmodbus with Zabbix agent, you can also save time and test responses first with zabbix_get, for example:zabbix_get -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]

    Comment

    • bricka
      Junior Member
      • Jun 2018
      • 23

      #3
      Originally posted by kernbug

      If using libzbxmodbus with Zabbix agent, you can also save time and test responses first with zabbix_get, for example:zabbix_get -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]
      From windows PC I use modbus scanner. It work's. Sorry.. I'm new in linux...
      where I need u put "zabbix_get -s... "? it's key or terminal?

      If it's key... I've got error: Invalid key "zabbix_get -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]" for item "test" on "test1": incorrect syntax near " -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9, ...".

      If it's in terminal: zabbix_get: command not found

      Comment

      • bricka
        Junior Member
        • Jun 2018
        • 23

        #4
        P.S.:
        I found that there is modbus_read_registers function. I found it here: https://github.com/v-zhuravlev/libzb...r/src/modbus.c

        but... If I use modbus_read_registers[tcp://x.x.x.x:17122,0,1068,10] - there is info that shows: Check function (1,2,3,4) used
        If I change to modbus_read_registers[tcp://x.x.x.x:17122,1068,10] - info shows: Invalid number of parameters.

        So looks like modbus_read_registers work's.. but I'm doing something wrong

        Comment

        • kernbug
          Senior Member
          • Feb 2013
          • 330

          #5
          Originally posted by bricka

          where I need u put "zabbix_get -s... "? it's key or terminal?
          Hi

          Information about zabbix-get utlity https://www.zabbix.com/documentation...l/concepts/get
          Looks like Item parameter "modbus_read_registers[tcp://x.x.x.x:17122,0,1068,10]" correct, so you can add this to monitoring.

          Comment

          • bricka
            Junior Member
            • Jun 2018
            • 23

            #6
            There is no zabbix_get...
            root@debian:/bin# ./zabbix_get modbus_read_registers[tcp://x.x.x.x:17122,0,1068,10]
            bash: ./zabbix_get: No such file or directory
            looks like instalation is ok:
            root@debian:/# apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
            Reading package lists... Done
            Building dependency tree
            Reading state information... Done
            zabbix-agent is already the newest version (1:3.4.10-1+stretch).
            zabbix-frontend-php is already the newest version (1:3.4.10-1+stretch).
            zabbix-server-mysql is already the newest version (1:3.4.10-1+stretch).
            0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

            I cant find how to install zabbix_get:
            root@debian:/bin# apt-get install zabbix_getReading package lists... Done
            Building dependency tree
            Reading state information... Done
            E: Unable to locate package zabbix_get

            Comment

            • kernbug
              Senior Member
              • Feb 2013
              • 330

              #7
              Originally posted by bricka
              There is no zabbix_get...


              looks like instalation is ok:



              I cant find how to install zabbix_get:
              Hi,

              Package name: 'zabbix-get'

              Comment

              • bricka
                Junior Member
                • Jun 2018
                • 23

                #8
                root@xxx# zabbix_get -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]
                ZBX_NOTSUPPORTED: Permission denied


                Or I did something wrong again?
                Last edited by bricka; 27-06-2018, 21:50.

                Comment

                • kernbug
                  Senior Member
                  • Feb 2013
                  • 330

                  #9
                  Originally posted by bricka
                  root@xxx# zabbix_get -s localhost -kmodbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]
                  ZBX_NOTSUPPORTED: Permission denied
                  Hi,

                  Ok, we will postpone the configuration of the agent-server and check this particular key from the previously mentioned module:
                  Code:
                  zabbix_agentd -t modbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]
                  If you set up the modbus device correctly, the result should output the value from the device. Please, try and let me know.

                  Comment

                  • bricka
                    Junior Member
                    • Jun 2018
                    • 23

                    #10
                    root@xxx:~# zabbix_agentd -t modbus_read["/dev/ttyS1 9600 N",9,0x1518,3,l,1,0]
                    libzbxmodbus: loaded version: 0.7
                    modbus_read[/dev/ttyS1 9600 N,9,0x1518,3,l,1,0] [m|ZBX_NOTSUPPORTED] [Input/output error]


                    Finaly I've got modbus working. Now need to work on graphs..
                    Thank's.

                    Solved it by uninstalling debian and installing ubuntu. From ubuntu remove mariadb and add mysql.
                    Attached Files
                    Last edited by bricka; 28-06-2018, 10:45.

                    Comment

                    • mahmutfaruk
                      Junior Member
                      • Mar 2020
                      • 1

                      #11

                      I get results for Modbus but I am not getting some results correctly. ı dont know how can ı write key. wrong results is in below.
                      I don't get negative results right. My value is -257 but my result 65535 modbus_read_registers[tcp://10.2.121.52:502,1, 44, 3, i,1,0] - VMS Comunitation State KEY Type of information : TEXT Type : SimpleCheck Click image for larger version

Name:	3Ekran Alıntısı.PNG
Views:	1616
Size:	5.2 KB
ID:	398270Click image for larger version

Name:	2Ekran Alıntısı.PNG
Views:	1634
Size:	2.9 KB
ID:	398269
                      Attached Files

                      Comment


                      • gjovano
                        gjovano commented
                        Editing a comment
                        Try Type of information: Numeric (Unsign) or float if you have decimal point.
                    Working...