Ad Widget

Collapse

How zabbix generate clock for history tables?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noname
    Senior Member
    • Jan 2008
    • 120

    #1

    How zabbix generate clock for history tables?

    mysql> select * from history_uint where clock > 1208185360;
    +--------+------------+-------+
    | itemid | clock | value |
    +--------+------------+-------+
    | 19467 | 1208185401 | 1 |
    | 19473 | 1208185401 | 1 |
    | 19486 | 1208185401 | 1 |
    | 19488 | 1208185401 | 1 |
    | 19489 | 1208185401 | 1 |
    | 19451 | 1208185402 | 1 |
    | 19452 | 1208185402 | 1 |
    | 19453 | 1208185402 | 1 |
    | 19454 | 1208185402 | 1 |
    | 19455 | 1208185402 | 1 |
    | 19456 | 1208185402 | 1 |
    | 19457 | 1208185402 | 1 |
    | 19458 | 1208185402 | 1 |
    | 19459 | 1208185402 | 1 |
    | 19460 | 1208185402 | 1 |
    | 19461 | 1208185402 | 1 |
    | 19462 | 1208185402 | 1 |
    | 19464 | 1208185402 | 1 |
    | 19463 | 1208185402 | 1 |
    | 19465 | 1208185402 | 1 |
    | 19466 | 1208185402 | 1 |
    | 19468 | 1208185402 | 1 |
    | 19469 | 1208185402 | 1 |
    | 19470 | 1208185402 | 1 |
    | 19471 | 1208185402 | 1 |
    | 19472 | 1208185403 | 1 |
    | 19474 | 1208185403 | 1 |
    | 19475 | 1208185403 | 1 |
    | 19476 | 1208185403 | 1 |
    | 19477 | 1208185403 | 1 |
    | 19478 | 1208185403 | 1 |
    | 19479 | 1208185403 | 1 |
    | 19480 | 1208185403 | 1 |
    | 19481 | 1208185403 | 1 |
    | 19482 | 1208185403 | 1 |
    | 19483 | 1208185403 | 1 |
    | 19484 | 1208185403 | 1 |
    | 19485 | 1208185403 | 1 |
    | 19487 | 1208185403 | 1 |
    | 19525 | 1208185403 | 1 |
    | 19532 | 1208185403 | 0 |
    | 19490 | 1208185430 | 1 |
    | 19491 | 1208185431 | 1 |
    | 19493 | 1208185433 | 1 |
    | 19494 | 1208185434 | 1 |
    | 19495 | 1208185435 | 1 |
    +--------+------------+-------+
    46 rows in set (1.09 sec)

    How can i create this values (clock - for example 1208185435).

    Thx for help
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    Those are Unix timestamps. It is basically the amount of seconds since the 1st of January 1970.

    Comment

    • noname
      Senior Member
      • Jan 2008
      • 120

      #3
      thx. i find it myself=)

      mak@alles:~/temp/20080414/zabbix$ cat main.c

      #include <iostream>
      #include <ctime>
      using namespace std;

      int main(){
      unsigned clock = time(NULL);
      cout << clock << endl;
      return 0;
      }

      mak@alles:~/temp/20080414/zabbix$ g++ main.c && ./a.out
      1208197831
      mak@alles:~/temp/20080414/zabbix$

      Comment

      • niekie
        Junior Member
        • Apr 2008
        • 16

        #4
        date '+%s'

        saves you writing C code...

        Comment

        Working...