Func Plugin
Dependency :
compile ":func:1.7"
Summary
Description
Func Plugin
This plugin provides an easy way to integrate Func in your web application. Func (Fedora Unified Network Controller) provides a two-way authenticated system to put in communication programs, systems, tools and so on. In fact you can personalize func adding functionality and module to enable a communication with all you need! For any other information about this project, just take a look to the official web site (https://fedorahosted.org/func).Installation
To install this plugin you can proceed using the standard established by grails:grails install-plugin func
funcService
Usage
In grails you can insert a service in all classes just simply defining a variable with service name. So, to use func in you class, just make something like this:class MyClass { def funcService
def myMethod = {
[....]
def modules = funcService.listModules()
[....]
}
}Configuration
You can override the standard func-api configuration. By default, the instantiated service, works in synch mode (async=false), with a single thread and supposing that your ''func-transmit'' and ''func'' scripts are both in the class path. You can naturally change these settings simply overriding your spring bean definition.In ''grails-app/conf/spring/resources'' of your grails application, you can paste (and personalize) this code:funcService(org.func.FuncImpl) {
func = "/yourfolderOne/func"
funcTransmit = "/yourfolderTwo/func-transmit"
nforks=12
async=true
}API Specification
The methods you can call using func services are:- listMinions()
funcService.listMinions()resp. ["client1", "client2.server.lan"]
- call (String client, String module, String method)
[client_name1: func response for this client (could be a simple string, another map, ...), client_name2: func response]
funcService.call("client", "hardware", "info")resp: ["client": [hardwareinfoMap]]
- call (List clients, String module, String method)
funcService.call(["client1", "client2"], "hardware", "info")resp: ["client1": [hardwareinfoMap], "client2": [hardwareInfoMap]]
- call (String client, String module, String method, String parameter)
funcService.call("client1", "command", "run", "ls /tmp")resp: ["client1": ["file1", "file2", "file3"]]
- call (List clients, String module, String method, List parameters)
funcService.call(["client1", "client2"], "command", "run", ["ls /tmp"])resp: ["client1": ["file1", "file2", "file3"], "client2": ["file2", "file4", "file7"]]
- listModules (String client)
funcService.listModules("client")resp: ["client": ["hardware", "command", "system"]]
- listModuleMethods (String client, String module)
funcService.listModules("client", "hardware")resp: ["client": ["info", "method2", "method3"]]
- getProcessResponse(String pid)
funcService.getProcessResponse("127328323.123321")resp: ["status":3, "result":[yourresults]]
List of available modules
It's better to look for these information directly on func website- CertMasterModule - For power users out there, allows manipulating the certmaster from Func's API.
- CommandModule - Running Arbitrary Commands Like SSH Does
- CopyFileModule - Copyfile File Copying and Checksumming
- FileTrackerModule - tracks file changes, for use with FuncInventory
- JBossModule - monitoring and control jboss instances
- IPtablesModule - iptables management
- HardwareModule - Hardware Profilling
- MountModule - mount, unmount, and query mounted resources
- NagiosCheck - be able to call Nagios plugins and get their results, without needing to install nagios. Works with any plugin
- NetappModule - Administer Netapp filers
- NetworkTest - Test out network stuff.
- ProcessModule - Process Info, memory usage, and Killing
- ServiceModule - Service Status and Control
- SysctlModule - Configure kernel parameters at runtime
- RebootModule - Reboot your system
- RpmModule - for any distro that supports RPM, lists installed packages
- SmartModule - Disk Smart (Hard Drive) Status
- UserModule - we still need to implement this :)
- VirtModule - works with koan, KVM, Xen, etc
- YumModule - for any distro that is yum based, installs packages
Plugin History
- v1.3 - 21 July 2008 - Fixed a bug that produces an error during list_minions calls
- v1.2 - 21 July 2008 - Aligned Plugin to Func-Java API. Add async directly in method call
- v1.1 - 15 July 2008 - Aligned Plugin to Func-Java API. Added async communication and method to get async results.
- v1.0 - 12 July 2008 - First Plugin Releases
Authors
- Marco Mornati (mmornati (AT) byte-code (DOT) com)
- Others Byte-Code programmers http://www.byte-code.com