I have created a Table panel and set up the Non-Time Series, Custom (Repository) query as follows:
SELECT
a.event_id,
b.target_type,
b.target_name,
a.severity,
a.creation_date,
a.last_updated_date,
a.reported_state
FROM
sysman.mgmt$events_latest a,
sysman.mgmt$agents_monitoring_targets b
WHERE
a.target_guid = b.target_guid
AND a.open_status = 1
AND a.closed_date > sysdate
AND a.severity = ‘Fatal’
order by b.target_type, b.target_name;
The visualization is set to Table.
Issue: All the table columns are created but the EVENT_ID column has no data in it. The same SQL run manually shows that the Event_ID is in fact pupulated with data.
SELECT
rawtohex(a.event_id) EVENT_ID,
b.target_type,
b.target_name,
a.severity,
a.creation_date,
a.last_updated_date,
a.reported_state
FROM
sysman.mgmt$events_latest a,
sysman.mgmt$agents_monitoring_targets b
WHERE
a.target_guid = b.target_guid
AND a.open_status = 1
AND a.closed_date > sysdate
AND a.severity = ‘Fatal’
order by b.target_type, b.target_name;
Now I need to convert it back to raw to use it in the detail query
Select
b.target_type,
b.target_name,
a.msg
From
sysman.mgmt$events a,
sysman.mgmt$agents_monitoring_targets b
where
a.target_guid = b.target_guid
AND event_id = $event_id;
It works when used explicitly but not as a variable. I am attempting to determine that the variable actually has the value in it.
Select
b.target_type,
b.target_name,
a.msg
From
sysman.mgmt$events a,
sysman.mgmt$agents_monitoring_targets b
where
a.target_guid = b.target_guid
AND event_id = hextoraw($event_id);
is not working but
Select
b.target_type,
b.target_name,
a.msg
From
sysman.mgmt$events a,
sysman.mgmt$agents_monitoring_targets b
where
a.target_guid = b.target_guid
AND event_id = hextoraw(‘2EAAAAEA27DBD648E0630C414E0A0B0C’);
Select
b.target_type,
b.target_name,
a.msg
From
sysman.mgmt$events a,
sysman.mgmt$agents_monitoring_targets b
where
a.target_guid = b.target_guid
AND event_id = hextoraw(‘$event_id’);
I had to enclose the variable in ’ ’ hextoraw('$event_id');