Ad Widget

Collapse

Use zabbix_sender to send data exception issues for different keys

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sht
    Junior Member
    • Apr 2023
    • 4

    #1

    Use zabbix_sender to send data exception issues for different keys

    Hello:

    When using the zabbix_sender key specified to transfer data, the following problems are encountered:
    • When I use zabbix_sender to transfer the "Running" value for 'api.status', it is normal, and I can see the "Running" value in the latest data
    ​​
    ​​
    • When I use zabbix_sender to transmit the 'Running' value for 'pod[migration-676c987f9c.status]', it fails, and the 'Running' value cannot be seen in the latest data, what should I do​
    ​​
    • ​My environment looks like this:
    Data Server: CENTOS-03 (192.168.1.12), zabbix_proxy monitored
    ZabbixProxy: zabbix_proxy (192.168.1.11)

    The CentOS-03 server uses zabbix_sender to transfer data values to the CentOS-03 monitoring item.
    Last edited by sht; 07-04-2023, 17:40.
  • Answer selected by sht at 10-04-2023, 09:18.
    Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    The difference is in quotation marks....
    Parameter -k in successful cases you have without quotes.
    If you use quotation marks - use the same (double quotation marks) throughout the expression. Don't mix different types of quotes.

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #2
      How are these items configured? are they the same?
      Which command (exactly!) are you sending data?

      Comment

      • sht
        Junior Member
        • Apr 2023
        • 4

        #3
        Originally posted by Hamardaban
        How are these items configured? are they the same?
        Which command (exactly!) are you sending data?
        Yes, the item configuration is the same and the zabbix_sender send commands used are the same (except for key)


        [root@centos-03 ~]# zabbix_sender -z 192.168.1.11 -s "centos-03" -k api.status -o "Running" -vv
        zabbix_sender [1511]: DEBUG: answer [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000099"}]
        Response from "192.168.1.11:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000099"
        sent: 1; skipped: 0; total: 1​
        • Today I used zabbix_sender -z 192.168.1.11 -s "centos-03" -k pod[migration-676c987f9c.status] -o "Running" -vv command successfully sent data and was available in the latest data, which I found strange

        [root@centos-03 ~]# zabbix_sender -z 192.168.1.11 -s "centos-03" -k pod[migration-676c987f9c.status] -o "Running" -vv
        zabbix_sender [1531]: DEBUG: answer [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000031"}]
        Response from "192.168.1.11:10051": "processed: 1; failed: 0; total: 1; seconds spent: 0.000031"​​


        ​​The difference between a successful command executed today and the last time is :
        • ​today
        zabbix_sender -z 192.168.1.11 -s "centos-03" -k pod[migration-676c987f9c.status] -o "Running" -vv
        • last time(This command succeeded when I tried it today, I didn't do anything)
        zabbix_sender -z 192.168.1.11 -s "centos-03" -k 'pod[migration-676c987f9c.status]' -o 'Running' -vv
        • The data is as follows​​​​​​
        Click image for larger version

Name:	image.png
Views:	208
Size:	33.4 KB
ID:	462673​​​
        Last edited by sht; 10-04-2023, 03:14.

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #4
          The difference is in quotation marks....
          Parameter -k in successful cases you have without quotes.
          If you use quotation marks - use the same (double quotation marks) throughout the expression. Don't mix different types of quotes.

          Comment

          • sht
            Junior Member
            • Apr 2023
            • 4

            #5
            Originally posted by Hamardaban
            The difference is in quotation marks....
            Parameter -k in successful cases you have without quotes.
            If you use quotation marks - use the same (double quotation marks) throughout the expression. Don't mix different types of quotes.
            OK, thank you very much for your answer

            Comment

            Working...