TECHZEN Zenoss User Community ARCHIVE  

Manipulate a data source before committed?

Subject: Manipulate a data source before committed?
Author: [Not Specified]
Posted: 2015-05-01 17:11

Hello all,

I have an issue when collecting temperature sensors on a switch. I wrote a custom snmp modeler plugin and its working just fine in that it collects each of the sensors and it uses the snmpindex to walk through each of the sensors in the system. The template gets applied just fine and I'm getting data.
Its really just following the online developer guide, but not a Netbotz device...its a switch. So the OIDs are slightly different, but the general format is exactly the same.

....

The issue I have is that the temperature is given as an integer for degrees Celsius but it needs to be divided by 10 to move the decimal point over to be represented accurately.

For example, snmpget on the oid I get 354 as the value, but its really 354/10 = 35.4 degrees Celsius.
But when the monitoring template is setup to get the OID...it stores the value as 354. How do I get it to do the /10 and store it that way

I can get this to represent appropriately under the Graph Point by using the RPN field and using: 10,/ to get the correct value. But then this doesn't help my thresholds and the event shows up with the 354...which is meltdown temperature (or at least the OPs people monitoring will think that :-) )

The issue is, the actual data point is incorrect and my thresholds are using the 'real integer' of 354.

How do I manipulate the data point so that it gets stored/treated as 354/10 (35.4) and so my thresholds and graphing can be left fairly default

thanks,

-J



Subject: I was looking at a similar
Author: [Not Specified]
Posted: 2015-05-12 12:29

I was looking at a similar problem today, specifically the hrSystemUptime metric returned from windows boxes is in milliseconds not TimeTicks (1/100 sec) so it needs to be divided by 10 before used. But it's not being used in an RRD graph where it can be modified (as you found out). The Zenoss documentation says, for data source type GAUGE: "GAUGE - Does not save the rate of change, but saves the actual value. There are no divisions or calculations." So it looks like this needs to be done in source.

If you want to go that route it's File: /opt/zenoss/Products/ZenRRD/zenperfsnmp.py
Function: def _fetchPerfChunk
around line 300 there is code:

for oid, value in dict(update_x).items():
update[oid.strip('.')] = value

That's where you would update "value".

My problem is complicated by the fact that it looks like newer windows (2008 R2 and above) have fixed the timeticks/milliseconds issue and thus I need to pass over some parameter to this function to tell the difference. That's done in: /opt/zenoss/Products/ZenHub/services/SnmpPerformanceConfig.py

I'd be interested to know if there's a better way to deal with Microsoft hrSystemUptime braindeadedness.



Subject: You could use the Calculted
Author: Jane Curry
Posted: 2015-05-14 08:46

You could use the Calculated Performance ZenPack (which prereqs the Python Collector ZenPack) to create new datapoints that are a combination of datapoints, arithmetc functions and object attributes.
http://wiki.zenoss.org/ZenPack:Calculated_Performance

Cheers,
Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



< Previous
URL device search not working properly
  Next
sending events with additional fields using the REST API
>