Things i've made

Looking for more? See a list of everything i've made.

Saturday, December 3, 2011

High performance NCSA alternative for Nagios

Ive worked with some non-trivial nagios setups: ~5 nagios nodes with each performing 20-50 service checks per second. If you have never worked with distributed nagios deployments then you would be oblivious to the pain that NCSA can cause. First off I should start be saying that NCSA is responsible for reporting the results of service checks on remote nagios nodes back to the master nagios nodes, essentially allowing the setup to be distributed. What no one tells you when you are deploy NCSA is that it send service checks in series while nagios performs service checks in parallel. If your nagios node is already operating at capacity and you try and have it report to a master node, you are going to see service check results queue up and then services start to appear as if they are flapping.

Not being able to find a simple solution to the NCSA backlog problem I went and created a micro daemon that replaces NCSA with something a lot more high performance so instead of NCSA being the bottle neck, that role is back on nagios itself. Another fantastic feature of this NCSA replacement is that it emits service checks for itself so you can monitor how many service checks per second are being proxied and how many bytes/second that is - great if you have little bandwidth.

Qt-Wrapper for Gtk nearly done

If you have been following my progress with the Gtk to Qt porting wrapper I am working on then you will be pleased to know that it has reached to %90-%95 functionality milestone. The large application I am porting works quite well for most workflows. Along the way I ended up creating a Gtk wrapper for the Qt wrapper on Scintilla so applications using the Gtk interface to Scintilla will compile and run without modification.

The most recent completed challenge was to perfectly emulate Gtk's hide/show mechanism. In Gtk, widgets are created hidden, you can then show them, or use show all which will show all child widgets as well. Additionally, Gtk widgets have a dont-show-all flag which will prevent a widget from being shown if its parent is part of a show-all operation. In Qt, a widget can be shown which will implicitly also show its children widgets unless they have been explicitly hidden in which case they will only become visible if explicit shown.  To emulate Gtk I simply hid each widget on creation and added a flag to indicate dont-show-all. When show is called, children widgets won't be shown because they were hidden. When showing all, it iterate through all child widgets and if the dont-show-all flag is not set, then I show all on those.

With the currently implemented in the wrapper, it is pleasing to take a Gtk application, compile it against the wrapper, and actually be able to use the compiled application.

Some nagging issues remain like event ordering or exact widget state which is not documented in Gtk. Its not possible to know every detail since some are specific to how Gtk is implemented rather than its intended functionality. This causes some headaches but with good debugging tools and some patience, the number of these issues is being reduced.

Want to see your Gtk application running in Qt?