Ad Widget

Collapse

Another Database Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cozancin
    Junior Member
    • Nov 2012
    • 10

    #1

    Another Database Question

    For the Zabbix Database, the events table contains a field called source. This field identifies the source of the event.

    From the API documentation at https://www.zabbix.com/documentation...e/event/object, the follow sources are identified:

    Possible values:
    0 - event created by a trigger;
    1 - event created by a discovery rule;
    2 - event created by active agent auto-registration;
    3 - internal event.

    If source=0, then the event is from a trigger and objectid is the triggerid of the trigger that caused thet event.

    Does anyone know what objectid is set to for the other sources?
  • cozancin
    Junior Member
    • Nov 2012
    • 10

    #2
    Update

    I have continued to improve my checks.

    Here is what I have so far:

    0 - event created by a trigger;

    SELECT count(*) FROM events
    LEFT JOIN triggers ON triggers.triggerid=events.objectid
    WHERE events.source = '0' and triggers.triggerid is null;

    1 - event created by a discovery rule;

    SELECT count(*) FROM events
    LEFT JOIN host_discovery ON host_discovery.hostid=events.objectid
    LEFT JOIN services ON services.serviceid=events.objectid
    WHERE events.source = '1'
    and host_discovery.hostid is null
    and services.serviceid is null;

    2 - event created by active agent auto-registration;

    SELECT count(*) FROM events
    LEFT JOIN autoreg_host ON autoreg_host.autoreg_hostid=events.objectid
    WHERE events.source = '2' and autoreg_host.autoreg_hostid is null;

    3 - internal event.

    I am still tracking this one down

    Comment

    Working...