You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(12) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(7) |
Dec
(4) |
2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Laurent G. <lg...@gm...> - 2009-01-28 14:40:14
|
Actually, Jonathan shot me following reply. >It looks like your latest Exception is another bug. After a reconnect, the db connection is set to autoCommit, and the explicit commit calls are failing. Add this: > // We are explicitly committing transactions. > con.setAutoCommit(false); > >to line 152 of RTGDBDriver.java, at the bottom of the the reconnectAll() method. > >With the bug, you might suffer from some degraded performance with the continued logging, as well as committing twice on every insert. That took care of the problem. Thanks for your reply. - Laurent On Tue, Jan 27, 2009 at 4:48 PM, Marc Brashear <ma...@jb...> wrote: > > Laurent, > > It looks like you have autocommit turned on in the jdbc driver and the > warning is from trying to manually commit the transactions. Turn if off > and your database should be happier and the warning will go away. > > Marc > > > Alright, hate to bring this back from the dead after so long, but I just > > now > > have had a chance to play around with jrtg again. > > > > Looks like your recommendations regarding how to handle db maintenances > > were > > right on. > > > > Everything worked as desired, unfortunately I am now plagued by following > > log messages: > > > > Jan 21, 2009 11:08:54 AM com.virtela.poller.DBDriver insert > > WARNING: insert() error. > > com.virtela.poller.DBDriver$DBException: Error inserting: IID:3263 > > PollTime:1232554125296 Name:ifOutUcastPkts Value:1662038 Delta:298666 > > at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:189) > > at com.virtela.poller.DBDriver.insert(DBDriver.java:220) > > at com.virtela.poller.DBDriver.insert(DBDriver.java:200) > > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) > > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) > > at > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > > at > > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) > > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) > > at java.lang.Thread.run(Thread.java:619) > > Caused by: java.sql.SQLException: Can't call commit when autocommit=true > > at com.mysql.jdbc.Connection.commit(Connection.java:2161) > > at > > com.virtela.poller.ConnectionWrapper.commit(ConnectionWrapper.java:90) > > at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:182) > > ... 9 more > > > > I have checked my tables, and it doesn't appear as if the insert actually > > fails. Can you make sense of those exceptions? > > > > - Laurent > > > > On Fri, Dec 5, 2008 at 6:51 PM, Leech, Jonathan <jl...@vi...> > > wrote: > > > >> Laurent, > >> > >> I think you've just got the name of the object wrong. It might be: > >> com.virtela.poller:type=DBDriver,name=inserter (the name depends on what > >> its > >> named in the config.properties file). The command line jmxclient will > >> list > >> all the available objects with / without certain cmd line arguments, and > >> if > >> given an object will list the available properties and methods on the > >> object. So you can use it to do introspection. > >> Also you can use the jconsole application that comes with the jdk, it > >> shows everything and does some other usefult things like graphing > >> properties > >> over time. > >> > >> -Jonathan > >> > >> > >> ------------------------------ > >> *From:* Laurent Geyer [mailto:lg...@gm...] > >> *Sent:* Friday, December 05, 2008 4:44 PM > >> *To:* Leech, Jonathan > >> *Cc:* jrt...@li... > >> *Subject:* Re: [Jrtg-users] insert() error - NullPointerException > >> > >> Jonathan, > >> > >> Alright, that makes sense. Now I'm just having some difficulties > >> accessing > >> those methods through JMX. > >> > >> lgeyer@xxx:/usr/local/jrtg$ java -jar > >> /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 > >> com.virtela.poller:type=RTGDBDriver pauseDBInserts > >> 12/05/2008 18:42:40 -0500 org.archive.jmx.Client > >> com.virtela.poller:type=RTGDBDriver is not a registered bean > >> > >> lgeyer@xxx:/usr/local/jrtg$ java -jar > >> /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 > >> com.virtela.poller:type=DBDriver pauseDBInserts > >> 12/05/2008 18:42:47 -0500 org.archive.jmx.Client > >> com.virtela.poller:type=DBDriver is not a registered bean > >> > >> What am I missing here? > >> > >> Thanks for your help, > >> > >> Laurent > >> > >> On Fri, Dec 5, 2008 at 5:46 PM, Leech, Jonathan <jl...@vi...> > >> wrote: > >> > >>> Laurent, > >>> > >>> Very good question. The RTGDBDriver has the commitAllTransactions(), > >>> and > >>> reconnectAll() methods exposed through JMX to do extactly that > >>> externally. > >>> This would help in scenarios of a planned maintenance, or an outage > >>> that is > >>> detected quickly. Also you should call pauseDBInserts() on the DBBuffer > >>> first. So the steps would be > >>> 1) pauseDBInserts() > >>> 2) commitAllTransactions() > >>> 3) perform database maintenance > >>> 4) reconnectAll() > >>> 5) resumeDBInserts(). > >>> > >>> JRTG has not yet been instrumented to automatically reconnect to the > >>> database after certain fatal errors. The place to do this would be > >>> either > >>> the DBDriver class or in the ConnectionWrapper class. I intended to do > >>> so in > >>> the ConnectionWrapper class, there is even a comment at the top: // > >>> TODO: > >>> attempt to reconnect to the database after certain SQL errors. This > >>> recquires some knowledge of which errors should result in a > >>> reconnection and > >>> which shouldn't. A good place to find this kind of information might be > >>> JBoss connection pool logic, or a similar connection pooling library. > >>> > >>> The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: > >>> if > >>> (ps != null) ps.close(); It is masking the real SQLExceptions caused by > >>> the > >>> database restart. > >>> > >>> Also, if you have a firewall or some other evil device in between your > >>> poller and database, you should probably also add a call to > >>> setQueryTimeout() on the PreparedStatement prior to ps.execute() on > >>> line > >>> 178. I don't know specifically how the mySQL JDBC driver would react to > >>> a > >>> connection dropped by a firewall, or if it implements > >>> setQueryTimeout(), but > >>> I can attest to the fact that the Oracle JDBC driver will hang > >>> indefinitely > >>> on the execute() method if the connection is dropped, unless a timeout > >>> is > >>> provided. > >>> > >>> -Jonathan > >>> > >>> ------------------------------ > >>> *From:* Laurent Geyer [mailto:lg...@gm...] > >>> *Sent:* Friday, December 05, 2008 1:52 PM > >>> *To:* jrt...@li... > >>> *Subject:* [Jrtg-users] insert() error - NullPointerException > >>> > >>> Hi, > >>> > >>> So far so good. Have had jrtg running little over a month now and it's > >>> been solid. > >>> > >>> Unfortunately today I noticed I lost about two days worth of data. The > >>> date it stopped collecting coincided with a MySQL server restart > >>> following a > >>> MySQL upgrade. > >>> > >>> Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert > >>> WARNING: insert() error. > >>> java.lang.NullPointerException > >>> at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) > >>> at com.virtela.poller.DBDriver.insert(DBDriver.java:220) > >>> at com.virtela.poller.DBDriver.insert(DBDriver.java:200) > >>> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) > >>> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) > >>> at > >>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > >>> at java.util.concurrent.FutureTask.run(FutureTask.java:138) > >>> at > >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) > >>> at > >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) > >>> at java.lang.Thread.run(Thread.java:619) > >>> > >>> Is there any way I can reconnect the MySQL session and commit the > >>> inserts > >>> following a restart or loss of connectivity? > >>> > >>> Thanks, > >>> > >>> Laurent > >>> > >>> > >>> > >> > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by: > > SourcForge Community > > SourceForge wants to tell your story. > > http://p.sf.net/sfu/sf-spreadtheword_______________________________________________ > > Jrtg-users mailing list > > Jrt...@li... > > https://lists.sourceforge.net/lists/listinfo/jrtg-users > > > > |
From: Marc B. <ma...@jb...> - 2009-01-27 23:32:56
|
Laurent, It looks like you have autocommit turned on in the jdbc driver and the warning is from trying to manually commit the transactions. Turn if off and your database should be happier and the warning will go away. Marc > Alright, hate to bring this back from the dead after so long, but I just > now > have had a chance to play around with jrtg again. > > Looks like your recommendations regarding how to handle db maintenances > were > right on. > > Everything worked as desired, unfortunately I am now plagued by following > log messages: > > Jan 21, 2009 11:08:54 AM com.virtela.poller.DBDriver insert > WARNING: insert() error. > com.virtela.poller.DBDriver$DBException: Error inserting: IID:3263 > PollTime:1232554125296 Name:ifOutUcastPkts Value:1662038 Delta:298666 > at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:189) > at com.virtela.poller.DBDriver.insert(DBDriver.java:220) > at com.virtela.poller.DBDriver.insert(DBDriver.java:200) > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.sql.SQLException: Can't call commit when autocommit=true > at com.mysql.jdbc.Connection.commit(Connection.java:2161) > at > com.virtela.poller.ConnectionWrapper.commit(ConnectionWrapper.java:90) > at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:182) > ... 9 more > > I have checked my tables, and it doesn't appear as if the insert actually > fails. Can you make sense of those exceptions? > > - Laurent > > On Fri, Dec 5, 2008 at 6:51 PM, Leech, Jonathan <jl...@vi...> > wrote: > >> Laurent, >> >> I think you've just got the name of the object wrong. It might be: >> com.virtela.poller:type=DBDriver,name=inserter (the name depends on what >> its >> named in the config.properties file). The command line jmxclient will >> list >> all the available objects with / without certain cmd line arguments, and >> if >> given an object will list the available properties and methods on the >> object. So you can use it to do introspection. >> Also you can use the jconsole application that comes with the jdk, it >> shows everything and does some other usefult things like graphing >> properties >> over time. >> >> -Jonathan >> >> >> ------------------------------ >> *From:* Laurent Geyer [mailto:lg...@gm...] >> *Sent:* Friday, December 05, 2008 4:44 PM >> *To:* Leech, Jonathan >> *Cc:* jrt...@li... >> *Subject:* Re: [Jrtg-users] insert() error - NullPointerException >> >> Jonathan, >> >> Alright, that makes sense. Now I'm just having some difficulties >> accessing >> those methods through JMX. >> >> lgeyer@xxx:/usr/local/jrtg$ java -jar >> /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 >> com.virtela.poller:type=RTGDBDriver pauseDBInserts >> 12/05/2008 18:42:40 -0500 org.archive.jmx.Client >> com.virtela.poller:type=RTGDBDriver is not a registered bean >> >> lgeyer@xxx:/usr/local/jrtg$ java -jar >> /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 >> com.virtela.poller:type=DBDriver pauseDBInserts >> 12/05/2008 18:42:47 -0500 org.archive.jmx.Client >> com.virtela.poller:type=DBDriver is not a registered bean >> >> What am I missing here? >> >> Thanks for your help, >> >> Laurent >> >> On Fri, Dec 5, 2008 at 5:46 PM, Leech, Jonathan <jl...@vi...> >> wrote: >> >>> Laurent, >>> >>> Very good question. The RTGDBDriver has the commitAllTransactions(), >>> and >>> reconnectAll() methods exposed through JMX to do extactly that >>> externally. >>> This would help in scenarios of a planned maintenance, or an outage >>> that is >>> detected quickly. Also you should call pauseDBInserts() on the DBBuffer >>> first. So the steps would be >>> 1) pauseDBInserts() >>> 2) commitAllTransactions() >>> 3) perform database maintenance >>> 4) reconnectAll() >>> 5) resumeDBInserts(). >>> >>> JRTG has not yet been instrumented to automatically reconnect to the >>> database after certain fatal errors. The place to do this would be >>> either >>> the DBDriver class or in the ConnectionWrapper class. I intended to do >>> so in >>> the ConnectionWrapper class, there is even a comment at the top: // >>> TODO: >>> attempt to reconnect to the database after certain SQL errors. This >>> recquires some knowledge of which errors should result in a >>> reconnection and >>> which shouldn't. A good place to find this kind of information might be >>> JBoss connection pool logic, or a similar connection pooling library. >>> >>> The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: >>> if >>> (ps != null) ps.close(); It is masking the real SQLExceptions caused by >>> the >>> database restart. >>> >>> Also, if you have a firewall or some other evil device in between your >>> poller and database, you should probably also add a call to >>> setQueryTimeout() on the PreparedStatement prior to ps.execute() on >>> line >>> 178. I don't know specifically how the mySQL JDBC driver would react to >>> a >>> connection dropped by a firewall, or if it implements >>> setQueryTimeout(), but >>> I can attest to the fact that the Oracle JDBC driver will hang >>> indefinitely >>> on the execute() method if the connection is dropped, unless a timeout >>> is >>> provided. >>> >>> -Jonathan >>> >>> ------------------------------ >>> *From:* Laurent Geyer [mailto:lg...@gm...] >>> *Sent:* Friday, December 05, 2008 1:52 PM >>> *To:* jrt...@li... >>> *Subject:* [Jrtg-users] insert() error - NullPointerException >>> >>> Hi, >>> >>> So far so good. Have had jrtg running little over a month now and it's >>> been solid. >>> >>> Unfortunately today I noticed I lost about two days worth of data. The >>> date it stopped collecting coincided with a MySQL server restart >>> following a >>> MySQL upgrade. >>> >>> Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert >>> WARNING: insert() error. >>> java.lang.NullPointerException >>> at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) >>> at com.virtela.poller.DBDriver.insert(DBDriver.java:220) >>> at com.virtela.poller.DBDriver.insert(DBDriver.java:200) >>> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) >>> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) >>> at >>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >>> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) >>> at java.lang.Thread.run(Thread.java:619) >>> >>> Is there any way I can reconnect the MySQL session and commit the >>> inserts >>> following a restart or loss of connectivity? >>> >>> Thanks, >>> >>> Laurent >>> >>> >>> >> > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword_______________________________________________ > Jrtg-users mailing list > Jrt...@li... > https://lists.sourceforge.net/lists/listinfo/jrtg-users > |
From: Laurent G. <lg...@gm...> - 2009-01-21 16:18:03
|
Alright, hate to bring this back from the dead after so long, but I just now have had a chance to play around with jrtg again. Looks like your recommendations regarding how to handle db maintenances were right on. Everything worked as desired, unfortunately I am now plagued by following log messages: Jan 21, 2009 11:08:54 AM com.virtela.poller.DBDriver insert WARNING: insert() error. com.virtela.poller.DBDriver$DBException: Error inserting: IID:3263 PollTime:1232554125296 Name:ifOutUcastPkts Value:1662038 Delta:298666 at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:189) at com.virtela.poller.DBDriver.insert(DBDriver.java:220) at com.virtela.poller.DBDriver.insert(DBDriver.java:200) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: Can't call commit when autocommit=true at com.mysql.jdbc.Connection.commit(Connection.java:2161) at com.virtela.poller.ConnectionWrapper.commit(ConnectionWrapper.java:90) at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:182) ... 9 more I have checked my tables, and it doesn't appear as if the insert actually fails. Can you make sense of those exceptions? - Laurent On Fri, Dec 5, 2008 at 6:51 PM, Leech, Jonathan <jl...@vi...> wrote: > Laurent, > > I think you've just got the name of the object wrong. It might be: > com.virtela.poller:type=DBDriver,name=inserter (the name depends on what its > named in the config.properties file). The command line jmxclient will list > all the available objects with / without certain cmd line arguments, and if > given an object will list the available properties and methods on the > object. So you can use it to do introspection. > Also you can use the jconsole application that comes with the jdk, it > shows everything and does some other usefult things like graphing properties > over time. > > -Jonathan > > > ------------------------------ > *From:* Laurent Geyer [mailto:lg...@gm...] > *Sent:* Friday, December 05, 2008 4:44 PM > *To:* Leech, Jonathan > *Cc:* jrt...@li... > *Subject:* Re: [Jrtg-users] insert() error - NullPointerException > > Jonathan, > > Alright, that makes sense. Now I'm just having some difficulties accessing > those methods through JMX. > > lgeyer@xxx:/usr/local/jrtg$ java -jar > /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 > com.virtela.poller:type=RTGDBDriver pauseDBInserts > 12/05/2008 18:42:40 -0500 org.archive.jmx.Client > com.virtela.poller:type=RTGDBDriver is not a registered bean > > lgeyer@xxx:/usr/local/jrtg$ java -jar > /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 > com.virtela.poller:type=DBDriver pauseDBInserts > 12/05/2008 18:42:47 -0500 org.archive.jmx.Client > com.virtela.poller:type=DBDriver is not a registered bean > > What am I missing here? > > Thanks for your help, > > Laurent > > On Fri, Dec 5, 2008 at 5:46 PM, Leech, Jonathan <jl...@vi...> > wrote: > >> Laurent, >> >> Very good question. The RTGDBDriver has the commitAllTransactions(), and >> reconnectAll() methods exposed through JMX to do extactly that externally. >> This would help in scenarios of a planned maintenance, or an outage that is >> detected quickly. Also you should call pauseDBInserts() on the DBBuffer >> first. So the steps would be >> 1) pauseDBInserts() >> 2) commitAllTransactions() >> 3) perform database maintenance >> 4) reconnectAll() >> 5) resumeDBInserts(). >> >> JRTG has not yet been instrumented to automatically reconnect to the >> database after certain fatal errors. The place to do this would be either >> the DBDriver class or in the ConnectionWrapper class. I intended to do so in >> the ConnectionWrapper class, there is even a comment at the top: // TODO: >> attempt to reconnect to the database after certain SQL errors. This >> recquires some knowledge of which errors should result in a reconnection and >> which shouldn't. A good place to find this kind of information might be >> JBoss connection pool logic, or a similar connection pooling library. >> >> The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: if >> (ps != null) ps.close(); It is masking the real SQLExceptions caused by the >> database restart. >> >> Also, if you have a firewall or some other evil device in between your >> poller and database, you should probably also add a call to >> setQueryTimeout() on the PreparedStatement prior to ps.execute() on line >> 178. I don't know specifically how the mySQL JDBC driver would react to a >> connection dropped by a firewall, or if it implements setQueryTimeout(), but >> I can attest to the fact that the Oracle JDBC driver will hang indefinitely >> on the execute() method if the connection is dropped, unless a timeout is >> provided. >> >> -Jonathan >> >> ------------------------------ >> *From:* Laurent Geyer [mailto:lg...@gm...] >> *Sent:* Friday, December 05, 2008 1:52 PM >> *To:* jrt...@li... >> *Subject:* [Jrtg-users] insert() error - NullPointerException >> >> Hi, >> >> So far so good. Have had jrtg running little over a month now and it's >> been solid. >> >> Unfortunately today I noticed I lost about two days worth of data. The >> date it stopped collecting coincided with a MySQL server restart following a >> MySQL upgrade. >> >> Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert >> WARNING: insert() error. >> java.lang.NullPointerException >> at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) >> at com.virtela.poller.DBDriver.insert(DBDriver.java:220) >> at com.virtela.poller.DBDriver.insert(DBDriver.java:200) >> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) >> at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) >> at >> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) >> at java.lang.Thread.run(Thread.java:619) >> >> Is there any way I can reconnect the MySQL session and commit the inserts >> following a restart or loss of connectivity? >> >> Thanks, >> >> Laurent >> >> >> > |
From: Leech, J. <jl...@vi...> - 2009-01-09 17:04:51
|
Bryan, Thanks for the patch. If it could be made more rigorous, I think it would be appropriate to include as an option. I will give it some more thought. -Jonathan -----Original Message----- From: Bryan Wann [mailto:bwa...@wa...] Sent: Saturday, January 03, 2009 1:43 PM To: jrt...@li... Subject: Re: [Jrtg-users] Poller.java - thread question On Mon, 17 Nov 2008, Leech, Jonathan wrote: > You want to be careful normalizing the times, so as not to affect the > rate calculations. So don't change the time going in to the > TargetStatistic object, but rather change it at the time of insert in > the database (if you are using RTGDBDriver its on line 175). The > safest / easiest way to do that would be to round the significant > digits out of the poll time (if you have a 5 minute poll cycle, put > the times at :00 > :05 :10, etc). Otherwise you would have to take extra care to make > sure your change is compatible with the buffering in DBBuffer. This is what I've done so far to handle this. It's not a rigorous solution, since your poll interval could straddle a 5 minute boundary depending how long the cycle is and when it was started. That is, some inserts could be at 00:45 more could be at 00:50. This could be a problem with or without the patch depending why you want to do it. In my case I just make it a point to start up the poller at a 5 minute boundary. This may not patch cleanly as my line numbers are a bit off and I don't use a 'rate' column. --- RTGDBDriver.java.orig3 2009-01-02 17:52:24.000000000 -0500 +++ RTGDBDriver.java 2009-01-03 00:54:46.000000000 -0500 @@ -171,11 +171,18 @@ try { Connection con = connection.get(); synchronized(con) { + + GregorianCalendar gc = new GregorianCalendar(); + gc.setTime( new java.util.Date( targetValue.timestamp ) ); + gc.set( Calendar.MINUTE, ( gc.get(Calendar.MINUTE) / 5 ) * 5 ); + gc.set( Calendar.SECOND, 0 ); + long newts = gc.getTimeInMillis(); + ps = con.prepareStatement("insert delayed into " + targetValue.name + "_" + targetValue.interfaceValues.deviceValues.RID + " (id, dtime, counter) values " + " (?,?,?)"); ps.setLong(1, targetValue.interfaceValues.IID); - ps.setTimestamp(2, new java.sql.Timestamp(targetValue.timestamp), cal); + ps.setTimestamp(2, new java.sql.Timestamp( newts ), cal); ps.setLong(3, targetValue.value.longValue()); ps.execute(); int count = connectionToCount.get(con) + 1; Met vriendelijke groet/kind regards, bryan ------------------------------------------------------------------------ ------ _______________________________________________ Jrtg-users mailing list Jrt...@li... https://lists.sourceforge.net/lists/listinfo/jrtg-users |
From: Bryan W. <bwa...@wa...> - 2009-01-03 21:23:26
|
On Mon, 17 Nov 2008, Leech, Jonathan wrote: > You want to be careful normalizing the times, so as not to affect the > rate calculations. So don't change the time going in to the > TargetStatistic object, but rather change it at the time of insert in > the database (if you are using RTGDBDriver its on line 175). The safest > / easiest way to do that would be to round the significant digits out of > the poll time (if you have a 5 minute poll cycle, put the times at :00 > :05 :10, etc). Otherwise you would have to take extra care to make sure > your change is compatible with the buffering in DBBuffer. This is what I've done so far to handle this. It's not a rigorous solution, since your poll interval could straddle a 5 minute boundary depending how long the cycle is and when it was started. That is, some inserts could be at 00:45 more could be at 00:50. This could be a problem with or without the patch depending why you want to do it. In my case I just make it a point to start up the poller at a 5 minute boundary. This may not patch cleanly as my line numbers are a bit off and I don't use a 'rate' column. --- RTGDBDriver.java.orig3 2009-01-02 17:52:24.000000000 -0500 +++ RTGDBDriver.java 2009-01-03 00:54:46.000000000 -0500 @@ -171,11 +171,18 @@ try { Connection con = connection.get(); synchronized(con) { + + GregorianCalendar gc = new GregorianCalendar(); + gc.setTime( new java.util.Date( targetValue.timestamp ) ); + gc.set( Calendar.MINUTE, ( gc.get(Calendar.MINUTE) / 5 ) * 5 ); + gc.set( Calendar.SECOND, 0 ); + long newts = gc.getTimeInMillis(); + ps = con.prepareStatement("insert delayed into " + targetValue.name + "_" + targetValue.interfaceValues.deviceValues.RID + " (id, dtime, counter) values " + " (?,?,?)"); ps.setLong(1, targetValue.interfaceValues.IID); - ps.setTimestamp(2, new java.sql.Timestamp(targetValue.timestamp), cal); + ps.setTimestamp(2, new java.sql.Timestamp( newts ), cal); ps.setLong(3, targetValue.value.longValue()); ps.execute(); int count = connectionToCount.get(con) + 1; Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-12-05 23:51:08
|
Laurent, I think you've just got the name of the object wrong. It might be: com.virtela.poller:type=DBDriver,name=inserter (the name depends on what its named in the config.properties file). The command line jmxclient will list all the available objects with / without certain cmd line arguments, and if given an object will list the available properties and methods on the object. So you can use it to do introspection. Also you can use the jconsole application that comes with the jdk, it shows everything and does some other usefult things like graphing properties over time. -Jonathan ________________________________ From: Laurent Geyer [mailto:lg...@gm...] Sent: Friday, December 05, 2008 4:44 PM To: Leech, Jonathan Cc: jrt...@li... Subject: Re: [Jrtg-users] insert() error - NullPointerException Jonathan, Alright, that makes sense. Now I'm just having some difficulties accessing those methods through JMX. lgeyer@xxx:/usr/local/jrtg$ java -jar /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 com.virtela.poller:type=RTGDBDriver pauseDBInserts 12/05/2008 18:42:40 -0500 org.archive.jmx.Client com.virtela.poller:type=RTGDBDriver is not a registered bean lgeyer@xxx:/usr/local/jrtg$ java -jar /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 com.virtela.poller:type=DBDriver pauseDBInserts 12/05/2008 18:42:47 -0500 org.archive.jmx.Client com.virtela.poller:type=DBDriver is not a registered bean What am I missing here? Thanks for your help, Laurent On Fri, Dec 5, 2008 at 5:46 PM, Leech, Jonathan <jl...@vi...> wrote: Laurent, Very good question. The RTGDBDriver has the commitAllTransactions(), and reconnectAll() methods exposed through JMX to do extactly that externally. This would help in scenarios of a planned maintenance, or an outage that is detected quickly. Also you should call pauseDBInserts() on the DBBuffer first. So the steps would be 1) pauseDBInserts() 2) commitAllTransactions() 3) perform database maintenance 4) reconnectAll() 5) resumeDBInserts(). JRTG has not yet been instrumented to automatically reconnect to the database after certain fatal errors. The place to do this would be either the DBDriver class or in the ConnectionWrapper class. I intended to do so in the ConnectionWrapper class, there is even a comment at the top: // TODO: attempt to reconnect to the database after certain SQL errors. This recquires some knowledge of which errors should result in a reconnection and which shouldn't. A good place to find this kind of information might be JBoss connection pool logic, or a similar connection pooling library. The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: if (ps != null) ps.close(); It is masking the real SQLExceptions caused by the database restart. Also, if you have a firewall or some other evil device in between your poller and database, you should probably also add a call to setQueryTimeout() on the PreparedStatement prior to ps.execute() on line 178. I don't know specifically how the mySQL JDBC driver would react to a connection dropped by a firewall, or if it implements setQueryTimeout(), but I can attest to the fact that the Oracle JDBC driver will hang indefinitely on the execute() method if the connection is dropped, unless a timeout is provided. -Jonathan ________________________________ From: Laurent Geyer [mailto:lg...@gm...] Sent: Friday, December 05, 2008 1:52 PM To: jrt...@li... Subject: [Jrtg-users] insert() error - NullPointerException Hi, So far so good. Have had jrtg running little over a month now and it's been solid. Unfortunately today I noticed I lost about two days worth of data. The date it stopped collecting coincided with a MySQL server restart following a MySQL upgrade. Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert WARNING: insert() error. java.lang.NullPointerException at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) at com.virtela.poller.DBDriver.insert(DBDriver.java:220) at com.virtela.poller.DBDriver.insert(DBDriver.java:200) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:907) at java.lang.Thread.run(Thread.java:619) Is there any way I can reconnect the MySQL session and commit the inserts following a restart or loss of connectivity? Thanks, Laurent |
From: Laurent G. <lg...@gm...> - 2008-12-05 23:44:08
|
Jonathan, Alright, that makes sense. Now I'm just having some difficulties accessing those methods through JMX. lgeyer@xxx:/usr/local/jrtg$ java -jar /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 com.virtela.poller:type=RTGDBDriver pauseDBInserts 12/05/2008 18:42:40 -0500 org.archive.jmx.Client com.virtela.poller:type=RTGDBDriver is not a registered bean lgeyer@xxx:/usr/local/jrtg$ java -jar /usr/local/bin/cmdline-jmxclient-0.10.3.jar - localhost:8089 com.virtela.poller:type=DBDriver pauseDBInserts 12/05/2008 18:42:47 -0500 org.archive.jmx.Client com.virtela.poller:type=DBDriver is not a registered bean What am I missing here? Thanks for your help, Laurent On Fri, Dec 5, 2008 at 5:46 PM, Leech, Jonathan <jl...@vi...> wrote: > Laurent, > > Very good question. The RTGDBDriver has the commitAllTransactions(), and > reconnectAll() methods exposed through JMX to do extactly that externally. > This would help in scenarios of a planned maintenance, or an outage that is > detected quickly. Also you should call pauseDBInserts() on the DBBuffer > first. So the steps would be > 1) pauseDBInserts() > 2) commitAllTransactions() > 3) perform database maintenance > 4) reconnectAll() > 5) resumeDBInserts(). > > JRTG has not yet been instrumented to automatically reconnect to the > database after certain fatal errors. The place to do this would be either > the DBDriver class or in the ConnectionWrapper class. I intended to do so in > the ConnectionWrapper class, there is even a comment at the top: // TODO: > attempt to reconnect to the database after certain SQL errors. This > recquires some knowledge of which errors should result in a reconnection and > which shouldn't. A good place to find this kind of information might be > JBoss connection pool logic, or a similar connection pooling library. > > The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: if > (ps != null) ps.close(); It is masking the real SQLExceptions caused by the > database restart. > > Also, if you have a firewall or some other evil device in between your > poller and database, you should probably also add a call to > setQueryTimeout() on the PreparedStatement prior to ps.execute() on line > 178. I don't know specifically how the mySQL JDBC driver would react to a > connection dropped by a firewall, or if it implements setQueryTimeout(), but > I can attest to the fact that the Oracle JDBC driver will hang indefinitely > on the execute() method if the connection is dropped, unless a timeout is > provided. > > -Jonathan > > ------------------------------ > *From:* Laurent Geyer [mailto:lg...@gm...] > *Sent:* Friday, December 05, 2008 1:52 PM > *To:* jrt...@li... > *Subject:* [Jrtg-users] insert() error - NullPointerException > > Hi, > > So far so good. Have had jrtg running little over a month now and it's been > solid. > > Unfortunately today I noticed I lost about two days worth of data. The date > it stopped collecting coincided with a MySQL server restart following a > MySQL upgrade. > > Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert > WARNING: insert() error. > java.lang.NullPointerException > at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) > at com.virtela.poller.DBDriver.insert(DBDriver.java:220) > at com.virtela.poller.DBDriver.insert(DBDriver.java:200) > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) > at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) > at java.lang.Thread.run(Thread.java:619) > > Is there any way I can reconnect the MySQL session and commit the inserts > following a restart or loss of connectivity? > > Thanks, > > Laurent > > > |
From: Leech, J. <jl...@vi...> - 2008-12-05 22:46:31
|
Laurent, Very good question. The RTGDBDriver has the commitAllTransactions(), and reconnectAll() methods exposed through JMX to do extactly that externally. This would help in scenarios of a planned maintenance, or an outage that is detected quickly. Also you should call pauseDBInserts() on the DBBuffer first. So the steps would be 1) pauseDBInserts() 2) commitAllTransactions() 3) perform database maintenance 4) reconnectAll() 5) resumeDBInserts(). JRTG has not yet been instrumented to automatically reconnect to the database after certain fatal errors. The place to do this would be either the DBDriver class or in the ConnectionWrapper class. I intended to do so in the ConnectionWrapper class, there is even a comment at the top: // TODO: attempt to reconnect to the database after certain SQL errors. This recquires some knowledge of which errors should result in a reconnection and which shouldn't. A good place to find this kind of information might be JBoss connection pool logic, or a similar connection pooling library. The NPE is a bug. Line 193 of JRTGDBDriver should be modified to read: if (ps != null) ps.close(); It is masking the real SQLExceptions caused by the database restart. Also, if you have a firewall or some other evil device in between your poller and database, you should probably also add a call to setQueryTimeout() on the PreparedStatement prior to ps.execute() on line 178. I don't know specifically how the mySQL JDBC driver would react to a connection dropped by a firewall, or if it implements setQueryTimeout(), but I can attest to the fact that the Oracle JDBC driver will hang indefinitely on the execute() method if the connection is dropped, unless a timeout is provided. -Jonathan ________________________________ From: Laurent Geyer [mailto:lg...@gm...] Sent: Friday, December 05, 2008 1:52 PM To: jrt...@li... Subject: [Jrtg-users] insert() error - NullPointerException Hi, So far so good. Have had jrtg running little over a month now and it's been solid. Unfortunately today I noticed I lost about two days worth of data. The date it stopped collecting coincided with a MySQL server restart following a MySQL upgrade. Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert WARNING: insert() error. java.lang.NullPointerException at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) at com.virtela.poller.DBDriver.insert(DBDriver.java:220) at com.virtela.poller.DBDriver.insert(DBDriver.java:200) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:907) at java.lang.Thread.run(Thread.java:619) Is there any way I can reconnect the MySQL session and commit the inserts following a restart or loss of connectivity? Thanks, Laurent |
From: Laurent G. <lg...@gm...> - 2008-12-05 20:52:05
|
Hi, So far so good. Have had jrtg running little over a month now and it's been solid. Unfortunately today I noticed I lost about two days worth of data. The date it stopped collecting coincided with a MySQL server restart following a MySQL upgrade. Dec 5, 2008 3:44:34 PM com.virtela.poller.DBDriver insert WARNING: insert() error. java.lang.NullPointerException at com.virtela.poller.RTGDBDriver.insert(RTGDBDriver.java:193) at com.virtela.poller.DBDriver.insert(DBDriver.java:220) at com.virtela.poller.DBDriver.insert(DBDriver.java:200) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:253) at com.virtela.poller.DBBuffer$3.call(DBBuffer.java:250) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) Is there any way I can reconnect the MySQL session and commit the inserts following a restart or loss of connectivity? Thanks, Laurent |
From: Jim A. <ji...@ar...> - 2008-11-23 09:02:05
|
Thanks very much Jonathan... I'll work on this a bit... Leech, Jonathan wrote: > Jim, > > Poller.java grabs the system time in several places. The relevant one > for the database writes occurs right before polling each interface. For > a 24 port switch, all the targets for a particular interface will have > the same poll time, but each interface will have a slightly older poll > time from the next. The interfaces on a device are processed > sequentially in a single thread. > > You want to be careful normalizing the times, so as not to affect the > rate calculations. So don't change the time going in to the > TargetStatistic object, but rather change it at the time of insert in > the database (if you are using RTGDBDriver its on line 175). The safest > / easiest way to do that would be to round the significant digits out of > the poll time (if you have a 5 minute poll cycle, put the times at :00 > :05 :10, etc). Otherwise you would have to take extra care to make sure > your change is compatible with the buffering in DBBuffer. > > Sincerely, > Jonathan Leech > Virtela Communications > > > -----Original Message----- > From: Jim Archer [mailto:ji...@ar...] > Sent: Sunday, November 16, 2008 3:39 AM > To: jrt...@li... > Subject: [Jrtg-users] Poller.java - thread question > > Hello List... > > I have been going through the code, trying to get a handle on how it > works. > I see in Poller.java which appears to be a thread and I see the thread > pool stuff. > > What I am trying to figure out how to do is to somehow sync all the > readings taken during a single poll run, so that they can be grouped > together. > > It looks like Poller.java takes the system time, but there is no reason > to think it would be the same across all the threads. But it only takes > it once, so it would be the same for all devices read by this thread in > a single run. > > So, for any given device, like a 24 port switch, would the readings from > all 24 ports have the same system time and be saved in the database that > way? > > And, if the thread reads more than one device, would the time then be > saved for all reading for all the devices read by the same thread? > > Thanks... > > Jim > > > > ------------------------------------------------------------------------ > - > 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.php?banner_id=100&url=/ > _______________________________________________ > Jrtg-users mailing list > Jrt...@li... > https://lists.sourceforge.net/lists/listinfo/jrtg-users |
From: Bryan W. <bwa...@wa...> - 2008-11-17 17:23:14
|
On Sun, 16 Nov 2008, Jim Archer wrote: > What I am trying to figure out how to do is to somehow sync all the > readings taken during a single poll run, so that they can be grouped > together. I'm interested in this too. I have some aggregation reports I do that extract data from the database table and toss it into RRDs. Very tricky to get ifIn/Out figures to line up since the timestamps are different. I only took a quick look at the code a long time ago for this; I thought it was left to the mysql timestamp on insert. I'm probably wrong though. Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-11-17 16:57:07
|
Jim, Poller.java grabs the system time in several places. The relevant one for the database writes occurs right before polling each interface. For a 24 port switch, all the targets for a particular interface will have the same poll time, but each interface will have a slightly older poll time from the next. The interfaces on a device are processed sequentially in a single thread. You want to be careful normalizing the times, so as not to affect the rate calculations. So don't change the time going in to the TargetStatistic object, but rather change it at the time of insert in the database (if you are using RTGDBDriver its on line 175). The safest / easiest way to do that would be to round the significant digits out of the poll time (if you have a 5 minute poll cycle, put the times at :00 :05 :10, etc). Otherwise you would have to take extra care to make sure your change is compatible with the buffering in DBBuffer. Sincerely, Jonathan Leech Virtela Communications -----Original Message----- From: Jim Archer [mailto:ji...@ar...] Sent: Sunday, November 16, 2008 3:39 AM To: jrt...@li... Subject: [Jrtg-users] Poller.java - thread question Hello List... I have been going through the code, trying to get a handle on how it works. I see in Poller.java which appears to be a thread and I see the thread pool stuff. What I am trying to figure out how to do is to somehow sync all the readings taken during a single poll run, so that they can be grouped together. It looks like Poller.java takes the system time, but there is no reason to think it would be the same across all the threads. But it only takes it once, so it would be the same for all devices read by this thread in a single run. So, for any given device, like a 24 port switch, would the readings from all 24 ports have the same system time and be saved in the database that way? And, if the thread reads more than one device, would the time then be saved for all reading for all the devices read by the same thread? Thanks... Jim ------------------------------------------------------------------------ - 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.php?banner_id=100&url=/ _______________________________________________ Jrtg-users mailing list Jrt...@li... https://lists.sourceforge.net/lists/listinfo/jrtg-users |
From: Jim A. <ji...@ar...> - 2008-11-16 10:54:46
|
Hello List... I have been going through the code, trying to get a handle on how it works. I see in Poller.java which appears to be a thread and I see the thread pool stuff. What I am trying to figure out how to do is to somehow sync all the readings taken during a single poll run, so that they can be grouped together. It looks like Poller.java takes the system time, but there is no reason to think it would be the same across all the threads. But it only takes it once, so it would be the same for all devices read by this thread in a single run. So, for any given device, like a 24 port switch, would the readings from all 24 ports have the same system time and be saved in the database that way? And, if the thread reads more than one device, would the time then be saved for all reading for all the devices read by the same thread? Thanks... Jim |
From: Leech, J. <jl...@vi...> - 2008-11-11 16:14:11
|
Laurent, I just checked and we don't include the source for org.archive.jmx.Client. My apologies. You can get it at this link: http://archive-crawler.cvs.sourceforge.net/viewvc/*checkout*/archive-cra wler/cmdline-jmxclient/src/java/org/archive/jmx/Client.java?revision=1.1 5 -Jonathan -----Original Message----- From: Leech, Jonathan Sent: Monday, November 10, 2008 3:28 PM To: 'Laurent Geyer'; jrt...@li... Subject: RE: [Jrtg-users] Poller Control Laurent, We included the source code for the archive.org jmx client as a convenience, but neglected to document its use. You can do anything from the command line that you can do from the jconsole application, which is another option for you (It comes with the jdk). To reparse the targets: java -classpath build/poller.jar org.archive.jmx.Client -:- localhost:80 com.virtela.poller:type=Poller reparseTargets The -:- is the username : password for jmx if you've configured that. If you run org.archive.jmx.Client with no arguments it shows it usage to standard out. Hope this helps, Jonathan ________________________________ From: Laurent Geyer [mailto:lg...@gm...] Sent: Monday, November 10, 2008 2:32 PM To: jrt...@li... Subject: [Jrtg-users] Poller Control Good day. Been using RTG at my old job for quite some time and I am Currently in the process of deploying jrtg at my current place of employment. So far so good. Two questions. 1) How do I go about using the command line jmx client to controll the poller 2) Is it possible to reparse the targets file from a running instance? Thanks for listening, Laurent |
From: Leech, J. <jl...@vi...> - 2008-11-10 22:47:49
|
Laurent, We included the source code for the archive.org jmx client as a convenience, but neglected to document its use. You can do anything from the command line that you can do from the jconsole application, which is another option for you (It comes with the jdk). To reparse the targets: java -classpath build/poller.jar org.archive.jmx.Client -:- localhost:80 com.virtela.poller:type=Poller reparseTargets The -:- is the username : password for jmx if you've configured that. If you run org.archive.jmx.Client with no arguments it shows it usage to standard out. Hope this helps, Jonathan ________________________________ From: Laurent Geyer [mailto:lg...@gm...] Sent: Monday, November 10, 2008 2:32 PM To: jrt...@li... Subject: [Jrtg-users] Poller Control Good day. Been using RTG at my old job for quite some time and I am Currently in the process of deploying jrtg at my current place of employment. So far so good. Two questions. 1) How do I go about using the command line jmx client to controll the poller 2) Is it possible to reparse the targets file from a running instance? Thanks for listening, Laurent |
From: Laurent G. <lg...@gm...> - 2008-11-10 21:59:39
|
Good day. Been using RTG at my old job for quite some time and I am Currently in the process of deploying jrtg at my current place of employment. So far so good. Two questions. 1) How do I go about using the command line jmx client to controll the poller 2) Is it possible to reparse the targets file from a running instance? Thanks for listening, Laurent |
From: Leech, J. <jl...@vi...> - 2008-09-29 22:41:27
|
Bryan, Sorry to not reply sooner. Somehow I missed your email in my inbox. I am glad to hear JRTG is working so well for you. I am finalizing some of the RRD code. It's a little complex but full featured. I'm not sure if you're familiar with RRDS, but I had to make some sacrifices. Biggest one is not letting the RRD maintain the deltas, since the logic was already in JRTG to do that calculation. Also I don't like the linear interpolation RRDS do by default. I will commit the code to CVS soon, and keep you posted. As for graphing, there are plenty of alternatives to rtgplot. Take a look at JFreeChart. -Jonathan -----Original Message----- From: Bryan Wann [mailto:bwa...@wa...] Sent: Tuesday, September 23, 2008 10:55 AM To: jrt...@li... Subject: [Jrtg-users] JRTG status Just to let you folks know, jrtg is continuing to work very well for me. I don't even have to think about it. The rest of the parts now just need to catch up (this isn't JRTG's problem), rtgplot is sorta aged. Unfortunately I haven't sat down and figured out how to do it better. I forget, was there some mention of possibly adding hooks to output to RRD as well as MySQL? That'd certainly be useful in a few things I have going on. Met vriendelijke groet/kind regards, bryan ------------------------------------------------------------------------ - 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.php?banner_id=100&url=/ _______________________________________________ Jrtg-users mailing list Jrt...@li... https://lists.sourceforge.net/lists/listinfo/jrtg-users |
From: Bryan W. <bwa...@wa...> - 2008-09-23 18:23:08
|
Just to let you folks know, jrtg is continuing to work very well for me. I don't even have to think about it. The rest of the parts now just need to catch up (this isn't JRTG's problem), rtgplot is sorta aged. Unfortunately I haven't sat down and figured out how to do it better. I forget, was there some mention of possibly adding hooks to output to RRD as well as MySQL? That'd certainly be useful in a few things I have going on. Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-05-19 22:10:21
|
That's good. It _should_ handle everything. I will test it too, I need to make sure that old TargetStatistics are garbage collected so JRTG doesn't consume all its available memory as targets are added and removed. -Jonathan -----Original Message----- From: Bryan Wann [mailto:bwa...@wa...] Sent: Monday, May 19, 2008 4:02 PM To: Leech, Jonathan Cc: jrt...@li... Subject: RE: [Fwd: Re: reparse targets via signal?] On Mon, 19 May 2008, Leech, Jonathan wrote: > Oops. If this one doesn't work, let me know and I'll test it first. > Sorry about using you as a guinea pig. That appears to work. I've reparsed the config a few times now and all of the samples in the table are continuous with no missed polls and thus no dips. Presumably the new code should handle adding or removal of targets, but I don't have any new hosts today to test with. Met vriendelijke groet/kind regards, bryan |
From: Bryan W. <bwa...@wa...> - 2008-05-19 22:01:54
|
On Mon, 19 May 2008, Leech, Jonathan wrote: > Oops. If this one doesn't work, let me know and I'll test it first. > Sorry about using you as a guinea pig. That appears to work. I've reparsed the config a few times now and all of the samples in the table are continuous with no missed polls and thus no dips. Presumably the new code should handle adding or removal of targets, but I don't have any new hosts today to test with. Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-05-19 20:49:47
|
Oops. If this one doesn't work, let me know and I'll test it first. Sorry about using you as a guinea pig. -Jonathan package com.virtela.poller; import java.util.*; import java.util.logging.Logger; /** * Target holds statistics for a Target on an Interface. * * @author Jonathan Leech * @author Marc Brashear * @version CVS $Revision: 1.12 $ * @since 1.0 */ public class Target { /** * Creates a Target specifying targetInterface, OID, counter and name. */ public Target ( Interface targetInterface, String OID, boolean counter, String name ) { this.targetInterface = targetInterface; this.OID = OID; this.counter = counter; this.name = name; if (targetInterface != null) { targetStatisticKey = (targetInterface.getIID() + "," + OID).intern(); synchronized (targetToTargetStatistic) { if (!targetToTargetStatistic.containsKey(targetStatisticKey)) { targetStatistic = new TargetStatistic(); targetToTargetStatistic.put(targetStatisticKey, targetStatistic); } else { targetStatistic = targetToTargetStatistic.get(targetStatisticKey); } } } } /** * A weak hash map from a composite key of uniquely identifying information of the target to its targetStatistic. * The composite key is simply the intern() of a String built from the IID and OID. * The target holds on to a reference to the key. * When targets are reparsed, a target that already exists will inherit the already created TargetStatistic. * A target that is removed will be garbage collected, and its corresponding TargetStatistic also garbage collected by nature of the WeakHashMap. */ static Map<String, TargetStatistic> targetToTargetStatistic = new WeakHashMap<String, TargetStatistic>(); /** * The key formed from the intern() of the IID + "," + OID. Must hold on to this reference, otherwise the TargetStatistic will be removed from the WeakHashMap. */ String targetStatisticKey; TargetStatistic targetStatistic; /** * Returns targetStatistic from the target. * * @return the TargetStatistic object from the Target */ public TargetStatistic getTargetStatistic() { return targetStatistic; } Interface targetInterface; /** * Returns target interface. * * @return the target interface */ public Interface getTargetInterface() { return targetInterface; } /** * Set interface for the target. * * @param interface set the interface the target belongs to **/ public void setTargetInterface(Interface targetInterface) { this.targetInterface = targetInterface; targetStatisticKey = (targetInterface.getIID() + "," + OID).intern(); synchronized (targetToTargetStatistic) { if (!targetToTargetStatistic.containsKey(targetStatisticKey)) { targetStatistic = new TargetStatistic(); targetToTargetStatistic.put(targetStatisticKey, targetStatistic); } else { targetStatistic = targetToTargetStatistic.get(targetStatisticKey); } } } String OID; /** * Returns OID from the target. * * @return the OID from the target */ public String getOID() { return OID; } /** * Set OID for the target. * * @param OID set the oid for the target **/ public void setOID(String OID) { this.OID = OID; } boolean counter; /** * Returns counter from the target. * * @return the counter from the target */ public boolean getCounter() { return counter; } /** * Set counter for the target. * * @param counter set the counter for the target **/ public void setCounter(boolean counter) { this.counter = counter; } String name; /** * Returns name of the target. * * @return the name of the target */ public String getName() { return name; } /** * Set name of the target. * * @param name set the name of the target **/ public void setName(String name) { this.name = name; } /** * Returns the Target information in a String. * * @return the string that represents all information in the target. */ public String toString() { return "OID: " + OID + " name: " + name; } public static final String uptimeOID = "1.3.6.1.2.1.1.3.0"; /** * Logger object for logging messages */ static Logger logger = Logger.getLogger("com.virtela.poller.Target"); } -----Original Message----- From: Bryan Wann [mailto:bwa...@wa...] Sent: Monday, May 19, 2008 2:24 PM To: Leech, Jonathan Cc: jrt...@li... Subject: RE: [Fwd: Re: reparse targets via signal?] On Mon, 19 May 2008, Leech, Jonathan wrote: > If you don't mind testing some untested code, the following > com\virtela\poller\Target.java should take care of the missing value > after the reparse. If it works I will incorporate it into the next > JRTG version on sourceforge. It doesn't quite like that. Builds successfully, but dies on startup: Exception in thread "main" java.lang.NullPointerException at com.virtela.poller.Target.<init>(Target.java:31) at com.virtela.poller.RTGTargetParser.parseTargets(RTGTargetParser.java:201 ) at com.virtela.poller.Poller.main(Poller.java:91) where line 31 is: targetStatisticKey = (targetInterface.getIID() + "," + OID).intern(); Met vriendelijke groet/kind regards, bryan |
From: Bryan W. <bwa...@wa...> - 2008-05-19 20:23:52
|
On Mon, 19 May 2008, Leech, Jonathan wrote: > If you don't mind testing some untested code, the following > com\virtela\poller\Target.java should take care of the missing value > after the reparse. If it works I will incorporate it into the next JRTG > version on sourceforge. It doesn't quite like that. Builds successfully, but dies on startup: Exception in thread "main" java.lang.NullPointerException at com.virtela.poller.Target.<init>(Target.java:31) at com.virtela.poller.RTGTargetParser.parseTargets(RTGTargetParser.java:201) at com.virtela.poller.Poller.main(Poller.java:91) where line 31 is: targetStatisticKey = (targetInterface.getIID() + "," + OID).intern(); Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-05-19 19:46:27
|
Bryan, If you don't mind testing some untested code, the following com\virtela\poller\Target.java should take care of the missing value after the reparse. If it works I will incorporate it into the next JRTG version on sourceforge. You could also easily modify RTGDBDriver.java to turn off zero delta inserts. Just wrap the whole insert() method in (targetValue.value.longValue() != 0) {}. I'm not sure why JRTG is reporting more targets than it should, I will check to see if I'm running later code than on sourceforge. -Jonathan // Target.java package com.virtela.poller; import java.util.*; import java.util.logging.Logger; /** * Target holds statistics for a Target on an Interface. * * @author Jonathan Leech * @author Marc Brashear * @version CVS $Revision: 1.12 $ * @since 1.0 */ public class Target { /** * Creates a Target specifying targetInterface, OID, counter and name. */ public Target ( Interface targetInterface, String OID, boolean counter, String name ) { this.targetInterface = targetInterface; this.OID = OID; this.counter = counter; this.name = name; targetStatisticKey = (targetInterface.getIID() + "," + OID).intern(); synchronized (targetToTargetStatistic) { if (!targetToTargetStatistic.containsKey(targetStatisticKey)) { targetStatistic = new TargetStatistic(); targetToTargetStatistic.put(targetStatisticKey, targetStatistic); } else { targetStatistic = targetToTargetStatistic.get(targetStatisticKey); } } } /** * A weak hash map from a composite key of uniquely identifying information of the target to its targetStatistic. * The composite key is simply the intern() of a String built from the IID and OID. * The target holds on to a reference to the key. * When targets are reparsed, a target that already exists will inherit the already created TargetStatistic. * A target that is removed will be garbage collected, and its corresponding TargetStatistic also garbage collected by nature of the WeakHashMap. */ static Map<String, TargetStatistic> targetToTargetStatistic = new WeakHashMap<String, TargetStatistic>(); /** * The key formed from the intern() of the IID + "," + OID. Must hold on to this reference, otherwise the TargetStatistic will be removed from the WeakHashMap. */ String targetStatisticKey; TargetStatistic targetStatistic; /** * Returns targetStatistic from the target. * * @return the TargetStatistic object from the Target */ public TargetStatistic getTargetStatistic() { return targetStatistic; } Interface targetInterface; /** * Returns target interface. * * @return the target interface */ public Interface getTargetInterface() { return targetInterface; } /** * Set interface for the target. * * @param interface set the interface the target belongs to **/ public void setTargetInterface(Interface targetInterface) { this.targetInterface = targetInterface; } String OID; /** * Returns OID from the target. * * @return the OID from the target */ public String getOID() { return OID; } /** * Set OID for the target. * * @param OID set the oid for the target **/ public void setOID(String OID) { this.OID = OID; } boolean counter; /** * Returns counter from the target. * * @return the counter from the target */ public boolean getCounter() { return counter; } /** * Set counter for the target. * * @param counter set the counter for the target **/ public void setCounter(boolean counter) { this.counter = counter; } String name; /** * Returns name of the target. * * @return the name of the target */ public String getName() { return name; } /** * Set name of the target. * * @param name set the name of the target **/ public void setName(String name) { this.name = name; } /** * Returns the Target information in a String. * * @return the string that represents all information in the target. */ public String toString() { return "OID: " + OID + " name: " + name; } public static final String uptimeOID = "1.3.6.1.2.1.1.3.0"; /** * Logger object for logging messages */ static Logger logger = Logger.getLogger("com.virtela.poller.Target"); } -----Original Message----- From: Bryan Wann [mailto:bwa...@wa...] Sent: Monday, May 19, 2008 11:14 AM To: Leech, Jonathan Cc: jrt...@li... Subject: RE: [Fwd: Re: reparse targets via signal?] On Mon, 19 May 2008, Leech, Jonathan wrote: > I can confirm that from the cmdline-jmxclient you can do anything and > everything that you can from jconsole. It's pretty slick. Let me know > if you have any questions how to use it. > > I am not sure what you would do using JBoss. Is it already running on > that server? I suppose you could create a servlet or JSP that makes > the JMX calls, if you want to remotely control JRTG. I was Googling for command-line JMX clients and saw mention of twiddle in the JBoss package. Twiddle looked like something I could use to interact with JRTG, but as I said I hadn't sat down and fully thought it out yet. Now that I have cmdline-jmxclient, all is well. I did notice when I triggered a target reparse, it still managed to insert a dip in my graphs. Looking at the mysql table, it didn't record anything for the expected 12:00 poll cycle after the reparse at 11:57: | 27501 | 2008-05-19 11:55:40 | 870629908 | | 27498 | 2008-05-19 11:55:40 | 55717643 | | 27483 | 2008-05-19 12:05:39 | 1471388 | | 27486 | 2008-05-19 12:05:40 | 1471546 | > I will be uploading a new version sometime soon. Just a few minor bug > fixes. Plus I have created some database drivers to insert into RRD > files using RRD4J. > > I have a couple questions: > How many switches are you polling, and how many total targets? > Did you tweak any of the JRTG configuration? How many poller and > inserter threads are you using? > Are you writing the raw data to the RTG mySQL database? (Just asking > because we have our own schema in an Oracle DB and didn't do much > testing on mySQL) Right now I'm only having JRTG handle my if(In|Out)Octet counters. In my RTG setup, I had split my InOutOctets counters and error/discard counters into seperate target files to run different instances. JRTG will certainly work with either config, I'm not using it to do error/discards since JRTG doesn't have an option to turn off zero delta inserts and I haven't decided how I want to handle the extra table size. Anyways, 99 devices, 12186 interfaces, 24221 targets (JRTG reports 36406?). 20 pollerThreads (it was a guess), 2 inserterThreads. They're all being written to my existing RTG MySQL tables. I'm still using 0.7.4-style schema (no 'rate' column), so the only change I made to the RTGDBDriver class was removing that from the prepared statement. > Marc and I are pleased to have our first user other than us, at least > that posted to the mailing list. We are glad JRTG is working well for > you. I'm sort of surprised I'm the first, perhaps the rest are being very quiet. Met vriendelijke groet/kind regards, bryan |
From: Bryan W. <bwa...@wa...> - 2008-05-19 17:13:36
|
On Mon, 19 May 2008, Leech, Jonathan wrote: > I can confirm that from the cmdline-jmxclient you can do anything and > everything that you can from jconsole. It's pretty slick. Let me know if > you have any questions how to use it. > > I am not sure what you would do using JBoss. Is it already running on > that server? I suppose you could create a servlet or JSP that makes the > JMX calls, if you want to remotely control JRTG. I was Googling for command-line JMX clients and saw mention of twiddle in the JBoss package. Twiddle looked like something I could use to interact with JRTG, but as I said I hadn't sat down and fully thought it out yet. Now that I have cmdline-jmxclient, all is well. I did notice when I triggered a target reparse, it still managed to insert a dip in my graphs. Looking at the mysql table, it didn't record anything for the expected 12:00 poll cycle after the reparse at 11:57: | 27501 | 2008-05-19 11:55:40 | 870629908 | | 27498 | 2008-05-19 11:55:40 | 55717643 | | 27483 | 2008-05-19 12:05:39 | 1471388 | | 27486 | 2008-05-19 12:05:40 | 1471546 | > I will be uploading a new version sometime soon. Just a few minor bug > fixes. Plus I have created some database drivers to insert into RRD > files using RRD4J. > > I have a couple questions: > How many switches are you polling, and how many total targets? > Did you tweak any of the JRTG configuration? How many poller and > inserter threads are you using? > Are you writing the raw data to the RTG mySQL database? (Just asking > because we have our own schema in an Oracle DB and didn't do much > testing on mySQL) Right now I'm only having JRTG handle my if(In|Out)Octet counters. In my RTG setup, I had split my InOutOctets counters and error/discard counters into seperate target files to run different instances. JRTG will certainly work with either config, I'm not using it to do error/discards since JRTG doesn't have an option to turn off zero delta inserts and I haven't decided how I want to handle the extra table size. Anyways, 99 devices, 12186 interfaces, 24221 targets (JRTG reports 36406?). 20 pollerThreads (it was a guess), 2 inserterThreads. They're all being written to my existing RTG MySQL tables. I'm still using 0.7.4-style schema (no 'rate' column), so the only change I made to the RTGDBDriver class was removing that from the prepared statement. > Marc and I are pleased to have our first user other than us, at least > that posted to the mailing list. We are glad JRTG is working well for > you. I'm sort of surprised I'm the first, perhaps the rest are being very quiet. Met vriendelijke groet/kind regards, bryan |
From: Leech, J. <jl...@vi...> - 2008-05-19 16:08:55
|
Bryan, I can confirm that from the cmdline-jmxclient you can do anything and everything that you can from jconsole. It's pretty slick. Let me know if you have any questions how to use it. I am not sure what you would do using JBoss. Is it already running on that server? I suppose you could create a servlet or JSP that makes the JMX calls, if you want to remotely control JRTG. I will be uploading a new version sometime soon. Just a few minor bug fixes. Plus I have created some database drivers to insert into RRD files using RRD4J. I have a couple questions: How many switches are you polling, and how many total targets? Did you tweak any of the JRTG configuration? How many poller and inserter threads are you using? Are you writing the raw data to the RTG mySQL database? (Just asking because we have our own schema in an Oracle DB and didn't do much testing on mySQL) Marc and I are pleased to have our first user other than us, at least that posted to the mailing list. We are glad JRTG is working well for you. Sincerely, Jonathan Leech Virtela Communications ---------------------------- Original Message ---------------------------- Subject: Re: reparse targets via signal? From: "Marc Brashear" <ma...@jb...> Date: Mon, May 19, 2008 9:18 am To: "Bryan Wann" <bwa...@wa...> Cc: "Marc Brashear" <ma...@jb...> jrt...@li... ------------------------------------------------------------------------ -- > On Sun, 18 May 2008, Marc Brashear wrote: > >> You should be able to use JConsole to connect and reparse the targets >> file. Just use the following command line options: >> -Dcom.sun.management.jmxremote.ssl=false Disables JMX SSL transport. >> -Dcom.sun.management.jmxremote.port=8181 Assigns port 8181 for JMX >> traffic. Choose a port not already in use or convenient for passing >> traffic through a firewall. >> -Dcom.sun.management.jmxremote.authenticate=false Disables JMX >> authentication. Refer to the JMX documentation for increased security. > > Thanks for your reply. Unfortunately Jconsole isn't really an option > for me. Our terminal service-based workstations prevent software from > being installed (i.e. the JDK), and more importantly it seems overkill > to fire up a Windows or X application to do something on simple like > trigger a target reload on my JRTG host. I imagine my colleagues > would be even less inclined to mess with it if they had to do it. Not > to mention wanting to do automated target updates from cron. > > It's been several years since my prerequisite Java classes. Are there > any other utilities I can use to speak JMX to JRTG? While I haven't > sit down and fully read up on it, and not even sure if it's the right > tool, could I implement something using JBoss? At least then I could > run it locally on the JRTG host and probably scriptable. > > Otherwise JRTG seems to run very well in my environment. Polling all > of my fully-populated 6509/6513s + sup1/sup2 was taking around ~270 > seconds with RTG. With a stock JRTG config this is down to about a minute. > > > (Tunneling ssh through ssh to another host to run jconsole in X was a > neat trick, but it was painfully slow.) > > > > Met vriendelijke groet/kind regards, > bryan > > There is a command line version of the JMX client here: http://crawler.archive.org/cmdline-jmxclient/index.html Not sure if the project is still active, but I have used cmdline-jmxclient to cron auto target reparses. Should be able to run any method in the jrtg interface summary: http://jrtg.sourceforge.net/docs/ with the ConfigurationMBean and PollerMBean being the most useful for on the fly tuning and updating. Alternatively you can use the Java JMX API to access these methods... Cheers, Marc |