I’ve written an ActiveGate plugin for NetScaler which uses SNMP instead of the one you provide via Web API since our network admins seem reluctant to turn on the rest api interface on our netscalers for me to have less work.
In your plugin you describe something like:
Content Switching Virtual Servers (split by virtual server)
Virtual service up %
Hits
Usage requests
Usage response
And that’s exactly what I want to do in my module, have metrics “split by virtual server”, “split by service”. I can read via SNMP which vServers there are, and in example get metrics like if they’re running or not, but I couldn’t find any documentation on how to do the “split by vServer” part.
The vServers vary in name and number depending on the host, so I want to report those metrics for each vServer. There must be an option to do this, since you seem to do this pretty much with your NetScaler plugin.
How do I make groups for metrics? How do I create a group in example called like a vSerer with according metrics below them? To be true, I’m currently only interested if they’re up or not, so it would be pretty fine for me too if i could dynamically add a metric which is not necessarily described in the plugin.json which is a UP/DOWN metric for each vServer.
Any hints on how I can achieve that? Currently I get a list of vServers with ther online/offline status, but if I work like that I’d have to know each vServer by name beforehand and add them to the plugin.json. Because the vServers vary from NetScaler to NetScaler, I’d have to have one plugin for each netscaler. Which isn’t a really nice option to think about:
vserverstatus = self.getVServerStatus()<br> for vserver in vserverstatus:<br> device.absolute(key="vServer %s" % (vserver), value=vserverstatus[vserver])
Since you / Dynatrace uses this “per xxx” things sometimes, I bet there is a way but I couldn’t find it.
I don’t have the NetScaler knowledge to help here, I do know a lot about SNMP, but that is probably not useful here.
If no one else replies, you might want to take a look at the SNMP extension referenced in the following link, that also contains other useful implementations, including some extensions that group metrics, and which implementations might be useful to you:
This could be close to what I want to do… create a group like vServers, create an element with the name (iE myvserver1, myvserver2), and append the metric below. If this actually creates the metric.
Yes, I suggest you use the dimensions feature to send the metrics.
Dimensions are splits of metrics. So define a dimension called “Virtual Server” in your metric definition. And call device.absolute for each Virtual Server, passing the Virtual Server name as the dimension:
As a side-note, I could do with the dimensions what I wanted most likely. In the data it was split by dimensions, just the default-charts don’t honor that. I had to create a group / charts that actually do that, binding them to the metrics behind:
I am developing an ActiveGate Extension in wich I have a Metric with 2 Dimensions but I am running into an issue: none of the two values are being stored into it.
This is the Metric definition in the plugin.json File:
{
“entity”: “CUSTOM_DEVICE”,
“timeseries”: {
“key”: “trains.wait2”,
“unit”: “Count”,
“dimensions”: [“train”, “locationstation”],
“displayname”: "trains.wait2"a
}
}
And this is the Python Code to insert the values into it:
I´m very glad, my “Two-Dimension Metric” is working no problems from my ActiveGate Extension. I can chart it by selecting its Dimension(s), in this case by “Station”: