Ad Widget

Collapse

How to insert values direct into zabbix Mysql Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DanielFRocha
    Member
    • Dec 2014
    • 37

    #1

    How to insert values direct into zabbix Mysql Database

    Hi I need help with a Zabbix problem,
    I need to insert data with timestamp once in a day

    but I need to insert this data in the past moment

    I have the algorithm to only brings me the number like ex:

    bring only the room number in data 08/27, but i need to insert this number into the Mysql (Maria DB) Database from zabbix.

    The output will be like that:

    data: 08/27 room: 12456 mobile: 9456
    data: 08/28 room: 13770 mobile: 10350
    data: 08/29 room: 10380 mobile: 11728
    data: 08/30 room: 14560 mobile: 5845

    Thanks in Advanced.
  • SBO
    Zabbix Certified Specialist
    Zabbix Certified Specialist
    • Sep 2015
    • 226

    #2
    Hi,

    I would use a flat text file with all your data, and send it through zabbix_sender.

    Format to use :
    <hostname> <key> <timestamp> <value>

    Timestamp is in epoch (unix timestamp) format, even if you're doing this on a windows host.

    Example :
    mynode.intra 1472651733 my.key.in.zabbix value.of.the.key

    Comment

    • DanielFRocha
      Member
      • Dec 2014
      • 37

      #3
      Hi

      Thanks for you help, but how can I specify to adjust just a dot in an time the zabbix_sender is add this value in the last 3 days even if with a timestamp configurated.

      I am using this command:
      zabbix_sender -z 127.0.0.1 -T 1472688000 -s "Test Server" -k test -o 164332 -vv

      Thanks in Advance.

      Comment

      • Semiadmin
        Senior Member
        • Oct 2014
        • 1625

        #4
        Hi, DanielFRocha.

        You'll have to create a file (for example, /tmp/test.txt) with text like this one:

        "Test Server" room.12456 1472688000 9456
        ...
        "Test Server" room.14560 1472687500 5845

        where room.12456 and so on - item.keys.

        After that you can use command

        zabbix_sender -z 127.0.0.1 -i /tmp/test.txt -T -vv

        zabbix_sender -T don't work without a file
        Last edited by Semiadmin; 02-09-2016, 15:01.

        Comment

        • DanielFRocha
          Member
          • Dec 2014
          • 37

          #5
          Thanks my friend,

          I will Try for sure.

          Comment

          Working...