How do you set the RHQ event source (not sourceLocation)?
by Ginny Brown
Hi folks,
I am using RHQ 3.0.0 and have an RHQ agent plugin that sends events. When
creating a new event, I set all the allowed parameters through the
constructor:
import org.rhq.core.domain.event.Event;
Event(String type, String sourceLocation, Date timestamp, EventSeverity
severity, String detail)
Code sample (all parameters passed in are the expected types):
Event event = new Event(getEventType(), source,
System.currentTimeMillis(), rhqSeverity, jsonString);
log.info("Event SourceLocation = " + event.getSourceLocation());
log.info("Adding Alarm event to set: " + event.toString());
agent.log output:
2013-04-01 19:30:45,076 INFO [EventManager.poller-1]
(seachange.monitoring.plugins.SpotAlarms.SpotAlarmsEventPoller)- Event
SourceLocation = SECQAMVL.Archive
2013-04-01 19:30:45,076 INFO [EventManager.poller-1]
(seachange.monitoring.plugins.SpotAlarms.SpotAlarmsEventPoller)- Adding
Alarm event to set: Event[id=0, *source=null*, timestamp=1364859045076,
severity=INFO,
detail={"uuid":"e810101f-146d-4ba4-a7e1-c32f022ab541","alarmDateTime":"Fri
Sep 21 12:34:26 EDT 2012","alarmMessage":"Name Archive Service: restore
archived file to MVL completed, ID 1385 ","eventDateTime":"Fri Sep 21
12:34:16 EDT 2012","eventCount":1,"alarmName":"Archive Service: restore
archived file to MVL
completed","alarmId":1385,"eventType":"Alarm","alarmSeqNumber":2719,"alarmSeverity":"Low","eventParameters":"[MV,
TEST-01, SECQAMVL,
12]","eventSource":"Archive","eventComputer":"SECQAMVL","alarmCategory":"Software","eventId":1076494369,"eventSeverity":"Information","pluginSeqNum":"SECQAMVL.111","pluginResource":"SpotAlarms
(gbrown-w7.schange.com)","alarmSource":"Archive","alarmType":"Trigger"}]
Everything looks fine, except that the event source is null. It looks like
I can get/set the sourceLocation, but only get the source. What uses the
event source, and does it get set somewhere else? Is there anyway that I
can set the source from the plugin?
Thanks!
Virginia Brown
10 years, 11 months
Mixing JMX and non-JMX
by Ken Hancock
I'm running into an issue trying to create a single plugin for a number of
different java services. We'd like to stick with a single plugin as it
eases deployment, but RHQ seems to have an issue with mixing JMX and
non-JMX.
In my rhq-plugin.xml I have a service (JMX) and a server component (custom
discovery class). If I place the JMX service first in the xml, I get the
following error when the plugin is uploaded to RHQ Server:
2013-04-26 20:23:49,256 WARN
[org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] Does not
look like [/local/rhq/rhq-server-3.0.0/plugins/myproduct-0.6.56.jar.fixme]
is a plugin jar -(Cause: java.lang.NullPointerException:no xml descriptor
found in jar). It will be ignored. Please fix that file or remove it.
If I place the server section first followed by the JMX service, the JMX
service is ignored and never discovered.
Is there something in the documentation that I'm missing that this isn't
supported or something invalid with the XML?
Thanks,
Ken
<plugin name="myProduct"
displayName="myProduct"
version="0.6.56"
package="com.test"
description="myProduct "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
<depends plugin="JMX" useClasses="true"/>
<service name="ServiceOneJMX" description="ServiceOneJMX"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="org.rhq.plugins.jmx.MBeanResourceComponent"
singleton="true" >
<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX" />
</runs-inside>
<plugin-configuration>
<c:simple-property name="objectName"
default="com.test.monitoring:type=ServiceOneMBean" readOnly="true" />
<c:simple-property name="nameTemplate"
default="ServiceOneMBean" />
</plugin-configuration>
<metric property="MonitoringStartTime"
displayName="Last Service Restart"
displayType="summary"
defaultOn="true"
category="availability"
dataType="trait" />
<!-- If the below service is removed, JMX runs fine -->
<server name="ServiceTwo"
discovery="ServiceTwoDiscoveryComponent"
class="ServiceTwoComponent"
description="ServiceTwo"
singleton="true">
<process-scan name="unix"
query="process|basename|match=^java*,arg|org.apache.catalina.startup.Bootstrap|match=.*"
/>
<metric property="version"
displayName="ServiceTwo Version"
dataType="trait"
displayType="summary"
defaultInterval="900000"/>
</server>
</plugin>
11 years
Including JVM in RHQ plugin
by Ken Hancock
I'm trying to include the JMX/JVM as a sub-server for one of my processes
in my RHQ plugin under RHQ 3.0. I'm following the documentation on the
wiki (https://docs.jboss.org/author/display/RHQ/AMPS-Plugin+Extensions) and
also referenced the jboss-as RHQ plugin in the same source tree. I think
I've got all the bases covered with one exception, but it's not working.
Any ideas?
1) added JMX depends to the rhq-plugin.xml:
<depends plugin="JMX" useClasses="true"/>
2) I've SKIPPED the runs-inside as I wish the plugin to be placed under the
parent platform instead of burried along with all the JMX services.
<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX" />
</runs-inside>
3) added a JVM server to MyServer to test:
<server name="MyServer"
discovery="MyServerDiscoveryComponent"
class="MyServerComponent"
description="MyServer Service"
singleton="true">
<process-scan name="unix"
query="process|basename|match=^java*,arg|-classpath|match=.*/foo.bar.myserver\.jar.*"
/>
<metric property="version"
displayName="MyServer Version"
dataType="trait"
displayType="summary"
defaultInterval="900000"/>
<server name="MyServer JVM"
description="JVM"
sourcePlugin="JMX"
sourceType="JMX Server"
discovery="org.rhq.plugins.jmx.EmbeddedJMXServerDiscoveryComponent"
class="org.rhq.plugins.jmx.JMXServerComponent"
singleton="true">
</server>
3) agent.log shows the following:
2013-04-16 17:46:56,109 WARN [InventoryManager.discovery-1]
(rhq.core.pc.inventory.InventoryManager)- Failure during discovery for
[MyServer JVM] Resources - failed after 1 ms.
java.lang.Exception: Discovery component invocation failed.
at
org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:283)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: foo.bar.MyServerComponent cannot
be cast to org.rhq.plugins.jmx.JMXComponent
at
org.rhq.plugins.jmx.EmbeddedJMXServerDiscoveryComponent.discoverResources(EmbeddedJMXServerDiscoveryComponent.java:56)
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:279)
11 years
CLI vs. RHQ-Server package version display
by Matthew Rivet
1. Problem:
2. RHQ-Server(JON 3.1.2) is not displaying the war/ear version as
expected from the CLI.
3.
4. Packages are being updated using child.updateBackingContent(fileName,
"2.2");
5. In the RHQ-Server GUI under content tab interface the displayed
version is 2.2 as intended.
6.
7. The problem is observed when:
8. var ins = ProxyFactory.getResource(10222); (jboss server ID)
9. var package = ins.children[0] (index of content updated with version
2.2)
10. availability: ?
11. backingContent:
InstalledPackage[resource=nwna.war,packageVersion=nwna.war]
12. children:
13. contentTypes: {file=WAR File}
14. contextRoot: nwna
15. createdDate: Tue Apr 16 14:10:21 EDT 2013
16. description: a standalone web application (WAR)
17. exploded: no
18. handler:
19. id: 10341
20. measurements: [Context Root, Exploded?, Path, Virtual Hosts,
Availability]
21. modifiedDate: Tue Apr 16 14:10:21 EDT 2013
22. name: nwna.war
23. operations: [stop, restart, start]
24. path: /srv/jboss/server/estoredev1/deploy/nwna.war
25. pluginConfiguration:
26. pluginConfigurationDefinition: ConfigurationDefinition[id=11449,
name=Web Application (WAR)]
27. resourceType: Web Application (WAR)
28. version:
29. virtualHosts: localhost
30.
31. Version is Null and when:
32. package.backingContent
33.
34. installationDate: 1366138303505
35. packageVersion:
PackageVersion[package=Package[name=nwna.war,packageType=PackageType[id=10016,name=file,resourceType=Web
Application
(WAR)]],version=[sha256=69b650efc0422e6daf3bddd8cb3c6f3bc3ac243af37c97ddb6e12e4316a9ec63],architecture=Architecture:
name=[noarch]]
36. resource: Resource[id=10341,
uuid=6e4c37b7-9fc8-4b89-b6f8-e544a7ebd027, type={JBossAS5}Web Application
(WAR), key={default}nwna.war, name=nwna.war]
37. user:
38.
39. The version supplied here is the SHA default, not what is displayed
in RHQ-Server GUI
--
Matthew Rivet
11 years
follow up from rhqctl demo
by John Sanda
Earlier today I did a demo of the new rhqctl script being developed in the feature/cassandra-backend branch. Here are links for some initial docs and for the demo on youtube.
https://www.youtube.com/watch?feature=player_embedded&v=sFXYMHV-e04
https://docs.jboss.org/author/display/RHQ/RHQ+Control+Script
I consolidated the Q&A from the demo below.
Question
Can I see the script without building the whole source tree?
Answer
The script can be found in the source tree at <RHQ_ROOT>/modules/enterprise/server/appserver/src/main/bin-resources/bin but you will need to build the source in order for it to be usable. In particular you will need to build the feature/cassandra-backend branch.
Question
Is it possible for the logs of the different services to become intertwined?
Answer
With the install command, services log to both stdout and to their own log files. rhqctl installs thing serially which should help limit the possibility of seeing log messages interwoven on stdout. rhqctl first installs the storage node and then waits until it is up and running (in the background) and read to accept client connections before proceeding. Then it moves onto the server installation. The agent is install is not started until rhqctl verifies that the server is fully initialized where you can log in via the web UI. This approach should help with reducing the chances of getting log output mixed up.
Question
Where are the pid files stored? Are the locations configurable? What about for RPM?
Answer
The default location for pid files is <RHQ_SERVER>/bin for the server, <RHQ_AGENT>/bin for the agent, and <RHQ_STORAGE>/bin for the storage node. The server and agent pid location is customizable via environment variables. Currently the storage node is installed with the cassandra script and the location of its pid can be specified with a command line option. We will implement an rhq-storage.(sh|bat) script with behavior consistent with that of the server and agent scripts.
Question
Are there equivalent files like rhq-server.properties or is everything integrated into one common file?
Answer
There is no common, shared config file. When rhqctl installs the agent, it updates the rhq.agent.server.bind-address property in agent-configuration.xml. And for the storage node, rhqctl delegates to rhq-storage-installer.sh which updates <RHQ_STORAGE>/conf/cassandra.yaml.
Question
How does this work on Windows?
Answer
The rhqctl script has not been ported to Windows yet. The bulk of the functionality is implemented in Java and is deployed as a JBoss module. This will hopefully reduce the effort in porting it to Windows as well as the overall maintenance. The rhqctl.sh script itself should be very easy to port. We need to test on Windows to see what if any changes are needed in the Java code in order to provide consistent behavior and functionality on both Linux and Windows platforms.
Question
Can launch preferences be stored so that only certain processes are run? e.g. I only want to run the agent + storage on a machine.
Answer
I have updated the server installer to generate a file marker at the end of a successful install. rhqctl looks for that marker to determine if the server has been installed. If you haven't installed the server, i.e., that marker does not exist, then rhqctl would only ever start agent + storage. Assuming you have installed the server, then there will be a config file of some sort where we could tell rhqctl to only ever start agent + storage. This not yet implemented though.
Question
What happens if an agent is installed already and you try installing with --storage?
Answer
Only the storage node will be installed. When you pass the --storage option to the install command, rhqctl will install the storage node and then if the agent is not already installed, it will install the agent.
Question
What happens when running "rhqctl console --server --agent"? Do the log messages interleave?
Answer
That is in invalid command line for the console command. rhqctl will simply display the usage/help and exit.
Question
Can I assume that the rhqctl script just delegates to scripts we already have?
Answer
yes
Question
Can the agent shell be broken out into a different command which connects to a running agent?
Answer
What is being asked is being able to "log in" to an agent similar to how you ssh into a machine. There is no functionality like that today in the agent. It is definitely possible though. I have already done a little work with piping input/output streams to get "rhqctl console --agent" working. There is still work to be done to get it functioning properly. Once that is in place though, it shouldn't be too much effort to redirect I/O from streams other than stdin/stdout.
Question
How would rhqctl work with storage running under a different user than the user who runs the agent?
Answer
This is a tough one when considering a primary objective of rhqctl is to just to the right thing while keeping things simple for the user. Suppose I run "rhqctl start" and I have perms for the storage node but not for the agent. Is the right thing here for rhqctl to start the storage node and log a warning that the user doesn't have perms? Or should rhctl just start the storage node and ignore the agent since the user doesn't have perms. I prefer logging the warning by default. When we provide some sort of launch preferences of config file for rhqctl, then the user could use that to tell rhqctl to only start the storage node so that the user won't see warning messages about the agent.
Question
How would you start everything at boot time?
Answer
I need to see what if any changes are needed so that rhqctl.sh can be used with init.d. The rhq-storage.sh script will be implemented as an init.d script just like rhq-server.sh. We use the Java service wrapper for Windows which only supports a 32 bit JVM. Stefan and I plan to investigate PowerShell to see if it offers any options that might be worth pursuing.
11 years
Connecting to a SQL Server using Windows Authentication
by Mike Domondon
Hi,
I have a plugin that connects to an SQL Database to gather information for
some metrics. It works okay until I restart the plugin from the RHQ UI
(Agent>Operations>New>Restart
Agent>Schedule)
After this, when the plugin tries to connect to the Database I get this
error:
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not
loaded. Check the java.library.path system property
ntlmauth.dll is used by Windows Authentication and exists in the path. I
did some research on the web, it seems, Windows and Java hove some issues
when it comes to loading DLLs...
from http://www.eclipsezone.com/articles/eclipse-vms/
<http://www.eclipsezone.com/articles/eclipse-vms/>
*"It's worth bearing in mind that Windows and Java have some issues when it
comes to loading DLLs. A DLL can only be loaded once in a VM and only
associated with one ClassLoader. If you have two ClassLoaders, and they
attempt to load the same DLL, then the second one will fail and not be able
to execute any native code. As a result of this, you cannot have two
bundles that attempt to load the same native code in Eclipse. This will
also apply if the bundle is updated or restarted, because the old
ClassLoader may retain a reference to the DLL whilst the new one starts.
This is a Windows-specific problem that doesn't appear to manifest itself
on other operating systems." *
*
*
Has anyone encountered this problem before? Is there a workaround for this
in RHQ?
Thanks,
Mike
*
*
*
*
11 years
Fwd: [ANNOUNCE] PostgreSQL 9.2.4, 9.1.9, 9.0.13 and 8.4.17 released
by Heiko W.Rupp
FYI for all users using PostgreSQL as database
Anfang der weitergeleiteten E-Mail:
> Von: Dave Page <dpage(a)postgresql.org>
> Betreff: [ANNOUNCE] PostgreSQL 9.2.4, 9.1.9, 9.0.13 and 8.4.17 released
> Datum: 4. April 2013 15:29:55 MESZ
> An: pgsql-announce <pgsql-announce(a)postgresql.org>
>
> The PostgreSQL Global Development Group has released a security update to all
> current versions of the PostgreSQL database system, including versions 9.2.4,
> 9.1.9, 9.0.13, and 8.4.17. This update fixes a high-exposure security
> vulnerability in versions 9.0 and later. All users of the affected versions
> are strongly urged to apply the update *immediately*.
>
> A major security issue fixed in this release, CVE-2013-1899
> (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1899), makes it
> possible for a connection request containing a database name that begins
> with "-" to be crafted that can damage or destroy files within a server's
> data directory. Anyone with access to the port the PostgreSQL server listens
> on can initiate this request. This issue was discovered by Mitsumasa Kondo
> and Kyotaro Horiguchi of NTT Open Source Software Center.
>
> Two lesser security fixes are also included in this release: CVE-2013-1900
> (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1900), wherein random
> numbers generated by contrib/pgcrypto functions may be easy for another
> database user to guess, and CVE-2013-1901
> (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1901), which
> mistakenly allows an unprivileged user to run commands that could interfere
> with in-progress backups. Finally, this release fixes two security issues
> with the graphical installers for Linux and Mac OS X: insecure passing of
> superuser passwords to a script, CVE-2013-1903
> (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1903) and the use of
> predictable filenames in /tmp CVE-2013-1902
> (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1902). Marko Kreen,
> Noah Misch and Stefan Kaltenbrunner reported these issues, respectively.
>
> We are grateful for each developer's efforts in making PostgreSQL more secure.
>
> This release also corrects several errors in management of GiST indexes. After
> installing this update, it is advisable to REINDEX any GiST indexes that meet
> one or more of the conditions described below.
>
> This update release also contains fixes for many minor issues discovered and
> patched by the PostgreSQL community in the last two months, including:
>
> * Fix GiST indexes to not use "fuzzy" geometric comparisons for box, polygon,
> circle, and point columns
> * Fix bugs in contrib/btree_gist for GiST indexes on text, bytea, bit, and
> numeric columns
> * Fix bugs in page splitting code for multi-column GiST indexes
> * Fix buffer leak in WAL replay causing "incorrect local pin count" errors
> * Ensure crash recovery before entering archive recovery during unclean
> shutdown when recovery.conf is present
> * Avoid deleting not-yet-archived WAL files during crash recovery
> * Fix race condition in DELETE RETURNING
> * Fix possible planner crash after adding columns to a view depending on
> another view
> * Eliminate memory leaks in PL/Perl's spi_prepare() function
> * Fix pg_dumpall to handle database names containing "=" correctly
> * Avoid crash in pg_dump when an incorrect connection string is given
> * Ignore invalid indexes in pg_dump and pg_upgrade
> * Include only the current server version's subdirectory when backing up a
> tablespace with pg_basebackup
> * Add a server version check in pg_basebackup and pg_receivexlog
> * Fix contrib/dblink to handle inconsistent settings of DateStyle or
> IntervalStyle safely
> * Fix contrib/pg_trgm's similarity() function to return zero for trigram-less
> strings
> * Enable building PostgreSQL with Microsoft Visual Studio 2012
> * Update time zone data files for DST law changes in Chile, Haiti, Morocco,
> Paraguay, and some Russian areas
>
> As always, update releases only require installation of packages and a
> database system restart. You do not need to dump/restore or use pg_upgrade
> for this update release. Users who have skipped multiple update releases may
> need to perform additional, post-update steps; see the Release Notes for
> details.
>
> Links:
>
> * Download: http://postgresql.org/download
> * Release Notes: http://www.postgresql.org/docs/current/static/release.html
> * Release FAQ: http://www.postgresql.org/support/security/faq/2013-04-04/
>
> --
> Dave Page
> PostgreSQL Core Team
> http://www.postgresql.org/
>
>
> --
> Sent via pgsql-announce mailing list (pgsql-announce(a)postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-announce
--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera
11 years, 1 month