This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

I would like to add a Critical tab to the below query. I would appreciate it if someone could add a critical tab to the below SWQL query.

SELECT n.Vendor,
COUNT (CASE n.Status WHEN '1' THEN 1 else NULL end) AS UP,
COUNT (CASE n.Status WHEN '2' THEN 1 else NULL end) AS DOWN,
COUNT (CASE n.Status WHEN '3' THEN 1 else NULL end) AS WARNING,
COUNT (CASE n.Status WHEN '9' THEN 1 else NULL end) AS UNMANAGED
FROM Orion.Nodes n
WHERE n.Vendor like 'Cisco' or n.Vendor like 'Palo Alto Networks' or n.Vendor like 'net-snmp'
GROUP BY n.Vendor

  • Hi ,

    Below is your query adjusted to  include another column "Critical", cheers.

    SELECT 
         n.Vendor
        ,COUNT(CASE WHEN n.Status = 1 THEN 1 END) AS [Up]
        ,COUNT(CASE WHEN n.Status = 2 THEN 1 END) AS [Down]
        ,COUNT(CASE WHEN n.Status = 3 THEN 1 END) AS [Warning]
        ,COUNT(CASE WHEN n.Status = 4 THEN 1 END) AS [Critical]
        ,COUNT(CASE WHEN n.Status = 9 THEN 1 END) AS [Unmanaged]
    FROM Orion.Nodes AS n
    WHERE ( n.Vendor LIKE 'Cisco' OR 
            n.Vendor LIKE 'Palo Alto Networks' OR 
            n.Vendor LIKE 'net-snmp' )
    GROUP BY n.Vendor