Re: Unsnarling an rpmdb from the HR MIB - SNMP

This is a discussion on Re: Unsnarling an rpmdb from the HR MIB - SNMP ; Two years ago I suggested that net-snmp doesn't need to do -lrpm: http://www.usenet-forums.com/snmp-co...re-unsnarling- rpmdb-hr-mib.html in order to populate the HR MIB. Since there was little interest from net-snmp at the time (note "Ugh!" comments), I dinna bother to pursue sending ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Re: Unsnarling an rpmdb from the HR MIB

  1. Re: Unsnarling an rpmdb from the HR MIB

    Two years ago I suggested that net-snmp doesn't need to do -lrpm:

    http://www.usenet-forums.com/snmp-co...re-unsnarling-
    rpmdb-hr-mib.html

    in order to populate the HR MIB.

    Since there was little interest from net-snmp at the time (note
    "Ugh!" comments),
    I dinna bother to pursue sending the patch.

    Since then, rpm-5.0 has been released, and is now "masked" in Gentoo
    because
    net-snmp doesn't link with -lrpm.

    So its time for me to attempt to fix the problem in net-snmp for Gentoo.

    (aside) Note also that rpm-4.6 from @rpm.org is being released,
    which, unlike rpm-5.x,
    has a -D_RPM_4_4_COMPAT flag for the *transition* to Yet Another
    Incompatible API.
    Caveat emptor, note "transition" ...

    Hence I believe its finally time to _REALLY_ solve the development
    issue of net-snmp <-> rpm
    linkage forever.

    There is no reason that I know of that the HR MIB *must* link -lrpm
    (and Berkeley DB and ...),
    the HR MIB can be populated in other ways.

    In fact, all non-rpm based systems *already* populate the HR MIB
    without linking in Berkeley DB.

    What is present in rpm-4.4.6 and later is the ability to pass all the
    information needed
    to populate the HR MIB using 0b files in a directory. The name of the
    file carries the necessary
    name-version-release.arch information, and the timestamp on the file
    carries the installtime.

    The 0b files are maintained synchronously with rpmdb entries in
    rpm-4.4.6 and later, so
    one will get the same answer whether you walk the directory, or query
    an rpmdb.

    The mechanism of reading 0b files from a directory is currently in
    use with PLD linux
    net-snmp and is known to work.

    A very simple script, possibly run by cron, or triggered by an event
    timer, can be run
    for *all* version of rpm, not just rpm-4.4.6 which maintains the
    files internally.

    The script used by PLD is attached.

    Which means that the code in net-snmp becomes extremely simple,
    basically just
    walking files in a directory, and running stat to get the install
    time. This code is
    *already* present in net-snmp, and a extremely minor change is
    necessary to
    specify which directory path to walk.

    I assure you that opendir(3) and stat(2) are much easier coding than
    Berkeley DB and
    forked RPM API's. But YMMV as always ...

    So what sort of patch do you wish? I suggest ripping -lrpm entirely
    as described above.

    Alternatively, I can/will send along the necessary AutoFu in order to
    teach net-snmp
    to recognize and link against RPM 5.0, and delver the same to Gentoo.

    73 de Jeff

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-coders mailing list
    Net-snmp-coders@lists.sourceforge.net
    https://lists.sourceforge.net/lists/...et-snmp-coders


  2. Re: Unsnarling an rpmdb from the HR MIB

    2008/7/15 Jeff Johnson :
    > Two years ago I suggested that net-snmp doesn't need to do -lrpm:

    [snip]
    > ... I believe its finally time to _REALLY_ solve the development issue of
    > net-snmp <-> rpm linkage forever.


    Your timing is impeccable!
    I'm currently in the middle of reworking the code for hrSWRunTable and
    hrSWInstalledTable (based on the recent submission for Darwin systems).

    Literally at this very minute, I'm in the middle of compiling a new
    RPM-based implementation of the hrSWIntalledTable.

    I'll have a look at your patches, and see how they might be incorporated
    into this rewrite. Give me a day or two, and then I'll get back to you.

    Dave

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-coders mailing list
    Net-snmp-coders@lists.sourceforge.net
    https://lists.sourceforge.net/lists/...et-snmp-coders


  3. Re: Unsnarling an rpmdb from the HR MIB


    On Jul 15, 2008, at 1:58 PM, Dave Shield wrote:

    > 2008/7/15 Jeff Johnson :
    >> Two years ago I suggested that net-snmp doesn't need to do -lrpm:

    > [snip]
    >> ... I believe its finally time to _REALLY_ solve the development
    >> issue of
    >> net-snmp <-> rpm linkage forever.

    >
    > Your timing is impeccable!
    > I'm currently in the middle of reworking the code for hrSWRunTable and
    > hrSWInstalledTable (based on the recent submission for Darwin
    > systems).
    >
    > Literally at this very minute, I'm in the middle of compiling a new
    > RPM-based implementation of the hrSWIntalledTable.
    >
    > I'll have a look at your patches, and see how they might be
    > incorporated
    > into this rewrite. Give me a day or two, and then I'll get back to
    > you.
    >


    Note that there are no net-snmp patches from me (yet) because I don't
    know how
    you wish to proceed.

    I'd suggest reading zero byte files from a directory to populate the
    HR MIB.
    The necessary changes are quite straight forward, and are mostly net-
    snmp autoconf
    related.

    But the "traditional" approach, teaching net-snmp AutoFu to handle 3
    (yes 3!) variant rpmlib API's
    can be done too.

    I can/will attempt patches as soon as I know which of the two
    approaches is
    desired for net-snmp. My goal here is to get rpm-5.x unmasked in
    Gentoo by
    permitting Gentoo builds of net-snmp (and sussen, which also should
    be using
    zero byte files in a directory to identify which packages are
    installed imho))
    not otherwise.

    hth

    73 de Jeff


    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-coders mailing list
    Net-snmp-coders@lists.sourceforge.net
    https://lists.sourceforge.net/lists/...et-snmp-coders


  4. Re: Unsnarling an rpmdb from the HR MIB

    2008/7/17 Jeff Johnson :
    > Note that there are no net-snmp patches from me (yet) because I don't know
    > how you wish to proceed.


    I'd suggest that you leave this with me for the moment.
    As I said on Tuesday, I'm currently re-working the hrSW*Table code,
    and hope to be able to commit those changes sometime next week.

    I've got some ideas about how to handle the competing pains of
    rpmlib-based vs command-based population of the SWInst table,
    but I'd like to get something concrete in place before I take this
    any further.

    Check back with me next Wednesday or Thursday, and we'll
    see where things have got to.

    Dave

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-coders mailing list
    Net-snmp-coders@lists.sourceforge.net
    https://lists.sourceforge.net/lists/...et-snmp-coders


+ Reply to Thread