[rtg] Fwd: rtgpoll failed: using btoneill's targetmaker

Yu Safin calanet at gmail.com
Tue Nov 14 15:04:02 PST 2006


On 11/14/06, Yu Safin <calanet at gmail.com> wrote:
> ---------- Forwarded message ----------
> From: Yu Safin <calanet at gmail.com>
> Date: Nov 14, 2006 5:12 PM
> Subject: Re: [rtg] Fwd: rtgpoll failed: using btoneill's targetmaker
> To: bill fumerola <billf at mu.org>
>
>
> On 11/14/06, bill fumerola <billf at mu.org> wrote:
> > On Tue, Nov 14, 2006 at 04:43:58PM -0500, Yu Safin wrote:
> > > caplan:/usr/local/rtg/etc # /usr/local/rtg/bin/rtgpoll -vvv -t
> > > /opt/rtg/etc/targets.cfg
> > > caplan:/usr/local/rtg/etc # targets failure on line 3 - syntax error
> > > last token parsed: 172.22.130.10
> > > caplan:/usr/local/rtg/etc #
> > >
> > >
> > > The targets.cfg file:
> > > caplan:/usr/local/rtg/etc # more /opt/rtg/etc/targets.cfg
> > > # Generated 11/14/2006 16:07 by ./rtgtargmkr.pl
> > > # Host  OID     Bits    Community       Table   ID      OOR     Description
> > > 172.22.130.10   .1.3.6.1.2.1.2.2.1.10.1 32      public  ifInOctets_1
> > >  2       450000000
> > >         (lo)
> >
> > this is a rtg-0.7.4 style targets file and you're now running rtg from
> > cvs. this is the exact opposite problem you had when you started (new
> > targets file, old rtgpoll code).
> >
> > generate targets with the proper format for the code you're running.
> >
> > -- bill
> >
> I checked the documentation and found the following:
> PRE RTG-0.8 Format:
>  # Host  OID  64/32  Community  Table   ID   Description
>
> where
>
>  Host        = IP or hostname of target
>  OID         = Full SNMP OID, e.g. .1.3.6.1.2.1.31.1.1.1.10.19
>  64/32/0     = Specify 64/32 bit objects or 0 for gauge objects
>  Community   = SNMP Community
>  Table       = MySQL table in the database to use
>  ID          = A unique ID that is used with each insert
>  OOR         = The maximum delta of an object's counter within one interval.
>  Description = Free text
>
> RTG-0.8 and beyond (PRE RTG-0.8 Format Is Still Supported):
> host [hostname] {
>       community [communityString];
>       snmpver [1|2];
>       target [OID] {
>               bits [64|32|0];
>               table [tableName];
>               id [idnum];
>               speed [OORValue];
>               descr "[description]";.
>       };
>       target [OID] {
>               ...
>               ...
>       };
>       ...
>       ...
> };
>
> do I go line by line in the targets.cfg to change from old to new format?
> how come rtgtargmkr.pl is generating in the old format?
>
OK, I modified targets.cfg (shown below) and started rtgpoll (shown below).
Now it is complaining about mysql.  However, I can see the library
(shown below).

caplan:/usr/local/rtg/bin # ./rtgpoll -vvv -t /opt/rtg/etc/targets.cfg
caplan:/usr/local/rtg/bin # tail /var/log/localmessages
Nov 14 17:47:25 caplan rtgpoll: Using RTG config file
[/usr/local/rtg/etc/rtg.conf].
Nov 14 17:47:25 caplan rtgpoll: Initialize hash table pointers: 20000 bytes.
Nov 14 17:47:25 caplan rtgpoll: Reading RTG target list
[/opt/rtg/etc/targets.cfg].
Nov 14 17:47:25 caplan rtgpoll: Successfully hashed [1] targets, (60 bytes).
Nov 14 17:47:25 caplan rtgpoll: Initializing threads (5).
Nov 14 17:47:25 caplan rtgpoll: Initializing SNMP (port 161).
Nov 14 17:47:26 caplan rtgpoll:  Starting threads.
Nov 14 17:47:26 caplan rtgpoll: Thread [0] starting.
Nov 14 17:47:26 caplan rtgpoll: Couldn't load database driver librtgmysql.so
Nov 14 17:47:26 caplan rtgpoll: ** Database error - check configuration.
caplan:/usr/local/rtg/bin # more /opt/rtg/etc/targets.cfg
# Generated 11/14/2006 13:57 by ./targetmaker
# START lnxcapd
host 172.22.130.10 {
        community public;
        snmpver 2;
        target .1.3.6.1.2.1.2.2.1.10.3 {
        bits 32;
        table ifInOctets_1;
        id 4;
        speed 4500000000;
        descr "eth0";
        }
};
# END lnxcapd
#172.22.130.10  .1.3.6.1.2.1.2.2.1.10.3 32      public  ifInOctets_1
 4       450000000
0        (eth0)
#172.22.130.10  .1.3.6.1.2.1.2.2.1.11.3 32      public
ifInUcastPkts_1 4       450000000
0        (eth0)
#172.22.130.10  .1.3.6.1.2.1.2.2.1.16.3 32      public  ifOutOctets_1
 4       450000000
0        (eth0)
#172.22.130.10  .1.3.6.1.2.1.2.2.1.17.3 32      public
ifOutUcastPkts_1        4       4
500000000        (eth0)
caplan:/usr/local/rtg/bin #

caplan:/usr/local/rtg/bin # locate librtgmysql.so
/usr/local/rtg/lib/librtgmysql.so
/usr/local/rtg/lib/librtgmysql.so.0
/usr/local/rtg/lib/librtgmysql.so.0.0.0
/usr/src/rtg-cvs-NOV06/src/.libs/librtgmysql.so
/usr/src/rtg-cvs-NOV06/src/.libs/librtgmysql.so.0
/usr/src/rtg-cvs-NOV06/src/.libs/librtgmysql.so.0.0.0
caplan:/usr/local/rtg/bin #


any suggestions?


More information about the RTG mailing list