Dettach and attach XML scripts
Moderators: Developers, Moderators
Dettach and attach XML scripts
Hi,
I´m looking over Cacti and I realized that the original interface.xml was modified and attached in a graph template.
Now I´m trying to do a step back and return interface.xml in its original form (it means interface.xml as shipped in the Cacti dist).
But it´s not so easy... I´ve tried create a new data query with specific OIDs, dettach snmp interface statistics and attach this new data query to the same data_template. Cacti allow this, but I wonder there is only one data template to each data query... does it make sense?
I´m looking over Cacti and I realized that the original interface.xml was modified and attached in a graph template.
Now I´m trying to do a step back and return interface.xml in its original form (it means interface.xml as shipped in the Cacti dist).
But it´s not so easy... I´ve tried create a new data query with specific OIDs, dettach snmp interface statistics and attach this new data query to the same data_template. Cacti allow this, but I wonder there is only one data template to each data query... does it make sense?
rgds,
Edgar Shine
Edgar Shine
Re: Dettach and attach XML scripts
I've done something similar; where I had to use enterprise-specific OIDs to get 64-bit interface counters. I am fairly certain that yes, you also need to make new data sources to be associated with the new data query. It's not that much work to do so. You don't have to make new Graph templates, though.eshine wrote:Hi,
I´m looking over Cacti and I realized that the original interface.xml was modified and attached in a graph template.
Now I´m trying to do a step back and return interface.xml in its original form (it means interface.xml as shipped in the Cacti dist).
But it´s not so easy... I´ve tried create a new data query with specific OIDs, dettach snmp interface statistics and attach this new data query to the same data_template. Cacti allow this, but I wonder there is only one data template to each data query... does it make sense?
A little bit different. Probably you didn´t have to migrate from a xml script to another, since interface.xml support 64 bit counters also for traffic.
In my case I don´t need to change the rrd db structure, since I´m collecting the same OID. I want just migrate from a xml file (interface.xml) to another (that I´ve called cisco_interface.xml), using the same graph template, host template and data source struct and look the same rrd files to graph then.
Do you think it´s possible?
Thanks for your comments.
In my case I don´t need to change the rrd db structure, since I´m collecting the same OID. I want just migrate from a xml file (interface.xml) to another (that I´ve called cisco_interface.xml), using the same graph template, host template and data source struct and look the same rrd files to graph then.
Do you think it´s possible?
Thanks for your comments.
rgds,
Edgar Shine
Edgar Shine
Nope, I did have to make a new XML file (note I said I needed enterprise OIDs). The device in question did not have the standard ifHC* counters.eshine wrote:A little bit different. Probably you didn´t have to migrate from a xml script to another, since interface.xml support 64 bit counters also for traffic.
In my case I don´t need to change the rrd db structure, since I´m collecting the same OID. I want just migrate from a xml file (interface.xml) to another (that I´ve called cisco_interface.xml), using the same graph template, host template and data source struct and look the same rrd files to graph then.
Do you think it´s possible?
Thanks for your comments.
But, I was incorrect on one note there; you will not have to make new Data Queries . Sorry 'bout that! I was thinking that I did, since I made some graphs that did not use the data in that Data Query.
So, what you'd do is:
- Make the new XML file
- Make a new Data Query to use it (might as well keep the existing one there, you might need it!) named "Cisco SNMP - Interface Statistics" or the like.
- Assuming that you like the existing traffic graphs, make the new Associated Graph templates. You can basically make them exactly as you see already with the existing "SNMP - Interface Statistics" Data Query, but of course, you only need to make the templates of the graphs you are interested in making.
- Add this Data Query to your host template instead of the "SNMP - Interface Statistics" Data Query
- Add this Data Query to existing hosts
- Make graphs!
Now,
If your question is "I have existing graphs, and I want to have them use a different Data Query" then that it a bit tricky. You can change the Data Source of a graph easily enough, but you need to make sure you have the Data Source that corresponds with your new Data Query. I guess making a new graph with that new Data Query should do that. You could also export/reimport your data.
FYI,
Almost...dgamble wrote: If your question is "I have existing graphs, and I want to have them use a different Data Query" then that it a bit tricky. You can change the Data Source of a graph easily enough, but you need to make sure you have the Data Source that corresponds with your new Data Query. I guess making a new graph with that new Data Query should do that. You could also export/reimport your data.
FYI,
In fact, I've changed the interface.xml, appending new lines in the script, that collects private enterprise OIDs from Cisco Devices. And I use the standards OIDs (traffic) as well. I did some host/data/graph templates and create some graphs (around 100) in 23 devices.
After some practice, I realized that it's not the right way, and decided migrate to an escalable (and more organized) way. So I parsed the private Cisco OID to a file called cisco_interface.xml and added it as a new data query, linking it to the graph template I use for this OIDs. I added this query to all existing devices and a host template (Cisco Errors).
And here is where the problem begins... I couldn't just uncheck the box in the associated data template linked to interface.xml objects and check the box to other associated data template linked to cisco_interface.xml.
I'm attaching 2 screenshots to illustrate.
Thanks again for your attention.
- Attachments
-
- this modified interface.xml data query is working actually.
- data_query_1.jpg (116.34 KiB) Viewed 4239 times
-
- this is the new data_query I want to replace part of modified interface.xml data query.
- data_query_2.jpg (106 KiB) Viewed 4239 times
rgds,
Edgar Shine
Edgar Shine
OK, looks like you're almost there!
I would just undo your changes to the "SNMP - Interface Statistics" query. You can just drop the entire Graph Template that you've added to it (so go back one screen from the screenshot, and delete it). There's no real reason why you have to do this, though- you can associate those output values in multiple graph templates.
Then for your new Data Query, just match up the output value in each drop-down with the corresponding data source. Is the problem that you don't see all of the output values in the drop-down? If so, then there is likely a problem with your XML.
Hope this helps!
I would just undo your changes to the "SNMP - Interface Statistics" query. You can just drop the entire Graph Template that you've added to it (so go back one screen from the screenshot, and delete it). There's no real reason why you have to do this, though- you can associate those output values in multiple graph templates.
Then for your new Data Query, just match up the output value in each drop-down with the corresponding data source. Is the problem that you don't see all of the output values in the drop-down? If so, then there is likely a problem with your XML.
Hope this helps!
Wow, you're too fast in your replies...
My first thought matches yours...
I've tried undo and remove completely this OID from SNMP Interface data query and attach the new data query. As you can see, the internal data sources names are exactly the same. Match the drop-down values, don't forget check the box...
I see all output values in the box.
But, after this and a "clear poller cache" under "system utilities", the respective data sources is not populated anymore.
One additional info is that I use both SNMP Interface and Cisco Data queries in my devices, since I want both private enterprise OIDs and standard OIDs (InOctets/OutOctets). See another screen shot.
My first thought matches yours...
I've tried undo and remove completely this OID from SNMP Interface data query and attach the new data query. As you can see, the internal data sources names are exactly the same. Match the drop-down values, don't forget check the box...
I see all output values in the box.
But, after this and a "clear poller cache" under "system utilities", the respective data sources is not populated anymore.
One additional info is that I use both SNMP Interface and Cisco Data queries in my devices, since I want both private enterprise OIDs and standard OIDs (InOctets/OutOctets). See another screen shot.
- Attachments
-
- this is a existing device. I just add another data query to poll. It theory, it should use both data queries in this device.
- devices_cisco.jpg (117.56 KiB) Viewed 4228 times
rgds,
Edgar Shine
Edgar Shine
I am not sure if having the same internal names for each of the XML values will be a problem. Someone else might be able to help with this. I would recommend having distinct names anyway to aid troubleshooting, at the least.
If you're not getting data, you should bump up your logging to "MEDIUM" to see the SNMP values that you're getting, or even if they are getting polled.
I personally have had problems on several occasions where cacti does not even try to get the data for certain Data Source Query graphs. This is accompanied by cacti not "greying-out" the graphs when they are created. I have no idea why this happens, sorry. Hopefully this is not what is happening to you.
If you're not getting data, you should bump up your logging to "MEDIUM" to see the SNMP values that you're getting, or even if they are getting polled.
I personally have had problems on several occasions where cacti does not even try to get the data for certain Data Source Query graphs. This is accompanied by cacti not "greying-out" the graphs when they are created. I have no idea why this happens, sorry. Hopefully this is not what is happening to you.
If I change the internal data source name, I'll need to create new graph templates to link this.
Think this will work, but I'll need to change each existing device to point this new graph template, create graphs and link each data source to the old file.
After a poller cache cleaning the new data query is not being polled, because they're not even listed in the poller cache. If I create a new device the data queries are applied correctly and all data is collected. But I need to link the old existing devices also in this new data query.
Many thanks for your help.
Think this will work, but I'll need to change each existing device to point this new graph template, create graphs and link each data source to the old file.
After a poller cache cleaning the new data query is not being polled, because they're not even listed in the poller cache. If I create a new device the data queries are applied correctly and all data is collected. But I need to link the old existing devices also in this new data query.
Many thanks for your help.
rgds,
Edgar Shine
Edgar Shine
No problem. Good to know I could help!eshine wrote: After a poller cache cleaning the new data query is not being polled, because they're not even listed in the poller cache. If I create a new device the data queries are applied correctly and all data is collected. But I need to link the old existing devices also in this new data query.
Many thanks for your help.
If someone could help...
In the attached file, you can see that data source have a drop-down field called "output id", with some values. How do this values appear? How can I change (add or remove value) this?
In the attached file, you can see that data source have a drop-down field called "output id", with some values. How do this values appear? How can I change (add or remove value) this?
- Attachments
-
- I don't know how to change this "output id"... it is linked to the old data query.
- data_source_cisco.jpg (111.42 KiB) Viewed 4220 times
rgds,
Edgar Shine
Edgar Shine
In your Data Query XML file, any of your <fields> entities with a <direction> of "output" will appear here. If you're missing one that you're expecting to show up, it has the wrong direction, or there's some error with the XML.eshine wrote:If someone could help...
In the attached file, you can see that data source have a drop-down field called "output id", with some values. How do this values appear? How can I change (add or remove value) this?
Hmmm... but I don't have anything called "If Cisco Errors" in my XML scripts and it appears in the drop-down menu...
Think this name is related to "Associated Data Template" in Data Query menu. See attached screenshot. Does it make sense?
Thanks again for your kind attention.
Think this name is related to "Associated Data Template" in Data Query menu. See attached screenshot. Does it make sense?
Thanks again for your kind attention.
- Attachments
-
- my wrong snmp data query... one day I''ll be able to fix this. :P
- snmp_interface_data_query.jpg (119.31 KiB) Viewed 4205 times
rgds,
Edgar Shine
Edgar Shine
Screenshots help a lot, yes!eshine wrote:Hmmm... but I don't have anything called "If Cisco Errors" in my XML scripts and it appears in the drop-down menu...
Think this name is related to "Associated Data Template" in Data Query menu. See attached screenshot. Does it make sense?
Thanks again for your kind attention.
The title there is, well, just a name for the association with the graph template and the data query, that you yourself put in. If you're not going to use the graph template "Cisco - Interface Errors (errors/s)" with this data query anymore, go ahead and hit that little red X.
Are you sure you're looking at the XML file listed in the "XML Path"?
Who is online
Users browsing this forum: No registered users and 2 guests