Quantcast
Channel: THWACK: All Content - Network Performance Monitor
Viewing all articles
Browse latest Browse all 21870

Custom SQL Query, Filter List, Based On 2 Different Custom Poller Field Values

$
0
0

We have around 5k volume elements being monitored on one of our polling engines, which is roughly 50% of the currently elements being monitored on that polling engine.

We do not currently need to be monitoring these volumes, and, as many people may already know, removing volumes in bulk is not as easy as it should be, yet.

 

Due to an anomaly with a specific firmware version, all devices containing that version (7.3_20.0) no longer show the volumes when listing resources for those devices.

 

I have a way to list all of the devices that are currently polling volumes.

And, I have a way to list the firmware for all of the devices.

 

I need a way to list all of the devices that are currently polling volumes, AND DO NOT have firmware version 7.3 20.0.

 

 

Here is what I have:

 

I had previously found the following SQL query here, thanks to ThwackNation, and it most definitely serves its purpose very well.

 

SELECT *
FROM
(    SELECT n.NodeID, n.Caption, n.IP_Address, cs.RowID, cs.Status       FROM CustomPollerStatus cs JOIN CustomPollerAssignment ca ON (cs.CustomPollerAssignmentID=ca.CustomPollerAssignmentID)                                                      JOIN CustomPollerS cp ON (ca.CustomPollerID=cp.CustomPollerID)                                                      JOIN Nodes n on (ca.NodeID=n.NodeID)   WHERE cp.UniqueName='Occam_Firmware_Version'  -- use your custom poller name      AND n.Vendor LIKE '%occam%'      /*AND n.Caption='node_name'*/ )  --here you can specify the node
AS SourceTable
PIVOT
(
MAX(Status)
FOR RowID IN ([9.0],[13.0]) -- change the numbers if your polled RowIDs have different values
) AS PivotTable


ORDER BY '9.0', '13.0', 'Caption' ASC

 

The query above provides us a nice list of the firmware versions for our devices.

(These devices breakdown their firmware versions into 2 parts, and then store those 2 parts in an odd location, which is why we must use custom pollers, and poll 2 separate fields.)

Our custom poller pulls the table that contains the different parts of the firmware.

RowID 9.0 is the Software part of the version.

RowID 13.0 is the Revision part.

Both of these, together, give us what we need. (It sure would be great if they would just give us the entire firmware version, and put it where everyone else does...)

npm_maintenance_page_occam_firmware_list-000.PNG

 

 

 

 

I made the following SQL query to show me a list of all the nodes that are currently polling volumes/storage.

 

SELECT DISTINCT t1.[NodeID],t1.[IP_Address],t1.[Caption]
FROM [SWNPMDB].[dbo].[Nodes] as t1
JOIN [SWNPMDB].[dbo].[Volumes] as t2
ON t1.[NodeID]=t2.[NodeID]
WHERE t1.Testing<>'TRUE'
ORDER BY t1.[Caption] ASC

 

So, on the page, my team sees this list, and can easily list resources for each node by clicking the question mark.

npm_maintenance_page_nodes_with_volumes-000.PNG

 

 

 

Now, for the problem I am running into, it seems we have discovered a firmware version that actually removes the volumes from being able to be polled.

As it turns out, most of these devices were added to our NPM before being upgraded to their current version.

The previous version they were on allowed the volumes to be polled, and we had them added to the poller.

The firmware for those devices was later upgraded, removing the ability to see the volumes when listing resources.

However, we are still able to see the volumes that are currently added, and they are still gathering data and being polled normally. (Not really sure how this is working, but that can be another adventure I can take at another time)

So, the query above shows the list of nodes with volumes being polled, with no relationship to the different firmware versions.

 

 

What I need, is to, in a way, take both of these queries, and combine them.

 

I need 2 different queries:

 

  1. I need to be able to list all of the devices that currently have volumes being polled, AND DO NOT have SOFTWARE(RowID 9.0)=7.3  AND  REVISION(RowID 13.0)=20.0.
  2. And then I need the opposite, which is a list of ONLY the devices that DO have SOFTWARE(RowID 9.0)=7.3  AND  REVISION(RowID 13.0)=20.0  AND  currently have volumes being polled.

 

After hours of fumbling around, I have come to the following conclusion...

I do not yet possess the skill required to figure this one out, so I need the assistance of ThwackNation to save my day.

 

 

Thank you,

 

-Will


Viewing all articles
Browse latest Browse all 21870

Trending Articles



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