Ad Widget

Collapse

fuzzytime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tapto
    Junior Member
    • Nov 2006
    • 28

    #1

    fuzzytime

    I didn't get the fuzzytime to work properly. With parameter 0 its ok but when having some seconds it didn't work.

    Trigger that I used
    {Firewall:system.localtime.fuzzytime(5)}#1

    I believe this is a bug ? I'm running Suse Linux 10.1 and zabbix 1.1.3

    I have changed the signs for low and high to get this to work corectly.

    - fuzlow=(int)(now+atoi(parameter));
    - fuzhig=(int)(now-atoi(parameter));

    + fuzlow=(int)(now-atoi(parameter));
    + fuzhig=(int)(now+atoi(parameter));

    The debug mode also generated errors for fuzzytime.

    The item->lastvalue is not string. And the value has not a value yet.

    Please find below the patch that I used:

    diff -Naur zabbix-1.1.3.orig/src/zabbix_server/evalfunc.c zabbix-1.1.3/src/zabbix_server/evalfunc.c
    --- zabbix-1.1.3.orig/src/zabbix_server/evalfunc.c 2006-10-23 13:23:21.000000000 +0200
    +++ zabbix-1.1.3/src/zabbix_server/evalfunc.c 2006-11-12 09:30:32.000000000 +0100
    @@ -1078,8 +1078,8 @@
    else if(strcmp(function,"fuzzytime")==0)
    {
    now=time(NULL);
    - fuzlow=(int)(now+atoi(parameter));
    - fuzhig=(int)(now-atoi(parameter));
    + fuzlow=(int)(now-atoi(parameter));
    + fuzhig=(int)(now+atoi(parameter));

    if(item->lastvalue_null==1)
    {
    @@ -1087,7 +1087,6 @@
    }
    else
    {
    - zabbix_log( LOG_LEVEL_DEBUG, "In evaluate_FUNCTION() fuzzytime [%s] [%s]",value,item->lastvalue);

    if((item->lastvalue>=fuzlow)&&(item->lastvalue<=fuzhig))
    {
    @@ -1097,6 +1096,9 @@
    {
    strcpy(value,"0");
    }
    +
    + zabbix_log( LOG_LEVEL_DEBUG, "In evaluate_FUNCTION() fuzzytime (%s) (%s)",value,item->lastvalue_str);
    +
    }
    }
    else if(strcmp(function,"logseverity")==0)
Working...