Discussion:
[cricket-users] negative value for a db
John Hutchinson
2009-05-15 14:40:50 UTC
Permalink
I am trying to monitor a radio that returns a db reading in a negative
number can someone help me in how to tell cricket collector to multiply
the number by -1 before passing it to rrd so that it can be shown on
the graph?


here is a copy of my default config.

Target --default--
inst = %suid%
snmp-community = XXXXXX
snmp-host = %ap%
target-type = Subscriber-Unit

# OID's we'll be using in this tree
OID ifInOctets 1.3.6.1.4.1.5454.1.20.3.6.1.22
OID ifOutOctets 1.3.6.1.4.1.5454.1.20.3.6.1.23
OID RSSIfrAP 1.3.6.1.4.1.5454.1.20.3.6.1.16

datasource ifInOctets ds-source = snmp://%snmp%/ifInOctets.%inst%
datasource ifOutOctets ds-source = snmp://%snmp%/ifOutOctets.%inst%
datasource RSSIfrAP
ds-source = snmp://%snmp%/RSSIfrAP.%inst%
rrd-ds-type = ABSOLUTE
rrd-min = undef
rrd-max = undef

targetType Subscriber-Unit
ds = "ifInOctets, ifOutOctets, RSSIfrAP"
view = "Octets: ifInOctets ifOutOctets,
RSSI: RSSIfrAP"

# graph params for ifInOctets and ifOutOctets come from above



and an example of a target

target su.XXX
suid = 8
short-desc = "XXXX"
ap = "XXXXX"

the X's are just there to cover up what my company may concider private
information


John Hutchinson
Michael Tiarnaigh
2009-05-15 16:09:12 UTC
Permalink
Oops! I meant to reply to the entire list on this one in case others
come across the same issue and this may be of help. I replied only to
John originally by mistake. :-) Below is my response.


Hi John.
I actually ran into a similar issue recently enough when trying to
monitor some of our transmission links across our network. I wanted to
graph RSL-Fade margins values on some of our links whose values were
returned as negative integer values. The solution was simple as it
turned out (After a bit of digging in the RrdTool docs of course).

All you have to do is set the "rrd-min" value when you first define your
data sources to be a negative value (In my case, I set the rrd-min as
-256, and the rrd-max as 50. You can change this as needed). For
instance, here's how I defined my data source for RSL values:


target --default--
snmp-community = ###### (Use correct string here of
course)
snmp-host = %auto-target-name%
target-type = ###### (Likewise)

datasource --default--
rrd-ds-type = GAUGE
rrd-heartbeat = 1800
rrd-poll-interval = 600

datasource rsl
ds-source =
exec::"/usr/local/cricket/cricket/util/Transmission/getRsl.sh
%auto-target-name%"
rrd-ds-type = GAUGE
rrd-min = -256 (Make sure this is a neg value)
rrd-max = 50

graph rsl
color = dark-green
draw-as = LINE2
y-axis = "RSL"
legend = "rsl (dBm)"


The getRsl.sh exec script above simply does the following:

#!/usr/local/bin/bash
rxRslNeg=`/usr/local/bin/snmpget -v2c -c ###### -Ovq $1 snmpOIDUsed`

rxRsl=`echo "scale=3; (("$rxRslNeg " / 100))" | bc` echo $rxRsl


In your case, you probably don't need an exec script, but instead just
use the OID as you have. I just had to do a basic calculation on my
return value, as the value returned via SNMP was something like "-6020",
so all my shell script is doing is converting this to "-60.230", as it
should be.

Hope that points you in the right direction.

Kind regards,
Micheal Tiarnaigh.


-----Original Message-----
From: John Hutchinson [mailto:***@upnorth.net]
Sent: 15 May 2009 15:41
To: cricket-***@lists.sourceforge.net
Subject: [cricket-users] negative value for a db

I am trying to monitor a radio that returns a db reading in a negative
number can someone help me in how to tell cricket collector to multiply
the number by -1 before passing it to rrd so that it can be shown on
the graph?


here is a copy of my default config.

Target --default--
inst = %suid%
snmp-community = XXXXXX
snmp-host = %ap%
target-type = Subscriber-Unit

# OID's we'll be using in this tree
OID ifInOctets 1.3.6.1.4.1.5454.1.20.3.6.1.22
OID ifOutOctets 1.3.6.1.4.1.5454.1.20.3.6.1.23
OID RSSIfrAP 1.3.6.1.4.1.5454.1.20.3.6.1.16

datasource ifInOctets ds-source =
snmp://%snmp%/ifInOctets.%inst%
datasource ifOutOctets ds-source =
snmp://%snmp%/ifOutOctets.%inst%
datasource RSSIfrAP
ds-source = snmp://%snmp%/RSSIfrAP.%inst%
rrd-ds-type = ABSOLUTE
rrd-min = undef
rrd-max = undef

targetType Subscriber-Unit
ds = "ifInOctets, ifOutOctets, RSSIfrAP"
view = "Octets: ifInOctets ifOutOctets,
RSSI: RSSIfrAP"

# graph params for ifInOctets and ifOutOctets come from above



and an example of a target

target su.XXX
suid = 8
short-desc = "XXXX"
ap = "XXXXX"

the X's are just there to cover up what my company may concider private
information


John Hutchinson

------------------------------------------------------------------------
------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
John Hutchinson
2009-05-15 16:32:00 UTC
Permalink
i put this in my default and now i am getting .74 for a -74

John
Post by John Hutchinson
I am trying to monitor a radio that returns a db reading in a negative
number can someone help me in how to tell cricket collector to multiply
the number by -1 before passing it to rrd so that it can be shown on
the graph?
You can't really modify the number before it is stored, but you can
modify it before graphing. For the datasource, you should have an entry
graph RSSIfrAP
scale = -1,*
The "scale" entry is an RPN operation to apply to the data before
graphing.
If you really want to have a modified value stored, I think the only way
currently to do that is to store the unmodified value and then make a
COMPUTE datasource that does the modification (but that's overly
complicated for what you are doing).
John Hutchinson
2009-05-15 17:09:26 UTC
Permalink
Nevermind my last post i had the wrong rrd-ds-type
Thanks everyone for the help it looks like it works now
John
Post by John Hutchinson
i put this in my default and now i am getting .74 for a -74
John
Post by John Hutchinson
I am trying to monitor a radio that returns a db reading in a
negative number can someone help me in how to tell cricket collector
to multiply the number by -1 before passing it to rrd so that it
can be shown on the graph?
You can't really modify the number before it is stored, but you can
modify it before graphing. For the datasource, you should have an entry
graph RSSIfrAP
scale = -1,*
The "scale" entry is an RPN operation to apply to the data before
graphing.
If you really want to have a modified value stored, I think the only way
currently to do that is to store the unmodified value and then make a
COMPUTE datasource that does the modification (but that's overly
complicated for what you are doing).
Continue reading on narkive:
Loading...