Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20518

Re: Question about Report Writer and SQL

$
0
0

OK SO I AM CLOSERRRRRR however there are still a few 1 offs that are reporting when i can't find any matching conditions in the tables that are in my where clause ANYONE out there can run some of this and verify it?

 

SELECT Nodes.NodeID,Nodes.GroupStatus as img,Nodes.VendorIcon as vimg,Nodes.Caption AS Node,

   (select TOP 1 Message from Events

   where Message NOT LIKE '%Up%'

   AND Message NOT LIKE '%added%' < ----- Not sure this does anything really.....

   AND NetworkNode = Nodes.NodeID

   AND (

( Events.EventType = 2) OR

( Events.EventType = 10) OR

( Events.EventType = 12) OR

( Events.EventType = 15) OR

( Events.EventType = 23) OR

( Events.EventType = 25) OR

( Events.EventType = 30) OR

( Events.EventType = 50) OR

( Events.EventType = 51) OR

( Events.EventType = 58) OR

( Events.EventType = 60) OR

( Events.EventType = 64) OR

( Events.EventType = 65) OR

( Events.EventType = 210) OR

( Events.EventType = 501) OR

( Events.EventType = 505) OR

( Events.EventType = 507) OR

( Events.EventType = 509) OR

( Events.EventType = 510) OR

( Events.EventType = 513) OR

( Events.EventType = 515) OR

( Events.EventType = 520) OR

( Events.EventType = 521) OR

( Events.EventType = 522) OR

( Events.EventType = 523) OR

( Events.EventType = 525) OR

( Events.EventType = 526) OR

( Events.EventType = 527) OR

( Events.EventType = 528) OR

( Events.EventType = 530) OR

( Events.EventType = 531) OR

( Events.EventType = 532) OR

( Events.EventType = 605) OR

( Events.EventType = 701) OR

( Events.EventType = 1001) OR

( Events.EventType = 1002) OR

( Events.EventType = 5000))

   order by EventID DESC) as Message,

max(Events.EventTime) AS Event_Time, IP_Address, MAX(EventID) as EventID

FROM Nodes

INNER JOIN (Events

INNER JOIN EventTypes Events_EventTypes ON (Events.EventType = Events_EventTypes.EventType)) ON (Events.NetworkNode = Nodes.NodeID)

INNER JOIN AlertStatus ON (ActiveObject = Events.NetObjectID AND Events.NetworkNode = Nodes.NodeID)

INNER JOIN Volumes ON (ActiveObject = VolumeID OR Volumes.NodeID = Nodes.NodeID)

WHERE

((Nodes.Status in (0,3,4,7,8,10,12,14,15,16,17,19,24,25)) OR (Nodes.ChildStatus in (0,2,3,4,7,8,10,12,14,15,16,17,19,24,25))

  OR (AlertStatus.State = 2 AND (Events.NetObjectType = 'V' AND Volumes.VolumeID = Events.NetObjectID AND Volumes.NodeID = Nodes.NodeID)))

group by Nodes.Caption,Nodes.GroupStatus,Nodes.VendorIcon,Nodes.NodeID,IP_Address

ORDER BY 6 DESC


Viewing all articles
Browse latest Browse all 20518

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>