OpenNetAdmin

Track. Automate. Configure.

Home About Features Community Develop
Download this project as a tar.gz file

Plugins and Addons/Utils

imu

19-10-2011 07:41:08

a bunch of newbie :D questions:

what is the difference between Plugins (http://opennetadmin.com/docs/plugins) and AddOns (http://opennetadmin.com/docs/utils)?

Are Plugins always something living in www/ona/... ?
And Addons/Utils are something like "remote tools" living outside ONA ...?

So if I need to extend functionality of ONA, I would write my own plugin? Or can I write a script living in www/modules/ona?
How can I write my own plugins? Is there a description of the plugin framework or at least a simple example to start from?

If I need for example a way to extract statistic information from ONA or input data for another system, should I write a plugin or should I write a Tool based on dcm.pl?

Why are most links broken on http://opennetadmin.com/docs/plugins?

Matt

19-10-2011 10:14:59

These are all great newbie questions! Here we go.....

First off, these terms have all evolved along the way and could probably stand some standardization and rework but I think we can describe them in a meaningful way.

I would say yes addons are things that could live standalone without ONA (to a certain extent) and could live outside of ONA though I typically install mine in /opt/ona/bin.

Plugins are something that came along later and are intended to extend functionality of ONA itself. They are typically installed in www/local/plugins but I do have a location that I install default plugins that come with ONA (www/plugins). The goal of www/local is that it would contain user level changes that dont get touched when upgrades happen. This would be the dir you want to make sure you back up so that you can restore if needed.

You will also see the www/modules.. this was the really old original place for functions within ONA and is mainly where dcm.pl modules live. This is currently more core functionality and should not be a location to put your updates/additions to ONA. All of the things that could be done here are now done via plugins, including creating modules that are exposed via dcm.pl.

So If you want to extend ONA, yes you should write your own plugin and it would live in www/local/plugins and could then be shared with others.

As far as documentation, boy that would be great.. I've not done any but the more you bug me the more motivated I'll be to fix that problem. Plus if you want to help I'll gladly give you access to the wiki to help flesh that out. I'll do my best to help you along the way with understanding it all. There is a framework to work in, and I'll be the first to admit it probably isn't the best way to do it all but at least it works for now.

I'd say your statistic functionality could be done either way.. I'd like to see things done as plugins so they can be shared more easily but it all depends on what you are trying to go for. I do have a "reporting" system as well that sounds like it could help out.

The reason most links are broken on the plugins page is this. I listed out the plugins that I have created for myself to try and create some interest in it all. I have not however officially released them yet so thats why the pages are just broken. They need a little cleanup in a few cases to make them more workable for the masses. I'll gladly send you any of them if you are interested though.

If you wish to get deeper into this you might want to join us on IRC in #ona (freenode.net).

I'd also suggest looking at other plugins to get an idea of how they work and what can be done. I'm attaching my "example" plugin so you can see the basic framework there. A good one to look at is the www/plugins/ona_nmap_scans as it has reports, sql, installer, dcm modules etc.

Hope that helps, and thanks for your intrest!