Doing math on SNMP values before storing in RRD

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

Moderators: Developers, Moderators

Post Reply
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Doing math on SNMP values before storing in RRD

Post by malgoe »

Hi,

I'm using Cacti to monitor a bunch of network probes (Accedian EtherNID and MetroNID) and built my own templates for this, which is working fine. I do have one problem:

Delay values are returned in micro-seconds and percentage values (i.e. packet loss) is returned in hundreds of a percent. I would like to change these values (micro-seconds to milli-seconds and hundreds of a percent to percent) before storing them. I've been loking for some way to do math with regexp in the query xml file, but I have had no success so far.

Could someone help me to come up with a solution? :)

(The reason for wanting to do this is that, i.e. a delay of 10mS is now displayed as "10k-uS". Not particurlarly pretty :P)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Doing math on SNMP values before storing in RRD

Post by BSOD2600 »

Alternatively, you keep the values returned via SNMP and instead use a CDEF to apply the appropriate math for the unit conversion. The various traffic graphs already do this for an example.
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Doing math on SNMP values before storing in RRD

Post by malgoe »

Thank you! That solves my problem perfectly! :)
sseepaul
Posts: 2
Joined: Sat Oct 29, 2011 9:46 pm
Location: Trinidad and Tobago

Re: Doing math on SNMP values before storing in RRD

Post by sseepaul »

Do you mind sharing this template? I'd like to monitor some of the NIDs and Nodes we have as well. Also, does your template provide optical light levels from the Accedian devices?
Thanks,
Shastri - CCNA, JNCIA-Junos, JNCIA-FWV, JNCIS-SEC
_____________________________________________

Cacti Version 0.8.7g
PIA, Aggregate, Ipsubnet, Realtime, Nectar, Thold
snasre
Posts: 36
Joined: Thu May 29, 2014 5:21 pm

Re: Doing math on SNMP values before storing in RRD

Post by snasre »

Would you mind sharing the template for Accedian NID


Thanks
Sanket
hoteldebotel
Posts: 1
Joined: Mon Nov 28, 2016 8:07 am

Re: Doing math on SNMP values before storing in RRD

Post by hoteldebotel »

Does anyone have a Cacti template for Accedian MetroNID's? Looking to add graphing for my PAA-probes.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest