How to start and debug opennms using Eclipse - opennms

I'm new with opennms. And I'm working in EMS development.
My team plan to move from current EMS to opennms.
I was successfully configure it using Eclipse but don't know how to start opennms and debug from Eclipse.
Actually, I have succeeded compile and assemble using the command /compile.sh and assemble.sh
But I need to know how to debug, compile and start the opennms using Eclipse.
Thanks,
Alya

To start OpenNMS you have to use the "opennms script". This is located in ${opennms.home}/bin
With the script you can then tell OpenNMS to run in debug mode, like so:
sudo ./opennms -t start
OpenNMS then tells you what the remote debugger port is (default is: 8001).
In eclipse you can then "remote debug" OpenNMS.
How to do this, you can e.g. follow this instruction (http://javarevisited.blogspot.de/2011/02/how-to-setup-remote-debugging-in.html)
I usually start opennms in verbose and debug mode : sudo ./opennms -vt start
opennms usage
Usage: ./opennms [-n] [-t] [-p] [-o] [-c timeout] [-v] [-Q] <command> [<service>]
command options: start|stop|restart|status|check|pause|resume|kill
service options: all|<a service id from the etc/service-configuration.xml>
defaults to all
The following options are available:
-n "No execute" mode. Don't call Java to do anything.
-t Test mode. Enable JPDA on port 8001.
-p Enable TIJMP profiling
-o Enable OProfile profiling
-c Controller HTTP connection timeout in seconds.
-v Verbose mode. When used with the "status" command, gives the
results for all OpenNMS services. When used with "start", enables
some verbose debugging, such as details on garbage collection.
-Q Quick mode. Don't wait for OpenNMS to startup. Useful if you
want to watch the logs while OpenNMS starts up without wanting to
open another terminal window.
"opennnms script" examples
To start opennms: sudo ./opennms start
To start opennms in verbose mode: sudo ./opennms -v start
To start opennms in verbose and debug mode: sudo ./opennms -vt start
To stop opennms: sudo ./opennms stop
Assuming you are in folder ${opennms.home}/bin

Related

Running terminal and entering Commands on Startup (Raspberry Pi)

On startup i am trying to make The Pi open terminal run a source command "source env/bin/activate" and then run the command "google-assistant-demo' all while the terminal is still open. This part is crucial as the google assistant development software i am using requires the console to remain open.
This is for a personal assistant product i am using and i have tried creating a executable sh script on startup but that can only run one command and the terminal closes afterwards.
source env/bin/activate
google-assistant-demo
When i try to edit the startup config file the terminal opens for a second and instantly closes.
Execute script on start-up
Here you can find a page full of wonderful solutions to run a script at the boot startup of the system. Within a script, you can do almost everything you want (for instance run the command you were speaking about source env/bin/activate).
Here another useful link.
How to run a Linux Program on Startup
January 2, 2017 Tim How To, Raspberry Pi
Here are the steps to have a program or script start on boot on a linux machine using Systemctl. I’m currently using this start several services on my raspberry pi. DigitalOcean wrote an article that goes into more detail on Systemctl.
Run this command
sudo nano /etc/systemd/system/YOUR_SERVICE_NAME.service
Paste in the command below. Press ctrl + x then y to save and exit
Description=GIVE_YOUR_SERVICE_A_DESCRIPTION
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
ExecStart=YOUR_COMMAND_HERE
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
Reload services
sudo systemctl daemon-reload
Enable the service
sudo systemctl enable YOUR_SERVICE_NAME
Start the service
sudo systemctl start YOUR_SERVICE_NAME
Check the status of your service
systemctl status YOUR_SERVICE_NAME
Reboot your device and the program/script should be running. If it crashes it will attempt to restart.
Here the link to the original post. However, it seems that you did not check on Google (or other) before: the web is full of such information and many of them are amazing!

How to run jmeter test through remote servers via jenkins

I am having a linux machine (say m1) [an openStack machine] to run my jmeter test.
My typical process was to put latest jmx file on this machine and trigger below command:
nohup /path/to/jmeter/bin/jmeter -n -t /path/to/script/test.jmx -l /path/to/resultsFolder/results.jtl
Now, I want to trigger same test via jenkins job which should actually do the same activity as above.
I perform two activities (one is to manually trigger jmeter-server on m1 and other to run jenkins job to run test via m1)
To start jmeter server
Ran following command manually on m1 ( SERVER_PORT=1099 nohup /path/to/jmeter/bin/jmeter-server)
Jenkins Job
I have created a jenkins pipeline job:
Stage1: checks out jmeter in jenkins master
stage2: checks out latest script in jenkins master
stage3: Runs jmeter remote test -
command used :
sh '''
chmod u+x jmeter/bin/jmeter.sh
jmeter/bin/jmeter.sh -n -t path/where/jenkins/checked/latest/test/test.jmx -R 10.X.X.X -l results.jtl'''
Stage1 and stage2 runs perfectly.
Stage3: console output shows as below
jmeter/bin/jmeter.sh -n -t jmeter/bin/jmeter.sh -n -t path/where/jenkins/checked/latest/test/test.jmx -R 10.X.X.X -l results.jtl
Creating summariser
Created the tree successfully using path/where/jenkins/checked/latest/test/test.jmx
Configuring remote engine: 10.X.X.X
Starting remote engines
Starting the test # Tue Aug 14 10:41:46 CEST 2018 (1534236106818)
Remote engines have been started
Waiting for possible shutdown message on port 4445
And it keep showing processing ......... unless I trigger manual shutdown.
So, I'm looking for two things
a mechanism to start jmeter-server on slave nodes via jenkins job itself
Running test via remote machines (which can go locations within load machine and trigger test from there itslef)
. Any ideas appreciated. Thank you in advance!
You can launch jmeter server on remote slaves in at least 2 ways:
From Jenkins using Jenkins SSH Plugin
From JMeter itself using OS Process Sampler or SSH Command plugin (in this case you will have 2 scripts, one which will set everything up and another will be the main test in distributed mode.

Using VMRUN to execute selenium process in Ubuntu VM without XVFB

I'm using vmrun.exe from VMware Workstation to start an Ubuntu 16 desktop VM and launch a Java selenium Firefox process in it. I can start and launch the script however I would like the selenium process to be visible in case a user would like to monitor it. It gives the following error when trying to launch firefox with a visible GUI.
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/home/vmdops/firefox/firefox) on port 7055; process output follows:
Error: GDK_BACKEND does not match available displays
The following bash script is used to launch the process
java -jar seleniumProcess.jar
I can execute the process headless with XVFB and run the selenium process in memory however then I cannot view the process running visually.
/usr/bin/Xvfb :1 & export DISPLAY=:1
java -jar seleniumProcess.jar
What is the proper terminology to explain why the firefox browser cannot be displayed?
Is there anyway to launch the selenium process from VMRUN that allows the firefox browser to display normally?
Thanks
Conteh
I was able to resolve the issue adding -interactive to the end of the command
vmrun -T player -gu vmdops -gp xxxx runScriptInGuest "C:\VMDOPS2\VMDOPS2.vmx" /bin/bash "sh /home/vmdops/autovpn/runProfiler.sh" -interactive
This works when the use is already logged in interactively. When I launch too quickly after starting the vm I get the following error.
Error: The specified guest user must be logged in interactively to perform this operation
So one must wait a while after booting.

how to check the Jboss (EAP 7) server running status via shell script

I have multiple jboss instance on a particular linux box . I don't want to grep the process id of jboss instance and listen port .Is there any work around from server.log or CLI command ?
In addition to the Panagiotis Chavarioti´s answer, the status of the application component also can be checked with the commands which are handy.
To check if JBoss server is started:
$JBOSS_HOME/bin/jboss-cli.sh -c --commands="read-attribute server-state"
To check if application is started:
$JBOSS_HOME/bin/jboss-cli.sh -c --commands="cd deployment,cd myapp.war, read-attribute status"
example:
$JBOSS_HOME/bin/jboss-cli.sh -c
'/host=sandbox/server=server1:readattribute(name=server-state)'
Try the following CLI command:
$JBOSS_HOME/bin/jboss-cli.sh -c
'/host=<HOSTNAME>/server=<SERVERNAME>:readattribute(name=server-state)'

start Faye server on system start

i want to run Faye server on system startup
i'm trying with this in
/etc/init/faye.conf
description "faye"
author "email#gmail.com"
description "Chat Server for In-house chat rooms"
start on filesystem or runlevel [2345]
stop on run level [!2345]
cd /var/App
exec /usr/local/rvm/gems/ruby-2.0.0-p451/bin/rackup /var/App/faye.ru -s thin -E production
but it not working.
when i'm excuting command
sh faye.conf
then working fine.
and even working via irb console
`/usr/local/rvm/gems/ruby-2.0.0-p451/bin/rackup /var/App/faye.ru -s thin -E production -D`
any idea where is problem why init script not working self ?
after some investigation i found error:
/usr/bin/env: ruby_executable_hooks: No such file or directory

Resources