Re: Marshaling SNMP DateAndTime via pass_persist

Alistair Bayley <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKYODbiWvZiMNLzA+Mge9SwfrPYoq4pGS=JqdjBHXEFPODuyWQ@mail.gmail.com>
On 31 August 2011 09:01, Alistair Bayley <[email protected]> wrote:
> Hello,
>
> I'm trying to write an extension module for snmpd, and decided to use
> the pass_persist mechanism. I can get it to successfully return values
> as long as they are numbers or strings (e.g. integer, string,
> Counter32, DisplayString), but I cannot figure out how to return a
> DateAndTime (from RFC 2579: http://tools.ietf.org/html/rfc2579 ).
>
> How should I marshal DateAndTime values? Is there some other type I
> can use instead? I see the TimeStamp type in RFC 2579, but this is the
> sysUpTime value at the event time; I'd rather have an absoluate (UTC)
> date and time, or some equivalent.


I've just noticed in the docs for pass (above pass_persist) that the
type must be one from this list:
  integer, gauge, counter, timeticks, ipaddress, objectid, or string

So I guess for now I'll return the DateAndTime as 2 columns (yes, it's
in a table): 1 as string, and 2 as counter (seconds-since-epoch).

Thanks,
Alistair

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.