Started by abeeson, May 01, 2014, 11:21:25 am
Quote from: matt on May 02, 2014, 07:30:09 amHello abeeson,As I understand it, you are going to create and delete zones in NicTool, ignore their export (b/c puppet already created them), and then publish zone record updates via the nsupdate mechanism.It seems the "most likely to be usable by others" approach would be to create a new export class (perhaps NicToolServer::Export::BIND::nsupdate) with a configurable set of export objects that you want to suppress (z.add, z.del, zr.ptr, etc.). Then you could have a fully working export mechanism for a NS via your export class, as well as a customized one for your puppet integration whose changes are merely config objects.One issue you'll need to resolve is that the NicTool DB schema only updates timestamps on modified *zones*. All the present export mechanisms do a full export for any zone with changes. You wish to only export zone record updates, so your shortest path to finding zr updates might be spelunking in the nt_zone_record_log.(Sorry, there's currently no callbacks or triggers to automatically kick off an export immediately after update. That's something I plan to add in a future version of NicTool that will likely run under node.js.)
QuoteLooking through your code it looks like you have tried to use API calls as much as possible to avoid duplication of code etc which i think is a great idea, but i'm trying to find a way to pull just the last x minutes of logs (lets call it 30) and i cant see a way to do this with the API calls directly.
QuoteThe SQL i have so far is: select * from nt_user_global_log where timestamp > $time ($time set earlier to = time-1800 for now) and i'm using the passed dbix_w handle to make the calls. (i'll likely drop that down to 5 minutes or faster and run the cron on that schedule)
SELECT * FROM nictool.nt_user_global_log WHERE timestamp > (SELECT UNIX_TIMESTAMP(date_start) FROM nt_nameserver_export_log WHERE success=1 AND nt_nameserver_id=3 ORDER BY date_start DESC LIMIT 1)
SELECT * FROM nictool.nt_user_global_log WHERE timestamp > (SELECT UNIX_TIMESTAMP(date_start) FROM nt_nameserver_export_log WHERE success=1 AND nt_nameserver_id=3 ORDER BY date_start DESC LIMIT 1) AND object IN ('zone','zone_record')[code]
Page created in 0.124 seconds with 21 queries.