Graphing a script that loops a random number of times?

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

Moderators: Moderators, Developers

Post Reply
Author
Message
RustedKnight
Posts: 38
Joined: Fri Mar 18, 2016 8:49 am

Graphing a script that loops a random number of times?

#1 Post by RustedKnight » Fri Jun 28, 2019 6:58 am

I need to pull some unique info of of a device. I have torn the MIB files apart multiple times and there are no OID's that poll the information I need. I am however able to telnet into the device to see the data. Think interface statistics, one version of the device may have 4 interfaces, another device may have 7 interfaces. I have a script that ouputs a line of data in the correct format for each interface. Is there a way to take a script that may have multiple lines of output and create a graph for each line of output. Below I have an example of what I am looking for. Note, this is not the actual data I'm looking at, just a way to conceptualize what I am looking for.

Sample Output
ifName:Eth0 Inputframes:200 Outputframes:160
ifName:Eth1 Inputframes:613 Outputframes:307
ifName:Eth2 Inputframes:337 Outputframes:474

Desired Graphs
Graph 1: eth0 inputframes vs outputframes
Graph 2: eth1 inputframes vs outputframes
Graph 3: eth2 inputframes vs output frames

netniV
Cacti Guru User
Posts: 3020
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphing a script that loops a random number of times?

#2 Post by netniV » Mon Jul 01, 2019 5:17 pm

Take a look at the interface graphs as they pretty much do this already.

RustedKnight
Posts: 38
Joined: Fri Mar 18, 2016 8:49 am

Re: Graphing a script that loops a random number of times?

#3 Post by RustedKnight » Tue Jul 02, 2019 4:26 am

I get that the interface statistics will get the info I gave as an example. However bandwidth is not what I'm actually tracking. I'm looking to get information from proprietary sensor packs via the connected controllers at a chemical plant. The controller does not have snmp capability beyond sending traps nor does he operating system have the ability to set up snmp. It just has a web interface, ssh, and telnet access. Now, each controller can have multiple sensor packs attached depending on installation needs. We have multiple controllers and sensor packs deployed through our network. These packs detect things like temperature, Oxygen levels, Carbon Monoxide levels, Carbon Dioxide Levels, smoke levels, and more. The number of sensor packs attached to the controller varies. We have one controller with 3 sensor packs, one controller with 8 sensor packs, one controller with 5 sensor packs, just to describe a few. I decided it would be easier to explain my goal with terminology networkers would understand.

I already have a python script that logs into the controllers and grabs the information and provides a line of output per sensor pack for each controller. What I need to do is grab that information and import it into cacti for data tracking beyond 30 days thanks to new government regulations. I figured our existing cacti system would be perfect for this if I can get the data brought in.

I did take your suggestion and looked at the interface statistics graphs, they pull things in via snmp not a script.

tertius
Cacti User
Posts: 72
Joined: Wed Mar 01, 2017 2:34 pm

Re: Graphing a script that loops a random number of times?

#4 Post by tertius » Tue Jul 02, 2019 10:23 am

Cacti has a script interface that enables any data being read. Not only snmp. How to create such scripts and integrate them into cacti, see this chapter of the cacti documentation: https://docs.cacti.net/manual:100:3a_ad ... ced_topics

Post Reply