Hi, i had similar problem however I don't think my sollution is suitable for you. One type of my devices returned "normal operation" and "active alarm" strings instead of simple 0/1. I made custom alphabet of 40 characters and changed thde snmp plugin. Now if it finds a string in returned gauge value it takes first 11 characters and converts it to 32 bit integer. In the frontend application I have simple parser to convert it back to string.
Advantage of this approach is that it lets you use threshold plugin on the returned values or visualize them as a chart. I think main disadvantage is the 11 characters constraint. Other disadvantage is the need of modification both collectd and frontend application. I could make a patch from my sollution if you'd be interested. Kind regards, Jan Vitek 2016-02-29 12:00 GMT+01:00 <[email protected]>: > Send collectd mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.verplant.org/listinfo/collectd > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of collectd digest..." > > > Today's Topics: > > 1. how to collect string values with snmp plugin (Niels Tomey) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 29 Feb 2016 15:58:12 +0800 > From: Niels Tomey <[email protected]> > To: [email protected] > Subject: [collectd] how to collect string values with snmp plugin > Message-ID: > <CALhsmHOTvbw-qz_a-= > [email protected]> > Content-Type: text/plain; charset="utf-8" > > I would like to have collectd parse text values such as those found in > 'system' (sysName, sysContact, sysLocation and so on). While researching it > seems that alphanumerical strings should be of the 'octet' type, however > there doesn't appear to be a suitable DataSet in > /usr/share/collectd/types.db by default. > > I can hardly imagine I'm the first one who wants to do this, but I can't > find anything on the subject online so I might be looking completely wrong > at this subject. > > When using snmpwalk I see the values I want to store, but when I ask > collectd to get these values like so: > > <Data "sysName"> > Type "absolute" > Table false > Instance "SNMPv2-MIB" > Values "sysName" > </Data> > > I can see in the log file that collectd gets the proper result, but doesn't > know what to do with it. > > [2016-02-29 14:53:10] parse_value: Failed to parse string as absolute: > (null). > [2016-02-29 14:53:10] snmp plugin: csnmp_value_list_to_value: Parsing > string as absolute failed: *hostname1* > [2016-02-29 14:53:10] parse_value: Failed to parse string as absolute: > (null). > [2016-02-29 14:53:10] snmp plugin: csnmp_value_list_to_value: Parsing > string as absolute failed: *hostname2* > > Do I need to define a custom data type for this, or is there something else > I should do to get these results? > > Kind regards, > > Niels > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.verplant.org/pipermail/collectd/attachments/20160229/924ec7bb/attachment-0001.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > collectd mailing list > [email protected] > http://mailman.verplant.org/listinfo/collectd > > > ------------------------------ > > End of collectd Digest, Vol 125, Issue 21 > ***************************************** >
_______________________________________________ collectd mailing list [email protected] http://mailman.verplant.org/listinfo/collectd
