Templating possible?
Moderators: Developers, Moderators
Templating possible?
I have a Citrix Netscaler 7000 box that I am trying to get SNMP data. There is a node called serviceTable. I was wondering if it is possible to get build a template to ease data retrieval from this unit.
I ran:
snmptable -c xxx -v2c x.x.x.x serviceTable
The results of this are attached (actually, I chopped off a few columns!!!) in the ns7000.txt file. Also attached (ns7000-oid-svcName.txt) is the OID to get the servicename of the entries in the "table".
Retrival of the values is not too difficult, with the last entries in the OID being a row that has .<#chars in servicename>.<numeric ASCII representation of servicename>.... for example
OID."web1" => <OID>.4.119.101.98.49
OID."web2" => <OID>.4.119.101.98.50, and so on....
I don't like the idea of "hard-coding" the service names; that's why I want to use a query to retrieve the service names and the entries that I care about.
Anyway, this table does not have any index (other than the unique servicenames). Is it possible to build a query index? Or do I have to build the host up one service at a time, by hand, specifying each OID for each service-servicecounter?
thanks for any information,
Mike
I ran:
snmptable -c xxx -v2c x.x.x.x serviceTable
The results of this are attached (actually, I chopped off a few columns!!!) in the ns7000.txt file. Also attached (ns7000-oid-svcName.txt) is the OID to get the servicename of the entries in the "table".
Retrival of the values is not too difficult, with the last entries in the OID being a row that has .<#chars in servicename>.<numeric ASCII representation of servicename>.... for example
OID."web1" => <OID>.4.119.101.98.49
OID."web2" => <OID>.4.119.101.98.50, and so on....
I don't like the idea of "hard-coding" the service names; that's why I want to use a query to retrieve the service names and the entries that I care about.
Anyway, this table does not have any index (other than the unique servicenames). Is it possible to build a query index? Or do I have to build the host up one service at a time, by hand, specifying each OID for each service-servicecounter?
thanks for any information,
Mike
- Attachments
-
- ns7000.txt
- (1.08 KiB) Downloaded 175 times
-
- ns7000-oid-svcName.txt
- (254 Bytes) Downloaded 165 times
Moving to the general forum.
Yea, I'm sure there must be a way... although I'm not exactly an expert like lvm is. A snmpwalk ot servicetable would be handy...
Yea, I'm sure there must be a way... although I'm not exactly an expert like lvm is. A snmpwalk ot servicetable would be handy...
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Attached is the output of
snmpwalk -c xxx -Of -v 2c x.x.x.x serviceTable
for the web services.
Let me know if anything else would help.
thanks,
Mike
snmpwalk -c xxx -Of -v 2c x.x.x.x serviceTable
for the web services.
Let me know if anything else would help.
thanks,
Mike
- Attachments
-
- ns7000-servicetable-snmpwalk.txt
- (10.48 KiB) Downloaded 215 times
Well... It's spring....time for lots of flowers!
I have looked at your walkthrough but did not think it would work because I don't have a numeric index for the services that I want to monitor.
As per your suggestion, I went through with setting up the query in the XML file and was able to get it to see the service names. Right now though, I can't get past step 2.
I get all the columns when I choose to "Create Graphs", but the values are not lined up (in the same row). See the results below. Is this because of a non-numeric index or is it somethings else I'm (not?) doing...?
Also attached is my .xml file. I have played with some of the settings, but did not get any better results.
thanks for your time,
Mike
I have looked at your walkthrough but did not think it would work because I don't have a numeric index for the services that I want to monitor.
As per your suggestion, I went through with setting up the query in the XML file and was able to get it to see the service names. Right now though, I can't get past step 2.
I get all the columns when I choose to "Create Graphs", but the values are not lined up (in the same row). See the results below. Is this because of a non-numeric index or is it somethings else I'm (not?) doing...?
Also attached is my .xml file. I have played with some of the settings, but did not get any better results.
thanks for your time,
Mike
- Attachments
-
- NetscalerServiceTable-IndexProb.PNG (4.21 KiB) Viewed 6712 times
-
- ns-servicetable.xml
- (972 Bytes) Downloaded 201 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Well, your case requires some advanced magic. See http://www.cacti.net/downloads/docs/htm ... y_xml.htmland search for oid_index_parse. A OID/REGEXP should do. To help with that, I need sth like your snmpwalk, but using the ASN.1 notation (the pure numerics, please). From this, a REGEXP should be build, that results in the "strings" being translated into some some.stuff.([0-9]*)$. The Parenthesis should include the "index". Check this using Verbose Query.
Reinhard
Reinhard
Magic... hmm... maybe with some practice
I tried to munge around with the RegEx and did not get good results. I just get a single entry listed (not all the web servers).
I also was looking at the Forum thread of "Cacti SNMP query script"... still did not help....
Attached is a snmpwalk. Let me know if it's the format that you need.
thanks,
Mike
I tried to munge around with the RegEx and did not get good results. I just get a single entry listed (not all the web servers).
I also was looking at the Forum thread of "Cacti SNMP query script"... still did not help....
Attached is a snmpwalk. Let me know if it's the format that you need.
thanks,
Mike
- Attachments
-
- ns7000-servicetable-snmpwalk-numeric.txt
- (4.87 KiB) Downloaded 177 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Fine, this helps. Essentials arewhich leads us to the fact, thatis the index. And is the "base". The XML fields are enumeratedSo let's develop the XML for that. As a starting point, please tryPlease try a Verbose Query against your target and post the outcome. This OID/REGEXP actually is hard-coded against your ServiceNames being 7 characters long. I'd like the should more look likegiving us the index as everything, that follows .1.3.6.1.4.1.5951.4.1.2.1.1, but that was reported to fail in the past.
Reinhard
Code: Select all
svcServiceName
.1.3.6.1.4.1.5951.4.1.2.1.1.1.6.115.51.119.101.98.49 = STRING: "s3web1"
.1.3.6.1.4.1.5951.4.1.2.1.1.1.6.115.51.119.101.98.50 = STRING: "s3web2"
.1.3.6.1.4.1.5951.4.1.2.1.1.1.6.115.51.119.101.98.51 = STRING: "s3web3"
.1.3.6.1.4.1.5951.4.1.2.1.1.1.6.115.51.119.101.98.52 = STRING: "s3web4"
svcIPAddress
.1.3.6.1.4.1.5951.4.1.2.1.1.2.6.115.51.119.101.98.49 = IpAddress: 000.000.000.001
.1.3.6.1.4.1.5951.4.1.2.1.1.2.6.115.51.119.101.98.50 = IpAddress: 000.000.000.002
.1.3.6.1.4.1.5951.4.1.2.1.1.2.6.115.51.119.101.98.51 = IpAddress: 000.000.000.003
.1.3.6.1.4.1.5951.4.1.2.1.1.2.6.115.51.119.101.98.52 = IpAddress: 000.000.000.004
Code: Select all
6.115.51.119.101.98.49
Code: Select all
.1.3.6.1.4.1.5951.4.1.2.1.1
Code: Select all
svcServiceName .1.3.6.1.4.1.5951.4.1.2.1.1.1
svcIPAddress .1.3.6.1.4.1.5951.4.1.2.1.1.2
svcServicePort .1.3.6.1.4.1.5951.4.1.2.1.1.3
svcServiceType .1.3.6.1.4.1.5951.4.1.2.1.1.4
svcServiceState .1.3.6.1.4.1.5951.4.1.2.1.1.5
svcAvgTransactionTime .1.3.6.1.4.1.5951.4.1.2.1.1.7
...
Code: Select all
<interface>
<name>Something</name>
<description>what you want</description>
<index_order_type>numeric</index_order_type>
<oid_index>.1.3.6.1.4.1.5951.4.1.2.1.1.1</oid_index>
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
<fields>
<svcServiceName>
<name>svcServiceName</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.5951.4.1.2.1.1.1</oid>
</svcServiceName>
<svcIPAddress>
<name>svcIPAddress</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.5951.4.1.2.1.1.2</oid>
</svcIPAddress>
<svcEstablishedConn>
<name>svcEstablishedConn</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.5951.4.1.2.1.1.8</oid>
</svcEstablishedConn>
</fields>
</interface>
Code: Select all
<oid_index_parse>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</oid_index_parse>
Code: Select all
<oid_index_parse>OID/REGEXP:\.1\.3\.6\.1\.4\.1\.5951\.4\.1\.2\.1\.1\.(.*)$</oid_index_parse>
Reinhard
Thanks, your XML file reflected what I tried to do in one of my test iterations. I went and tried the different variations you suggested.
It's still doing the same as mentioned before: the IP addresses are one set of rows and the service names are another set.
I bumped up the log level of Cacti to debug. It looks like cacti thinks there are multiple indices(for example: the svcServiceIPAddress and svcServiceName - see attached), though I am not an expert by any means in decrypting the log file ...
Verbose query output is attached as well.
One final thing to note is that I do have a variable length index (service names range from 3-14 characters). I was focusing on the Web entries and planned on extending what I learned to the other services.
thanks,
Mike
It's still doing the same as mentioned before: the IP addresses are one set of rows and the service names are another set.
I bumped up the log level of Cacti to debug. It looks like cacti thinks there are multiple indices(for example: the svcServiceIPAddress and svcServiceName - see attached), though I am not an expert by any means in decrypting the log file ...
Verbose query output is attached as well.
One final thing to note is that I do have a variable length index (service names range from 3-14 characters). I was focusing on the Web entries and planned on extending what I learned to the other services.
thanks,
Mike
- Attachments
-
- cacti-debuglog-snippet2006-04-19.txt
- (15.55 KiB) Downloaded 186 times
-
- cacti-verbosequery2006-04-19.txt
- (6.57 KiB) Downloaded 155 times
More fun stuff from playing around. I noticed that I was getting a "complete" OID as an index. I don't think I want that. I looked at the data_query.php and saw the ereg_replace() call. I looked it up (I am NOT a PHP expert by any means!) and noted that if it finds no match, the string is returned. I then replaced
with
in the xml file and got the following in the verbose query:
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'X:/util/cacti/resource/snmp_queries/ns-servicetable.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.5951.4.1.2.1.1.1'
+ Located input field 'svcServiceName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.5951.4.1.2.1.1.1'
...
+ Found item [svcServiceName='s3web1'] index: "s3web1" [from value]
+ Found item [svcServiceName='s3web2'] index: "s3web2" [from value]
+ Found item [svcServiceName='s3web3'] index: "s3web3" [from value]
+ Found item [svcServiceName='s3web4'] index: "s3web4" [from value]
... etc.
That looks better than before. Still, the remainder of the debug information reports:
+ Located input field 'svcIPAddress' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.5951.4.1.2.1.1.2'
...
+ Found item [svcIPAddress='192.168.100.128'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web1" [from value]
+ Found item [svcIPAddress='192.168.100.129'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web2" [from value]
+ Found item [svcIPAddress='192.168.100.131'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web3" [from value]
+ Found item [svcIPAddress='192.168.100.132'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web4" [from value]
...etc.
Note the index is different for the field (svcIPAddress). Is there something that I am missing/not doing? I have read and reread posts on the forum here and the documentation and not really made any headway as to what might be causing the problem.
thanks,
Mike
Code: Select all
<oid_index_parse>OID/REGEXP:\.1\.3\.6\.1\.4\.1\.5951\.4\.1\.2\.1\.1\.(.*)$</oid_index_parse>
Code: Select all
<oid_index_parse>OID/REGEXP:enterprises\.netScaler\.nsProducts\.rs9000\.nsSvcGroup\.serviceTable\.serviceEntry\.svcServiceName\.(.*)$</oid_index_parse>
+ Running data query [10].
+ Found type = '3' [snmp query].
+ Found data query XML file at 'X:/util/cacti/resource/snmp_queries/ns-servicetable.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.5951.4.1.2.1.1.1'
+ Located input field 'svcServiceName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.5951.4.1.2.1.1.1'
...
+ Found item [svcServiceName='s3web1'] index: "s3web1" [from value]
+ Found item [svcServiceName='s3web2'] index: "s3web2" [from value]
+ Found item [svcServiceName='s3web3'] index: "s3web3" [from value]
+ Found item [svcServiceName='s3web4'] index: "s3web4" [from value]
... etc.
That looks better than before. Still, the remainder of the debug information reports:
+ Located input field 'svcIPAddress' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.5951.4.1.2.1.1.2'
...
+ Found item [svcIPAddress='192.168.100.128'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web1" [from value]
+ Found item [svcIPAddress='192.168.100.129'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web2" [from value]
+ Found item [svcIPAddress='192.168.100.131'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web3" [from value]
+ Found item [svcIPAddress='192.168.100.132'] index: enterprises.netScaler.nsProducts.rs9000.nsSvcGroup.serviceTable.serviceEntry.svcIpAddress."s3web4" [from value]
...etc.
Note the index is different for the field (svcIPAddress). Is there something that I am missing/not doing? I have read and reread posts on the forum here and the documentation and not really made any headway as to what might be causing the problem.
thanks,
Mike
Hmm... maybe I have a rabbit in my hat after all...
based on what I saw (my previous post) and a review of what the PHP was doing, I made the following modification:
changed:
to
and got the servicenames as indexes (s3web1, s3web2, etc):
+ Found item [svcServiceName='s3web1'] index: "s3web1" [from value]
+ Found item [svcServiceName='s3web2'] index: "s3web2" [from value]
+ Found item [svcServiceName='s3web3'] index: "s3web3" [from value]
+ Found item [svcServiceName='s3web4'] index: "s3web4" [from value]
...
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web1" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web2" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web3" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web4" [from value]
...etc.
What's more, this regex works with the other servicenames (some are longer, some are shorter) as well! Don't have to worry about hard coding the indexes!
lvm, thanks for all your help in this. I will be posting a template for the Netscaler once I finish it.
Mike
based on what I saw (my previous post) and a review of what the PHP was doing, I made the following modification:
changed:
Code: Select all
<oid_index_parse>OID/REGEXP:enterprises\.netScaler\.nsProducts\.rs9000\.nsSvcGroup\.serviceTable\.serviceEntry\.svcServiceName\.(.*)$</oid_index_parse>
Code: Select all
<oid_index_parse>OID/REGEXP:enterprises\.netScaler\.nsProducts\.rs9000\.nsSvcGroup\.serviceTable\.serviceEntry\.[A-Za-z0-9]{1,15}\.(.*)$</oid_index_parse>
+ Found item [svcServiceName='s3web1'] index: "s3web1" [from value]
+ Found item [svcServiceName='s3web2'] index: "s3web2" [from value]
+ Found item [svcServiceName='s3web3'] index: "s3web3" [from value]
+ Found item [svcServiceName='s3web4'] index: "s3web4" [from value]
...
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web1" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web2" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web3" [from value]
+ Found item [svcIPAddress='x.x.x.x'] index: "s3web4" [from value]
...etc.
What's more, this regex works with the other servicenames (some are longer, some are shorter) as well! Don't have to worry about hard coding the indexes!
lvm, thanks for all your help in this. I will be posting a template for the Netscaler once I finish it.
Mike
Sorry for the delay... been fairly busy on non-Cacti things... The files are attached, the verbose query has been "sanitized" to protect the guilty.
Mike
Mike
- Attachments
-
- the result for the "Add graphs for this host"
- netscaler-graph host.PNG (44.9 KiB) Viewed 6530 times
-
- verbose-query.txt
- results of the query
- (6.89 KiB) Downloaded 179 times
-
- ns-servicetable.xml
- the xml file...
- (4.54 KiB) Downloaded 320 times
Thanks to everyone who has contributed to this thread. Because of your input, I am now able to propelry index and query against my NetScaler 12000s.
*HOWEVER* - I am not getting any data on my graphs. I used the template uploaded by ironmike, and the OID regex posted by lvm. However, nowhere on this forum is there any information for what Data Templates I should be using to actually get the graphs that I need.
Any requested information will be posted, but I'm not sure what's useful and what's not.
Please help!
--tekbot
*HOWEVER* - I am not getting any data on my graphs. I used the template uploaded by ironmike, and the OID regex posted by lvm. However, nowhere on this forum is there any information for what Data Templates I should be using to actually get the graphs that I need.
Any requested information will be posted, but I'm not sure what's useful and what's not.
Please help!
--tekbot
Who is online
Users browsing this forum: No registered users and 1 guest