Dettach and attach XML scripts

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Dettach and attach XML scripts

Post by eshine »

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?
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Re: Dettach and attach XML scripts

Post by dgamble »

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?
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
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

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. :wink:

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
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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. :wink:

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.
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.

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,
eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

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,
Almost... :D
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.
this modified interface.xml data query is working actually.
data_query_1.jpg (116.34 KiB) Viewed 4034 times
this is the new data_query I want to replace part of modified interface.xml data query.
this is the new data_query I want to replace part of modified interface.xml data query.
data_query_2.jpg (106 KiB) Viewed 4034 times
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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!
eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

Wow, you're too fast in your replies... :o
8)
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... :wink:
I see all output values in the box. 8)

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.
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 4023 times
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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. :(
eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

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. :)
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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. :)
No problem. Good to know I could help!
eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

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?
Attachments
I don't know how to change this "output id"... it is linked to the old data query.
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 4015 times
rgds,
Edgar Shine
eshine
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

More env info:
- Cacti 0.8.6g
- Cactid 0.8.6f
- Linux Slack 10
- Net-SNMP 5.2.1 (package)
- PHP 4.3.10 (package)
- Apache 1.3.33 (package)
- MySQL 4.1.11
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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?
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
Posts: 30
Joined: Fri Feb 25, 2005 11:38 am
Location: Sao Paulo - Brazil

Post by eshine »

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.
Attachments
my wrong snmp data query... one day I''ll be able to fix this. :P
my wrong snmp data query... one day I''ll be able to fix this. :P
snmp_interface_data_query.jpg (119.31 KiB) Viewed 4000 times
rgds,
Edgar Shine
dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Post by dgamble »

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.
Screenshots help a lot, yes!

The title there is, well, just a name for the association with the graph template and the data query, that you yourself put in. :wink: 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"?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest