Java mission control configure events from command line - events

I want to configure JMC such that it will send email notifications when CPU hike beyond a threhold. I want to do it from command line because JMC will be run from the Jenkins job.

Sorry, no server side rules engine just yet. :)

Related

MMASetup Command Line Parameters for SCOM

I'm installing the latest MMASetup-AMD64.exe and want to hook up to Log Analytics AND SCOM. But, I'm having trouble finding the command line parameters for SCOM. Does anybody know them? The Log Analytics ones are well documented and are here:
ADD_OPINSIGHTS_WORKSPACE=1
OPINSIGHTS_WORKSPACE_ID="1234"
OPINSIGHTS_WORKSPACE_KEY="5678"
I need the equivalent parameters for management group name and management server. Effectively completing these boxes but via the command line.
Thanks in advance.
I believe parameters for management group, secure port, etc. are not available with MMASetup-AMD64.exe. Here are the supported command line options with it. So may be, if its feasible in your environment and setup, try to use MOMAgent.msi to install agent manually or to deploy System Center Operations Manager agents from the command line or by using the Setup Wizard. The parameters like MANAGEMENT_GROUP, SECURE_PORT, etc. are all explained along with examples in this document. For more information, please refer it.
Other references related to OM agents and OM groups:
Process manual agent installations
Configuring Windows agents
Operations Manager agents
Creating and managing groups
Connecting management groups in Operations Manager
Planning a Management Group Design

How do I restart a failed JSR-352 job running in Liberty through Eclipse / WDT?

While running the Java EE Batch job through eclipse, it is creating a new instance of it.
I wanted to re-run the failed instance so that it can use checkpoint information to resume from the failed point.
Step 1: Deploy Application into Liberty server.
Step 2: Run the batchManger.bat file from cmd, which can find under bin folder of your local server
.\batchManager.bat restart --batchManager=localhost:9443 --user=admin --password=P#ssw0rd --applicationName=your-app-Name --jobXMLName=XXXX.xml --wait --trustSslCertificates
Another (GUI) approach is to use the Admin Center Java Batch tool, which allows you to restart jobs submitted by other methods. You can reuse, and/or modify the original job execution parameters.
This also provides a rich set of search and filtering capabilities, plus lets you view job logs, and so complements the job submission capability in the Eclipse Java EE Batch tooling.
Start here for complete instructions on using Admin Center. In particular you need to make sure the adminCenter-1.0 feature is installed then configure a userid to be authorized as the administrator.
Then, as the Java Batch tool instructions say, configure your server.xml with features:
adminCenter-1.0
batchManagement-1.0

Viewing TeamCity service messages

I'm troubleshooting a build step in TeamCity 9.0.4. The problem seems to lie within the service message output. Is it possible to view these after the build has completed? They are not included in the build log.
The documentation on service messages simply says In order to be processed by TeamCity, they should be printed into a standard output stream of the build.
https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity
(To some extent the service messages can be viewed by manually rerunning the build step and monitoring standard output, but this is not always feasible.)
The documentation for service message implies that you need to write service messages to standard out/error rather than to a log file. If you write it to standard out, teamcity will automatically pick it up and show it in the **build logs ** tab
What this means is that if you have a
shell script, use echo for your service messages
java class, use System.out.println
and so on
Different languages also have different plugins for this , for ex perl has TapHarness.pl to write teamcity messages to the console.
EDIT:
If you want to just view service messages , you can find them in the build logs on the teamcity agent that the build ran on. If you do not find them in the build logs , either the build log has rolled over or you need to increase the verbosity or debug level of your logs(depends on the language).
There was a problem which is solved nowdays:
TeamCity now parses service messages inside other service messages, but only if original message was tagged with tc:parseServiceMessagesInside. Example:
##teamcity[testStdOut name='test1' out='##teamcity|[buildStatisticValue key=|'my_stat_value|' value=|'125|'|]' tc:tags='tc:parseServiceMessagesInside']
A link to JetBrains bug tracker:
https://youtrack.jetbrains.com/issue/TW-45311

How to run/debug dashing dashboards on a client PC with Eclipse

I am trying to create a dashboard for work via dashing. I have an openSUSE server set up (command-line only, no X server), and dashing running on it successfully. I want to be able to use my work Windows 7 PC to configure the ruby-based jobs scripts, etc. I have Eclipse set up with Ruby, installed Ruby on Windows and have the debugger configured in eclipse. Git is also set up on the server, for the dashing folder. I have two questions about my methods:
Question 1:
Now, I can configure breakpoints in the ruby jobs and debug my variables, etc., but the debugger throws an error when it reaches the SCHEDULER part (see code pasted below) stating that it is an "uninitialised constant". I'm guessing Eclipse doesn't understand how to run/debug the specific dashing code; apparently dashing uses rufus-scheduler. How can I get Eclipse to run and/or debug my dashing dashboards?
Example of a ruby job in dashing, with rufus-scheduler, from the dashing website:
# :first_in sets how long it takes before the job is first run. In this case, it is run immediately
SCHEDULER.every '1m', :first_in => 0 do |job|
send_event('karma', { current: rand(1000) })
end
Question 2:
Currently the way I move code from my Windows PC to openSUSE, is via git. This means that when I want to test any change (simple or complicated) I must commit to git on the client, then push to the git branch on the server. This means that my commit history is going to be filled with test changes. Is there a better way to do this? (I'm guessing the only way around this, is to create a test web server on my client PC)
Thanks for any help you can provide.
Try "dashing job JOB_NAME AUTH_TOKEN".
The AUTH_TOKEN is stored in config.ru.
Dennis
me#host:~/Projects/my-dashing$ dashing --help
Tasks:
dashing generate (widget/dashboard/job) NAME # Creates a new widget, dashboard, or job.
dashing help [TASK] # Describe available tasks or one specific task
dashing install GIST_ID # Installs a new widget from a gist.
dashing job JOB_NAME AUTH_TOKEN(optional) # Runs the specified job. Make sure to supply your auth token if you have one set.
dashing new PROJECT_NAME # Sets up ALL THE THINGS needed for your dashboard project.
dashing start # Starts the server in style!
me#host:~/Projects/my-dashing$

How to execute a Unix shell script via GWT?

Im building an GUI that will help my team mates to execute some jars without going using the terminal (with all the validating and stuff).
At some stage, the gui sould gather params from the gui and execute them, something like : --start -Xbootclasspath/p:lib/OB-4.3.4.jar:lib/OBNaming-4.3.4.jar -Dmy.property.ns=corbaloc:iiop:localhost:900/NameService -Dmachine=energie -Dexecutable=MOREventd -DtypeArbo=1 -jar MOREventd
I was wondering how could i do that since Runtime Exec doesn't work with Google Web Toolkit)
thx for any help.
The GWT module will need to send details about the invocation to a server by using GWT-RPC, RequestFactory, or some other communication package. The server will then execute the commands on behalf of the browser client.

Resources