Re: snmpcdmp (snmpColDump)

1998-10-14 07:54:01
Subject: Re: snmpcdmp (snmpColDump)
From: Michael Seibold PTS/M-SW <mseibold AT STR.DAIMLER-BENZ DOT COM>
To: nv-l AT lists.tivoli DOT com
Date: Wed, 14 Oct 1998 13:54:01 +0200
Hi Matt,

I think we all have the same problem producing reports. The easiest way
to produce reports from routers seems to be mrtg, but then we double the
work - every device has to be configured and maitained in netview and in
Up to now netview doesn't provide the needed functionality for
reporting, so I also tried something else.

I use netview to collect data and gnuplot to produce graphs. To produce
output similar to mrtg I exported the data with snmpColDump and did a
grep for the wanted date / device, but this is very slow with big data
files and the CPU of the machine running netview and the reporting was
very busy, which caused netmon to get problems.

To solve this I exported the /usr/OV/databases/snmpCollect via NFS to a
linux-system (very cheap ;-)) and wrote a little C routine which reads
the binary data from snmpCollect, looks for the wanted date/ip-address
etc., converts the AIX-floatingpoint-values to intel representation
(have to swap bytes) and writes out binary / ascii data as wanted. This
way it is much faster than using snmpColDump / grep /awk etc., and the
CPU of the Netview-Server has only the NFS-Requests to handle with.

My tool isn't as comfortable as mrtg at the moment, and I have not the
time to finish this at the moment. Using mrtg to graph would save a lot
of work, I think.

As I wrote the programm during work I am not allowed to give it away,
but if someone would like to follow this solution here is the key to
read the binary data from snmpCollect:

    unsigned long startt, endt, ip;
    unsigned char ip1, ip2, ip3, ip4;
    double data;
    char *p;



        if ( debug )
            printf("%ld\t%ld\t%lu\t%lf\n",startt, endt, ip, data);
            printf("%X\t%X\t%X\t%X %X\n",startt, endt, ip, data,
        /* Unix (AIX) to Intel-float */

        resort_4((char *)&startt);
        resort_4((char *)&endt);
        swap_8((char *)&data);
        resort_4((char *)&data);
        resort_4((char *)&data+4);

        /* break IP - address into parts */
        p=(char *)&ip;



/* resort 4 Bytes (Integer Unix -> Intel) */

void resort_4(inp)
char *inp;
    char buf[4];
    char *p1, *p2;
    int i;

    memcpy(buf, inp, 4);        /* alte Daten retten */

    p1=inp;                     /* Zeiger auf Datenanfang */
    p2=buf+3;                   /* Zeiger auf Pufferende  */

    for ( i=0; i<4;i++ )
      { *p1++=*p2--; }          /* umkopieren             */

/* swap 8 Bytes (long Float) 4 Bytes at a time (Unix -> Intel) */

void swap_8(inp)
char *inp;
    char buf[4];

    memcpy(buf, inp, 4);        /* 1. Datenteil retten */
    memcpy(inp, inp+4, 4);      /* 2. Datenteil nach vorne schieben */
    memcpy(inp+4, buf, 4);      /* 1. Datenteil zurueckholen */



Sorry for not providing the whole program and for the german comments.

Maybe we should start a little projekt on reporting during our
spare-times, I think we would get rid of a lot of trouble during work
with a good reporting tool...


Michael Seibold

Matt Moore wrote:
> Hi,
> I am attempting to collect data with netview 5.0a for NT, and graph the
> collected data with MRTG (as opposed to letting MRTG collect the data).
> I was thinking of using snmpcdmp (netview for NT's version of
> snmpColDump) to get the data from the \usr\ov\databases\snmpcollect
> directory, and passing it to MRTG to graph. However, most of the time I
> get an error when I attempt to run snmpcdmp.
> When I run "snmpcdmp ifInOctets.2" I get the error
> "snmpcdmp: read(ifInOctets.2) failed: (null)"
> I have tried running snmpcdmp with all the specified options, but still
> get the same error.
> Has anyone else had any similar problems?
> Thanks,
> Matt Moore

<Prev in Thread] Current Thread [Next in Thread>