Below is a sample setup which show a step by step guide.
- Identify the gateway you want to capture the sampling status.
- Normally these are the gateway you would want to capture the sampling status.
- Create the Gateway-Sql setup.
- The below example is applicable to be configure in Include file or Main Gateway file.
- In my example below i have implemented the setup in a include file for the purpose of not repeating the same setup in all the gateway i want to capture the Sampling Status. The only difference in setting this up in the gateway main file is that you have to repeat the same configuration to the multiple gateway. Adding in the include file will eliminate that task.
- Starting the Gateway-Sql setup
In the include file i have created a sampler called Sampling Status
- Proceed to create the include and Add a new Sampler and Choose Gateway-sql.
- There are two items in the config that will help us to create the view for the Sampling Status.
- Tables -> This is the data that we need to capture that contains all the Samplng Status.
- Views -> The data provided by the tables needs to be manipulated and sorted so that it will give us the expected views we want to achieved.
- Capturing the data that will contains the sampling status is merely identifying the the correct target paths and the columns for our tables. For my case i have identify the below data's to be my column.
- GatewayName - Since the overall target of this setup is to consolidate all the data in a single view it is advisable that we will have a reference as to which gateway the data is coming from.
- ManagedEntity - This is for helping us identify which managed Entity have provided the status.
- Sampler - This is the name of the Sampler
- SamplerStatus - The sampling status if the sampler
- Breaking down Tables and Views
- For this example i have used XPATH to populate the tables with data. I preferably use xpath to avoid the issue of dataviews not available during sampling as a note if the dataview is not available during sampling of your plugin, gateway-sql will encounter error as the dataview provided is not available.
- Dissecting the xpath.
- Xpaths --> I targeted the sampling status cell of the headline and manipulate it to target all sampling status cells resulting to /geneos/gateway/directory/probe/managedEntity/sampler/dataview/headlines/cell[(@name="samplingStatus")]
- Columns --> this will be the columns of the Dataview you want to create.
- GatewayName - Targeted to Gateway xpath and capture the property of name resulting to xpath value of /geneos/gateway/directory/@name
- ManagedEntity - Targeted to managed Entity and capture the property of name resulting to xpath value of ancestor-or-self::managedEntity
- Sampler - Targeted to Sampler and capture the property of name resulting to xpath value of ancestor-or-self::sampler
- SamplingStatus - This was initially targeted in our Xpaths value, so i have used the property of value to return the actual value of the cell. This has a xpath value of @value
In this example i have a sql query that captures all of the sampling status.
All Sampling Status - This queries all the data of table we have created above.: select * from ss_tbl
All Sampling Error - This queries all the sampler that gives error: select * from ss_tbl where SamplingStatus !="OK"
- Afterward, add the Sampler to a Managed Entity. You will get your results as below:
Creating a consolidated view
Once you have done the above, you can use the gateway Import/Export function to create a consolidate view of all Gateways' samplers status.
Please note that this may be impacting performance as there may be a large number of cells that needs to be evaluated.