[rtg] Upgrade issue

Brian T. O'Neill btoneill at misplaced.net
Thu May 11 22:50:27 EDT 2006


In 0.8 a rate field was added, then it was decided it would be
configurable, but it was never updated to do that. You can fix in in one
of two ways. You can remove the rate entry from the rtglibmysql.c (or
the postgres one depending on what you're using) and recompile, or you
can edit the create_table() function in targetmaker to put in:
$sql = "CREATE TABLE $mib"."_$rid (id INT NOT NULL, dtime DATETIME NOT
NULL, counter BIGINT NOT NULL, rate BIGINT, KEY $mib"."_$rid". "_idx (dtime))";

instead of whats there that is missing the rate entry. If you go the 2nd
route you probably want to do an alter table on each table to add in the
rate field for existing entries. You can automate that with something
like

cd /opt/mysql/data/rtg
for x in `ls *_*.MYI | awk -F. '{ print $1 }'; do
	echo "ALTER TABLE $x ADD rate BIGINT after counter;" | mysql -A rtg
done

Please note, above code is not tested, just off the top of my head, it
should work tho in a bourne based shell. It will throw a few errors for
some of the extra tables that targetmaker creates, but thats fine, just
ignore them.

Brian


Quoting Patrick Topping (patrick.topping at hypermediasystems.com) from  :
> I have fixed the issues in the createdb script so now my errors have
> changed slightly.  I believe now the issue is in the targetmaker script
> but not sure how to fix it.  Any help would be greatly appreciate.
> Thanks in advance.
> 
> -Patrick
> 
> ------------------
> 
> May 12 00:21:51 salt rtgpoll: RTG version 0.8.1 starting. 
> May 12 00:21:51 salt rtgpoll: Daemon detached 
> May 12 00:21:51 salt rtgpoll: Checking another instance with pid 14826. 
> May 12 00:21:51 salt rtgpoll: PID 14826 is no longer running. Starting
> anyway. 
> May 12 00:21:51 salt rtgpoll: Using RTG config file
> [/usr/local/rtg/etc/rtg.conf]. 
> May 12 00:21:51 salt rtgpoll: Initialize hash table pointers: 20000
> bytes. 
> May 12 00:21:51 salt rtgpoll: Reading RTG target list
> [/usr/local/rtg/etc/targets.cfg]. 
> May 12 00:21:51 salt rtgpoll: Successfully hashed [1168] targets, (70080
> bytes). 
> May 12 00:21:51 salt rtgpoll: Initializing threads (5). 
> May 12 00:21:51 salt rtgpoll: Initializing SNMP (port 161). 
> May 12 00:21:51 salt rtgpoll: Loaded database driver librtgmysql.so 
> May 12 00:21:51 salt last message repeated 4 times
> May 12 00:21:51 salt rtgpoll: Mysql connected, thread: 1491627 
> May 12 00:21:51 salt rtgpoll: Mysql connected, thread: 1491628 
> May 12 00:21:51 salt rtgpoll: Mysql connected, thread: 1491624 
> May 12 00:21:51 salt rtgpoll: Mysql connected, thread: 1491625 
> May 12 00:21:51 salt rtgpoll: Mysql connected, thread: 1491626 
> May 12 00:21:52 salt rtgpoll: RTG Ready. 
> May 12 00:21:52 salt rtgpoll: Queue ready, broadcasting thread go
> condition.
> May 12 00:21:52 salt rtgpoll: MySQL error: Unknown column 'rate' in
> 'field list' 
> May 12 00:21:53 salt last message repeated 1167 times
> May 12 00:21:53 salt rtgpoll: Poll round 1 complete.
> May 12 00:21:53 salt rtgpoll: [Polls = 1168] [DBInserts = 0] [Wraps = 0]
> [OutOfRange = 0] 
> May 12 00:21:53 salt rtgpoll: [No Resp = 0] [SNMP Errs = 0] [Slow = 0]
> [PollTime = 1.040s] 
> May 12 00:22:52 salt rtgpoll: Queue ready, broadcasting thread go
> condition.
> May 12 00:22:52 salt rtgpoll: MySQL error: Unknown column 'rate' in
> 'field list' 
> May 12 00:22:53 salt last message repeated 1167 times
> May 12 00:22:53 salt rtgpoll: Poll round 2 complete.
> May 12 00:22:53 salt rtgpoll: [Polls = 2336] [DBInserts = 0] [Wraps = 0]
> [OutOfRange = 0] 
> May 12 00:22:53 salt rtgpoll: [No Resp = 0] [SNMP Errs = 0] [Slow = 0]
> [PollTime = 1.037s] 
> 
> 
> 
> On Thu, 2006-05-11 at 14:52 -0700, Patrick Topping wrote:
> 
> > I have just upgraded from RTG 0.7.4 to 0.8.0 and began using
> > targetmaker.  From what I can see the upgrade went well but when I run
> > rtgpoll I am getting the following errors in the log:
> > 
> > May 11 21:44:25 salt rtgpoll: Query = "INSERT INTO `ifInOctets_3`
> > (id,dtime,counter,rate) VALUES (520,NOW(),7920,132.014788)" 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: Thread [1] processing
> > 10.6.0.254 .1.3.6.1.2.1.31.1.1.1.11.205 (7 work units remain in
> > queue) 
> > May 11 21:44:25 salt rtgpoll: Query = "INSERT INTO `ifInOctets_3`
> > (id,dtime,counter,rate) VALUES (532,NOW(),1600,26.669623)" 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: Thread [2] processing
> > 10.6.0.255 .1.3.6.1.2.1.31.1.1.1.11.205 (6 work units remain in
> > queue) 
> > May 11 21:44:25 salt rtgpoll: Query = "INSERT INTO `ifOutUcastPkts_2`
> > (id,dtime,counter,rate) VALUES (459,NOW(),172,2.866990)" 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: Thread [3] processing
> > 10.6.0.233 .1.3.6.1.2.1.31.1.1.1.7.26 (5 work units remain in queue) 
> > May 11 21:44:25 salt rtgpoll: Query = "INSERT INTO `ifOutUcastPkts_1`
> > (id,dtime,counter,rate) VALUES (351,NOW(),916,15.268373)" 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: Query = "INSERT INTO `ifInUcastPkts_3`
> > (id,dtime,counter,rate) VALUES (521,NOW(),5,0.083343)" 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: MySQL error: Unknown column 'rate' in
> > 'field list' 
> > May 11 21:44:25 salt rtgpoll: Queue processed. Broadcasting thread
> > done condition. 
> > May 11 21:44:25 salt rtgpoll: Poll round 4 complete.
> > May 11 21:44:25 salt rtgpoll: [Polls = 4672] [DBInserts = 0] [Wraps =
> > 0] [OutOfRange = 0] 
> > May 11 21:44:25 salt rtgpoll: [No Resp = 0] [SNMP Errs = 0] [Slow = 0]
> > [PollTime = 3.497s] 
> > 
> > I am not an guru when it comes to programming so I am not sure where
> > to go with this.  Any help would be greatly appreciated.  Below is the
> > rtgpoll command with the options I have used to start the program.
> > 
> > /usr/local/rtg/bin/rtgpoll -vv -z -t /usr/local/rtg/etc/targets.cfg -
> > c /usr/local/rtg/etc/rtg.conf
> > 
> > Thanks in advance to everyone.
> > 
> > -Patrick
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > RTG mailing list
> > RTG at fireflynetworks.net
> > http://fireflynetworks.net/mailman/listinfo/rtg



> _______________________________________________
> RTG mailing list
> RTG at fireflynetworks.net
> http://fireflynetworks.net/mailman/listinfo/rtg


-- 
btoneill at misplaced.net

****************************************************************************
UNIX is simple and coherent, but it takes a genius (or at any rate a 
programmer) to understand and appreciate the simplicity."  - Dennis Ritchie
****************************************************************************


More information about the RTG mailing list