Enabling/disabling agent plugin using REST or remote API
Environment
- Red Hat JBoss Operations Network (ON) 3.3
- Red Hat JBoss ON REST API 3.3
- Red Hat JBoss ON Command Line Interface (CLI) 3.3
Issue
- Enabling/disabling agent plugin using REST or remote API
- I am looking for a rest call or a cli which helps me enabling and disabling the plugin on specific Agent.
Resolution
There is no way to disable/enable agent plugin using JBoss ON This content is not included.REST API.
As of JBoss Operations Network 3.3 Update 11, the Remote API supports the This content is not included.PluginManager.disablePlugins(List
Root Cause
According to the JBoss ON This content is not included.Remote API it should be possible to use PluginManager to disable/enable plugins. However, attempt to use one of the methods disablePlugin, enablePlugin or deletePlugin fails with the message:
org.jboss.remoting.CannotConnectException: Can not connect http client invoker after 1 attempt(s)
This was due to in incorrect class mapping used by the CLI.
This issue was captured in This content is not included.Red Hat Bugzilla 1522728.
Diagnostic Steps
Execute the following and note the error at the end:
$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -s test.usersys.redhat.com -t 7080
RHQ Enterprise Remote CLI 4.12.0.JON330GA Update 09
Remote server version is: 3.3.0.GA Update 09 (fcb34f1:80f74f5)
Login successful
rhqadmin@test.usersys.redhat.com:7080$ var pluginCriteria = PluginCriteria();
rhqadmin@test.usersys.redhat.com:7080$ pluginCriteria.addFilterDisplayName("IIS");
rhqadmin@test.usersys.redhat.com:7080$ var plugins = PluginManager.findPluginsByCriteria(pluginCriteria);
rhqadmin@test.usersys.redhat.com:7080$ var myPlugin = plugins.get(0);
rhqadmin@test.usersys.redhat.com:7080$ var pluginID = myPlugin.getId()
rhqadmin@test.usersys.redhat.com:7080$ var allPluginIDs = []
rhqadmin@test.usersys.redhat.com:7080$ allPluginIDs.push(pluginID);
1.0
rhqadmin@test.usersys.redhat.com:7080$ pretty.print(allPluginIDs);
one row
10005
rhqadmin@test.usersys.redhat.com:7080$ PluginManager.disablePlugins(allPluginIDs);
org.jboss.remoting.CannotConnectException: Can not connect http client invoker after 1 attempt(s)
PluginManager.disablePlugins(allPluginIDs);
^
Check the server.log file in DEBUG mode and confirm that the following is logged there:
15:49:37,153 ERROR [org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler] (http-10.36.116.237:7080-1) Failed to invoke remote request: java.lang.IllegalArgumentException: InvocationRequest did not supply method.
at org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler.invoke(RemoteSafeInvocationHandler.java:93) [rhq-server.jar:4.12.0.JON330GA-redhat-9]
...
15:49:37,159 DEBUG [org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler] (http-10.36.116.237:7080-1) Remote request [null] execution time (ms): 6
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.