Ad Widget

Collapse

Display Unix timestamp as date/time?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Russ
    Junior Member
    • Dec 2009
    • 15

    #1

    Display Unix timestamp as date/time?

    I have an external script that returns a Unix timestamp, and a trigger that fires if the timestamp is more than X minutes ago. This all works well, and does what we need.

    However, I'd like to set up a graph that shows the date & time of the timestamp, rather than the number. Is there any way to do that, or to set up a new item or trigger that converts that timestamp into a date & time?
  • dima_dm
    Senior Member
    • Dec 2009
    • 2697

    #2
    test2.pl
    Code:
    #! /usr/bin/perl
    print "test $ARGV[0]\n";
    print scalar(localtime($ARGV[0])),"\n"
    ./test2.pl 1261137600
    test 1261137600
    Fri Dec 18 15:00:00 2009

    Comment

    • Russ
      Junior Member
      • Dec 2009
      • 15

      #3
      Thanks, but I don't see how that will help. Maybe I didn't explain what I wanted very well.

      When I view the graph, the Y axis is labelled with numbers (1.28G currently), but I'd like it to be labelled with dates & times. We have a trigger for the uptime of some boxes, and their graphs are labelled with hours, minutes, seconds. That's similar to what I'd like, but with the actual date/time.

      Comment

      • dima_dm
        Senior Member
        • Dec 2009
        • 2697

        #4
        Fri Dec 18 15:00:00 2009 is a text field, Zabbix don’t create any graph for text field, you can see only history.

        Comment

        • Russ
          Junior Member
          • Dec 2009
          • 15

          #5
          Originally posted by dima_dm
          Fri Dec 18 15:00:00 2009 is a text field, Zabbix don’t create any graph for text field, you can see only history.
          Yes, but the item I have setup is a Numeric (unsigned) field, since the external script returns the Unix timestamp. I need the script to return the timestamp, since the trigger fires if the returned value is more than X minutes in the past. However, I would like Zabbix to display the date & time on the graphs. Is this possible?

          Comment

          • dima_dm
            Senior Member
            • Dec 2009
            • 2697

            #6
            Try change in items in field Units, you can write word unixtime.
            I check it, it is work.
            Last edited by dima_dm; 14-09-2010, 17:08.

            Comment

            • Russ
              Junior Member
              • Dec 2009
              • 15

              #7
              Originally posted by dima_dm
              Try change in items in field Units you can write word unixtime.
              I check it, it is work.
              That's exactly what I was looking for, thank you.

              Comment

              Working...