Multiple SNMP data sources with a single data template?

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

Moderators: Developers, Moderators

Post Reply
JawsShark

Multiple SNMP data sources with a single data template?

Post by JawsShark »

So I've set up a data template to fetch some (non-indexed) SNMP data. It makes sense to me to use a single data template to grab several pieces of SNMP data, but whenever I create the second data source and enter the OID, the first data source's OID changes too.

Do I not have the right concept in mind? Is this only possible with indexed data? Is this a bug?

Any help and/or insight would be greatly appreciated.
JawsShark

Post by JawsShark »

Bump .... Larry? Ian?
pvd
Posts: 30
Joined: Sat Aug 09, 2003 3:02 pm

multiple SNMP OIDS

Post by pvd »

I have a similar requirement. I am using cacti to log several parameters for an wireless internet access product. So there are several oids to read. throughput, RSSI, SNR both for upstream and downstream, temperature. Not all of these are interface parameters, Clearly these cant be done with an indexed snmpget. I could ( and am ) write a perl script to do the snmp gets. That can then be used as a scripted data capture. However it would be nice if there was another method that would get several OIDs in one item.

Phil
Phil
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I would utilize the PHP script_server and then return, in 1 query, information in the following format:

ItemA:ValueA ItemB:ValueB ItemC:ValueC....

Then your Data Source names (similar to Interface Traffic) would be:

ItemA, ItemB, ItemC, etc...

This is the best way to combine Data Source elements into a single RRD file.

TheWitness
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?
JawsShark

Post by JawsShark »

Thanks for the reply, TheWitness.

I took a look at the Script Server documentation and it looks like it's actually a lot more complex then I'd like it to be. It *seems* like I should be able to grab the 4 SNMP values I want with a standard get SNMP data method, and I can in fact create a data template that has four data sources, but setting or changing an SNMP value for a single DS affects all the other DSes. Since this is a case of "Cacti doesn't work like I think it should", I'm actually wondering if this is a) a bug, or b) I'm using cacti incorrectly. I'm not anywhere near "critical mass" in terms of my cacti queries (where the queries and updating the RRDs take longer then my polling period), I'll likely write a little Perl script to get the SNMP values I want and hand them back to cacti in the format cacti wants, but I still wonder why cacti presents an option for something but it then doesn't work the way I think it should.

All in all, though, please know that I think Cacti is a fabulous piece of open source software. The functionality and "fit and finish" of it rivals what I think of as commercial products, and it certainly sets new standards for open source stuff.

JawShark
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Look at the load_avg.pl script in <cacti>/scripts. It is quite simple to implement a script server version of this. It appears in Cacti as a data input method with a corresponding data template. It is easier than you think.

Again, try to figure out the load_avg first and then you can work on script server. Not too bad.

TheWitness
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?
Guest

Post by Guest »

Okay. I still don't understand why this particular feature of cacti does not work like I think it should, and I would love to know why that is. I am open to the possibilty that I am misunderstanding how it's supposed to work, but so far no one has said that.
pvd
Posts: 30
Joined: Sat Aug 09, 2003 3:02 pm

Post by pvd »

Thanks for the reply. I can see that the php scripting solution would work, and really is a good way to do a general lookup. If only I was a php code expert. I guess if I'm honest I am being very lazy, and dont want to write code. I would really like a window in cacti, that automates the process so that I can give cacti a list of oids and names, and it will collect them.

Cacti is so good at providing graphs without programing knowledge, I suspect that many of your "users" are like me far from being programing experts.

Oh well better get the perl for beginners book back out for now.

Phil
Phil
pvd
Posts: 30
Joined: Sat Aug 09, 2003 3:02 pm

Post by pvd »

OK - one of my colleagues has spent litterally days and days getting the indexing stuff to work. Perhaps because some of it is not well documented, and perhaps because its just hard. Now we have it working its easy to use for VectaStar, BUT if I want to add a new device and pick up 3 or 4 oids, I'm going to have to spend several hours working out how. The suggestions in this thread of having a snmp query that collects several oids into one rra and allow graphing them are I agree not pretty coding, but for the more utilitarian out there would be useful
Phil
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest