Ad Widget

Collapse

RFC: PATCH for Zabbix 1.1.5: Trigger using diff for TEXT item keys

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freejoe
    Junior Member
    • Feb 2007
    • 2

    #1

    RFC: PATCH for Zabbix 1.1.5: Trigger using diff for TEXT item keys

    This patch has side-effects that I have not seen during my tests. It works only for text-base triggers. SO PLEASE DO NOT USE IT.

    Sorry for that.

    ----
    Original post:

    I created an item "Status of service ssh" with key "svc.status[ssh]" (agent-based,Solaris 10 SMF), which returns a string like "online" or "disabled". The corresponding trigger "Status of service ssh changed on server {HOSTNAME}" with expression "{Solaris_t:svc.status[ssh].diff(0)}>0" was always "UNKNOWN", because the item->lastvalue got never updated.

    This tiny patch changes the update_item in src/zabbix_server/functions.c, so the item has a chance to get updated.

    Code:
    $ diff src/zabbix_server/functions.c.*
    714c714
    <               if ((value->type & AR_TEXT) && ((item->prevvalue_null == 1) || (item->lastvalue_null == 1) ||
    ---
    >               if((value->type & AR_TEXT) == 0 && ((item->prevvalue_null == 1) || (item->lastvalue_null == 1) ||
    I attach the patch file.

    Kind regards,
    Joerg
    Attached Files
    Last edited by freejoe; 07-02-2007, 09:29. Reason: Sorry, patch has bad side-effects - DO NOT USE
Working...