HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
wpgeronimo
Posts: 13
Joined: Tue Nov 07, 2023 12:31 am

HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Post by wpgeronimo »

Hi
how do i create a new xml file to graph my upstream_snr in my cacti server cli
my cacti version is latest 1.2.25

hope to hear from others

Thank you.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Post by TheWitness »

Those XML files have to be written by hand. We had talked about moving it all to the database years ago, but we never committed to a project to implement it as such.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
wpgeronimo
Posts: 13
Joined: Tue Nov 07, 2023 12:31 am

Re: HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Post by wpgeronimo »

TheWitness wrote: Fri Dec 22, 2023 12:18 pm Those XML files have to be written by hand. We had talked about moving it all to the database years ago, but we never committed to a project to implement it as such.
But how do i create the file? Is there any template to paste it on the file? I need the graph of upstream_snr and other xml file that do not have in the default after installation.

Thanks,
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Post by Osiris »

I normally use vim and take something close as a starting point, maybe a related data query and go from there. You start with:

1) What input data do I need to collect. This could be called object metadata.
2) What output data can be provided. This data is always numeric like temperature, voltage, bytes, etc.
3) Is all that data and metadata provided by SNMP and is it in a good table format from the vendor. If not, I go with the script server approach.
4) What is the primary key? Is it reliable. Avoid, for example, is not reliable.

From that you construct

1) The XML file itself,
2) The script if using either script query or script server query,
3) The Data Query to ensure everything in the XML file checks out,
4) The Data Templates followed by Graph Templates. I normally do them in sets.
5) Mapping the Graph Templates to the Data Query,
6) Then, test on one good Device to ensure it's to you liking,
7) Audit the Data to Ensure it's actionable (Thold plugin),
8) Apply to the Device Template,
9) Sync the Device Template to Devices,
10) Write automation rules for Graphs and Trees (if applicable).

This should all be laid out in the documentation. The first few you write appear hard, but after a while, you cloud write a dozen a day.
Before history, there was a paradise, now dust.
wpgeronimo
Posts: 13
Joined: Tue Nov 07, 2023 12:31 am

Re: HOW TO CREATE AN XML FILE TO SNMP DATA QUERY FROM PATH: /resource/snmp_queries/

Post by wpgeronimo »

Osiris wrote: Sat Dec 23, 2023 10:54 am I normally use vim and take something close as a starting point, maybe a related data query and go from there. You start with:

1) What input data do I need to collect. This could be called object metadata.
2) What output data can be provided. This data is always numeric like temperature, voltage, bytes, etc.
3) Is all that data and metadata provided by SNMP and is it in a good table format from the vendor. If not, I go with the script server approach.
4) What is the primary key? Is it reliable. Avoid, for example, is not reliable.

From that you construct

1) The XML file itself,
2) The script if using either script query or script server query,
3) The Data Query to ensure everything in the XML file checks out,
4) The Data Templates followed by Graph Templates. I normally do them in sets.
5) Mapping the Graph Templates to the Data Query,
6) Then, test on one good Device to ensure it's to you liking,
7) Audit the Data to Ensure it's actionable (Thold plugin),
8) Apply to the Device Template,
9) Sync the Device Template to Devices,
10) Write automation rules for Graphs and Trees (if applicable).

This should all be laid out in the documentation. The first few you write appear hard, but after a while, you cloud write a dozen a day.
Good day,

Thank you for this guide maybe it will take some time to study on how to create xml file but i need a template only for
the upstream_snr of the device to put on a data query path and create a graph for SNR.

Happy holidays!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests