Use rohitab API monitor to monitor Windows service startup - windows-services

Is there a way to monitor a Windows service startup using Rohitab API Monitor? It looks like a can only attach to a running process.
Thanks,
Gabriel

Related

How to create Azure service bus relay as a Windows Service ? (not as a console application)

I have following applications:
1. Azure cloud application (mvc mobile web application)
2. Service Bus Relay application(currently console application)
In this user interacts with the cloud application and then I'm sending data to the relay service which we are going to host it in client premises. Right now all the data interactions are fine. I'm able to save and receive data.
As it is a console app it always run as a command prompt. I would like to convert service bus relay application as a windows service so that I won't get this command prompt window. Our client doesn't want command prompt to be run in their server. Is it possible to convert it as a service? or is there is any other way to do it? I see all the examples using console applications.
Please help.
If you're running your app in a Virtual Machine or Cloud Service (web/worker role), you can indeed install a Windows Service. You'd just have to code up the Windows Service shell (start/stop/etc) and incorporate Service Bus code.
If you're running your code as a Web App (in an App Service), then no, you cannot install a Windows Service, as App Service doesn't let you install such software (since everything runs in a sandbox).

How to connect Flink remotely via JMX?

For my upcoming bachelor's thesis I want to develop a tool that collects system and application data from Apache Flink and sends this data in some kind of "events" to another system. This tool will be installed on Flink job- and taskmanager nodes. Beside data from linux system utilities like dstat I would like to collect JMX data.
My problem is, that I couldn't figure out how to connect via remote JMX connection by using a port to Flinks jobmanager. Although the collector will be on the same machine, I really try to avoid using a --javaagent to access JMX data of Flink's JVM.
Another problem is, I have a local docker setup based on https://github.com/apache/flink/tree/master/flink-contrib/docker-flink and updated to flink-1.0.2, that I cannot connect via jconsole because I don't know how to "open" a JMX remote port for the job- and taskmanager.
Is there any way to achieve this?
Thanks in advance, any ideas very appreciated.
Solved!
I needed to add env.java.opts: -Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
in flink-conf.yaml.
No it's possible to connect the jobmanager via jconsole.

TITAN server monitoring via JMX

Is it possible to monitor TITAN cassandra server with rexster remotely via JMX using something like VisualVM?
I have titan installed on the cloud and want to monitor it from my dev box. Is this possible.
I have read this
https://github.com/tinkerpop/rexster/wiki/Monitoring
but it seems that JMX MBeans are only available locally however I could be wrong
You can monitor Rexster JMX remotely with VisualVM, but it takes a bit of configuration and changes to rexster.sh as you need to include these environment variables:
-Dcom.sun.management.jmxremote.port=3333
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
You can read some more about how to do remote setup on the VisualVM site.
You mentioned that you are trying to monitor an instance in the cloud. You didn't mention the cloud provider, but I've had trouble doing this with EC2 in the past. Perhaps this post will help you out. While I've had issues with VisualVM remoting to EC2, I have successfully connected to Rexster via VisualVM from another EC2 instance without trouble so if all else fails that could be your workaround.

Java Service Wrapper & shutdown command

I use JSW to wrap HSQLdb server. HSQL docs say I must connect to server and execute "shutdown" command to terminate server correctly. Is there any way to execute such shutdown command from within wrapper when I use standard service management commands like "net service stop" or button "stop" in service properties?
not quite sure what you are trying to accomplish, but assume that you are running the HSQL server as service and you want to connect from your application to it and when your application stops, it should also stop the HSQL server?
If that's so, then please take a look at the following page:
http://www.informit.com/guides/content.aspx?g=java&seqNum=619
cheers,
edit:
registering the code to cleanly shutdown HSQL as shutdown hook should work for you I think. Furthermore you can also do this with the WrapperListener.stop function (following Integration Method #3)
cheers,

Host console application in windows service

I have a console application which i need to host as an independant windows service.
Any idea how to do that. I was able to register the service but when i try to start it, it gives me error :
Error 1053: the service did not respond to the start or control request in a timely fashion.
Services have to call specific WIN32 APIs to integrate with the Service Control Manager (SCM). This includes being able to receive service commands like stop).
An executable that doesn't call these APIs shortly after startup won't work. Ie. a service needs to be specifically written to be a service. (Note, in .NET this is done by extending ServiceBase rather than P/Invoking the Win32 APIs).
If you cannot modify the exe you have, consider creating a separate service exe that integrates with the SCM and launches/closes your console application.

Resources