Re: negative value for a db

"Michael Tiarnaigh" <[email protected]> Fri, 15 May 2009 17:09:12 +0100
Newsgroups gmane.network.cricket.user
Message-ID <[email protected]>
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:[email protected]] 
Sent: 15 May 2009 15:41
To: [email protected]
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
_______________________________________________
cricket-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cricket-users

------------------------------------------------------------------------------
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